@acorex-platform/module-integration-management-client 1.0.1 → 2.0.0-beta.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/fesm2022/{acorex-platform-module-integration-management-client-connect-with-credentials.command-DO_zqjHV.mjs → acorex-platform-module-integration-management-client-connect-with-credentials.command-i8HJe3MA.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-connect-with-credentials.command-DO_zqjHV.mjs.map → acorex-platform-module-integration-management-client-connect-with-credentials.command-i8HJe3MA.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-integration-management-client-contracts-entities-integration-remote-record.mjs +1 -0
- package/fesm2022/acorex-platform-module-integration-management-client-contracts-entities-integration-remote-record.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-contracts-entity-catalog-acorex-platform-module-integration-management-client-contracts-entity-catalog-k3HR1biJ.mjs → acorex-platform-module-integration-management-client-contracts-entity-catalog-acorex-platform-module-integration-management-client-contracts-entity-catalog-DKHqdjry.mjs} +5 -5
- package/fesm2022/{acorex-platform-module-integration-management-client-contracts-entity-catalog-acorex-platform-module-integration-management-client-contracts-entity-catalog-k3HR1biJ.mjs.map → acorex-platform-module-integration-management-client-contracts-entity-catalog-acorex-platform-module-integration-management-client-contracts-entity-catalog-DKHqdjry.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-application.entity-DhOHTht5.mjs → acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-application.entity-CWVIUVfP.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-application.entity-DhOHTht5.mjs.map → acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-application.entity-CWVIUVfP.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-connection.entity-BAM1TCdS.mjs → acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-connection.entity-BT7Q1mi2.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-connection.entity-BAM1TCdS.mjs.map → acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-connection.entity-BT7Q1mi2.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-oauth-state.entity-CHsVwNda.mjs → acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-oauth-state.entity-dukBxh7a.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-oauth-state.entity-CHsVwNda.mjs.map → acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-oauth-state.entity-dukBxh7a.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-remote-record.entity-D9oTVEHF.mjs → acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-remote-record.entity-CwQDiNRP.mjs} +3 -2
- package/fesm2022/acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-remote-record.entity-CwQDiNRP.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-integration-management-client-contracts-entity-catalog.mjs +1 -1
- package/fesm2022/acorex-platform-module-integration-management-client-contracts.mjs +6 -1
- package/fesm2022/acorex-platform-module-integration-management-client-contracts.mjs.map +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-delete-connection.command-CCMZwP4W.mjs → acorex-platform-module-integration-management-client-delete-connection.command-DXxr1N1S.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-integration-management-client-delete-connection.command-CCMZwP4W.mjs.map → acorex-platform-module-integration-management-client-delete-connection.command-DXxr1N1S.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-disconnect-connection.command-DpVoXBdW.mjs → acorex-platform-module-integration-management-client-disconnect-connection.command-DwgAYZvz.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-integration-management-client-disconnect-connection.command-DpVoXBdW.mjs.map → acorex-platform-module-integration-management-client-disconnect-connection.command-DwgAYZvz.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-get-provider.query-Ds10RwnU.mjs → acorex-platform-module-integration-management-client-get-provider.query-C6OAU1vi.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-get-provider.query-Ds10RwnU.mjs.map → acorex-platform-module-integration-management-client-get-provider.query-C6OAU1vi.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-integration-connection-lifecycle.dispatcher-DRWR9ysx.mjs → acorex-platform-module-integration-management-client-integration-connection-lifecycle.dispatcher-DjSMX8af.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-integration-connection-lifecycle.dispatcher-DRWR9ysx.mjs.map → acorex-platform-module-integration-management-client-integration-connection-lifecycle.dispatcher-DjSMX8af.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-CY0tOlNi.mjs → acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-iBh2QP2t.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-CY0tOlNi.mjs.map → acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-iBh2QP2t.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-integration-ref-display.service-CP818xou.mjs → acorex-platform-module-integration-management-client-integration-ref-display.service-BQVHcUoD.mjs} +7 -43
- package/fesm2022/acorex-platform-module-integration-management-client-integration-ref-display.service-BQVHcUoD.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-integration-management-client-integration-ref-filter-widget-edit.component-zVURpFT4.mjs → acorex-platform-module-integration-management-client-integration-ref-filter-widget-edit.component-Dy9tVipC.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-integration-management-client-integration-ref-filter-widget-edit.component-zVURpFT4.mjs.map → acorex-platform-module-integration-management-client-integration-ref-filter-widget-edit.component-Dy9tVipC.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-integration-ref-page.component-C131H4e1.mjs → acorex-platform-module-integration-management-client-integration-ref-page.component-DKotZKGJ.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-integration-management-client-integration-ref-page.component-C131H4e1.mjs.map → acorex-platform-module-integration-management-client-integration-ref-page.component-DKotZKGJ.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-integration-ref-widget-column.component-ClPcvcUW.mjs → acorex-platform-module-integration-management-client-integration-ref-widget-column.component-CNdvygau.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-integration-management-client-integration-ref-widget-column.component-ClPcvcUW.mjs.map → acorex-platform-module-integration-management-client-integration-ref-widget-column.component-CNdvygau.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-integration-ref-widget-view.component-BRpGpWHZ.mjs → acorex-platform-module-integration-management-client-integration-ref-widget-view.component-BlO90XqK.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-integration-management-client-integration-ref-widget-view.component-BRpGpWHZ.mjs.map → acorex-platform-module-integration-management-client-integration-ref-widget-view.component-BlO90XqK.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-integrations-page.component-B_YdPi2k.mjs → acorex-platform-module-integration-management-client-integrations-page.component-BUQG6o29.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-integration-management-client-integrations-page.component-B_YdPi2k.mjs.map → acorex-platform-module-integration-management-client-integrations-page.component-BUQG6o29.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-list-domains.query--GGD6J46.mjs → acorex-platform-module-integration-management-client-list-domains.query-Ca1m9f4f.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-list-domains.query--GGD6J46.mjs.map → acorex-platform-module-integration-management-client-list-domains.query-Ca1m9f4f.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-list-my-connections.query-CmHu1qFm.mjs → acorex-platform-module-integration-management-client-list-my-connections.query-DSeVnGtV.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-list-my-connections.query-CmHu1qFm.mjs.map → acorex-platform-module-integration-management-client-list-my-connections.query-DSeVnGtV.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-list-providers.query-ODKJ_UhI.mjs → acorex-platform-module-integration-management-client-list-providers.query-J5DtFS0C.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-list-providers.query-ODKJ_UhI.mjs.map → acorex-platform-module-integration-management-client-list-providers.query-J5DtFS0C.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-update-connection.command-Kqir73pA.mjs → acorex-platform-module-integration-management-client-update-connection.command-B-WPsT5j.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-integration-management-client-update-connection.command-Kqir73pA.mjs.map → acorex-platform-module-integration-management-client-update-connection.command-B-WPsT5j.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-validate-connection.command-D4RZ6WPP.mjs → acorex-platform-module-integration-management-client-validate-connection.command-D2QgFRTV.mjs} +1 -1
- package/fesm2022/{acorex-platform-module-integration-management-client-validate-connection.command-D4RZ6WPP.mjs.map → acorex-platform-module-integration-management-client-validate-connection.command-D2QgFRTV.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-integration-management-client.mjs +102 -44
- package/fesm2022/acorex-platform-module-integration-management-client.mjs.map +1 -1
- package/package.json +1 -1
- package/types/acorex-platform-module-integration-management-client-contracts.d.ts +7 -2
- package/types/acorex-platform-module-integration-management-client.d.ts +10 -1
- package/fesm2022/acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-remote-record.entity-D9oTVEHF.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-integration-management-client-integration-ref-display.service-CP818xou.mjs.map +0 -1
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import { AXP_INTEGRATION_CONNECTION_STATUS, AXP_INTEGRATION_CONNECTION_SCOPE, AXP_INTEGRATION_CATEGORY, AXPIntegrationNotConnectedError, AXPIntegrationExpiredError, AXPIntegrationMissingScopeError } from '@acorex-platform/framework-shared/core';
|
|
2
2
|
import { AXPSessionService, AXP_PERMISSION_DEFINITION_PROVIDER } from '@acorex-platform/framework-client/auth';
|
|
3
|
-
import { AXPEntityService, configureEntityListColumnsSettingsMigrateDrop, configureEntityListColumnsSettingsVersion, AXP_ENTITY_ACTION_PLUGIN, AXP_ENTITY_MODIFIER } from '@acorex-platform/framework-client/layout/entity';
|
|
3
|
+
import { AXPEntityService, AXPRecordWriteScope, configureEntityListColumnsSettingsMigrateDrop, configureEntityListColumnsSettingsVersion, AXP_ENTITY_ACTION_PLUGIN, AXP_ENTITY_MODIFIER } from '@acorex-platform/framework-client/layout/entity';
|
|
4
4
|
import * as i0 from '@angular/core';
|
|
5
5
|
import { inject, Injectable, NgModule } from '@angular/core';
|
|
6
|
-
import {
|
|
6
|
+
import { trim, defaultTo, isEmpty } from 'lodash';
|
|
7
7
|
import { RootConfig, AXPAdministrationPermissionKeys, AXMIntegrationManagementMenuKeys, AXMIntegrationManagementCommandKeys, AXMIntegrationManagementQueryKeys } from '@acorex-platform/module-integration-management-client/contracts';
|
|
8
8
|
export { IntegrationManagementManifest } from '@acorex-platform/module-integration-management-client/contracts';
|
|
9
|
-
import { AXPIntegrationRuntimeService, AXPIntegrationProviderRegistryService, AXP_INTEGRATION_SECRET_STORE, AXP_INTEGRATION_RUNTIME_PROVIDER, AXP_PROTECTED_ROUTE_GUARDS, AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER, AXP_INTEGRATION_DOMAIN_PROVIDER } from '@acorex-platform/framework-client/common';
|
|
9
|
+
import { AXPIntegrationRuntimeService, AXPIntegrationProviderRegistryService, AXP_INTEGRATION_SECRET_STORE, AXP_INTEGRATION_RUNTIME_PROVIDER, AXP_PROTECTED_ROUTE_GUARDS, AXP_MENU_PROVIDER, AXP_SETTING_DEFINITION_PROVIDER, AXP_INTEGRATION_DOMAIN_PROVIDER, AXP_RECORD_CONCURRENCY } from '@acorex-platform/framework-client/common';
|
|
10
10
|
import { AXP_EXPRESSION_EVALUATOR_SCOPE_PROVIDER } from '@acorex-platform/framework-client/core';
|
|
11
11
|
import { AXP_PAGE_COMPONENT_PROVIDER } from '@acorex-platform/framework-client/layout/components';
|
|
12
12
|
import { AXP_WIDGET_DEFINITION_PROVIDER } from '@acorex-platform/framework-client/layout/widget-core';
|
|
13
|
-
import { AXPRuntimeModule, provideCommandSetups, provideQuerySetups } from '@acorex-platform/framework-client/runtime';
|
|
13
|
+
import { AXPRuntimeModule, AXP_COMMAND_EXECUTION_PROVIDERS, provideCommandSetups, provideQuerySetups } from '@acorex-platform/framework-client/runtime';
|
|
14
14
|
import { CommonModule } from '@angular/common';
|
|
15
15
|
import { ROUTES } from '@angular/router';
|
|
16
16
|
import { AXPCommonMenuKeys, AXPCommonPermissionGroupKeys } from '@acorex-platform/module-common-client/contracts';
|
|
@@ -23,12 +23,20 @@ import { AXPWidgetGroupEnum } from '@acorex-platform/framework-shared/widget-cor
|
|
|
23
23
|
|
|
24
24
|
//#region ---- Credential helpers ----
|
|
25
25
|
const AXP_INTEGRATION_CREDENTIAL_MASK = '••••••••';
|
|
26
|
+
/** User owner stored on `config` because create stamps `scopeInfo` without `userId`. */
|
|
27
|
+
const CONNECTION_OWNER_USER_ID_FIELD = 'config.ownerUserId';
|
|
28
|
+
function connectionOwnerUserId(connection) {
|
|
29
|
+
const config = (connection.config ?? {});
|
|
30
|
+
return trim(defaultTo(config.ownerUserId, connection.scopeInfo?.userId));
|
|
31
|
+
}
|
|
26
32
|
function hasConfigCredential(config) {
|
|
27
33
|
return (!isEmpty(trim(String(config['apiKey'] ?? ''))) ||
|
|
28
34
|
!isEmpty(trim(String(config['accessToken'] ?? ''))) ||
|
|
29
35
|
!isEmpty(trim(String(config['refreshToken'] ?? ''))) ||
|
|
30
36
|
!isEmpty(trim(String(config['clientSecret'] ?? ''))) ||
|
|
31
|
-
!isEmpty(trim(String(config['
|
|
37
|
+
!isEmpty(trim(String(config['secretKey'] ?? ''))) ||
|
|
38
|
+
!isEmpty(trim(String(config['botToken'] ?? ''))) ||
|
|
39
|
+
!isEmpty(trim(String(config['token'] ?? ''))));
|
|
32
40
|
}
|
|
33
41
|
function isMaskedIntegrationCredential(value) {
|
|
34
42
|
const normalized = trim(value ?? '');
|
|
@@ -49,6 +57,7 @@ function scrubDisconnectedConnectionConfig(config) {
|
|
|
49
57
|
delete next['password'];
|
|
50
58
|
delete next['apiToken'];
|
|
51
59
|
delete next['apiKey'];
|
|
60
|
+
delete next['secretKey'];
|
|
52
61
|
delete next['botToken'];
|
|
53
62
|
return next;
|
|
54
63
|
}
|
|
@@ -104,6 +113,7 @@ class AXMIntegrationConnectionManager {
|
|
|
104
113
|
//#region ---- Services & Dependencies ----
|
|
105
114
|
this.entityService = inject(AXPEntityService);
|
|
106
115
|
this.sessionService = inject(AXPSessionService);
|
|
116
|
+
this.writeScope = inject(AXPRecordWriteScope, { optional: true });
|
|
107
117
|
}
|
|
108
118
|
//#endregion
|
|
109
119
|
//#region ---- Accessors ----
|
|
@@ -127,7 +137,7 @@ class AXMIntegrationConnectionManager {
|
|
|
127
137
|
{ field: 'scopeInfo.applicationId', operator: { type: 'equal' }, value: applicationId },
|
|
128
138
|
];
|
|
129
139
|
if (userId) {
|
|
130
|
-
filters.push({ field:
|
|
140
|
+
filters.push({ field: CONNECTION_OWNER_USER_ID_FIELD, operator: { type: 'equal' }, value: userId });
|
|
131
141
|
}
|
|
132
142
|
return filters;
|
|
133
143
|
}
|
|
@@ -140,6 +150,10 @@ class AXMIntegrationConnectionManager {
|
|
|
140
150
|
}
|
|
141
151
|
//#endregion
|
|
142
152
|
//#region ---- Queries ----
|
|
153
|
+
connectionReadKey(input, context) {
|
|
154
|
+
return JSON.stringify(['unique', context.tenantId, context.applicationId, input.connectionScope,
|
|
155
|
+
input.connectionScope === AXP_INTEGRATION_CONNECTION_SCOPE.User ? context.userId : null, input.providerId, input.connectionKey]);
|
|
156
|
+
}
|
|
143
157
|
async listForCurrentUser(connectionScope) {
|
|
144
158
|
const { tenantId, applicationId, userId } = this.getSessionContext();
|
|
145
159
|
const result = await this.connectionAccessor().query({
|
|
@@ -168,7 +182,7 @@ class AXMIntegrationConnectionManager {
|
|
|
168
182
|
operator: { type: 'equal' },
|
|
169
183
|
value: AXP_INTEGRATION_CONNECTION_SCOPE.User,
|
|
170
184
|
},
|
|
171
|
-
{ field:
|
|
185
|
+
{ field: CONNECTION_OWNER_USER_ID_FIELD, operator: { type: 'equal' }, value: userId },
|
|
172
186
|
],
|
|
173
187
|
},
|
|
174
188
|
],
|
|
@@ -180,7 +194,7 @@ class AXMIntegrationConnectionManager {
|
|
|
180
194
|
if (item.connectionScope === AXP_INTEGRATION_CONNECTION_SCOPE.Tenant) {
|
|
181
195
|
return true;
|
|
182
196
|
}
|
|
183
|
-
return item
|
|
197
|
+
return connectionOwnerUserId(item) === userId;
|
|
184
198
|
});
|
|
185
199
|
}
|
|
186
200
|
async findByUniqueKey(input) {
|
|
@@ -199,7 +213,9 @@ class AXMIntegrationConnectionManager {
|
|
|
199
213
|
take: 1,
|
|
200
214
|
filter: { logic: 'and', filters },
|
|
201
215
|
});
|
|
202
|
-
|
|
216
|
+
const connection = result.items?.[0] ?? null;
|
|
217
|
+
this.writeScope?.capture(`${RootConfig.module.name}.${RootConfig.entities.integrationConnection.name}`, this.connectionReadKey(input, { tenantId, applicationId, userId }), connection);
|
|
218
|
+
return connection;
|
|
203
219
|
}
|
|
204
220
|
async getByIdForCurrentUser(connectionId) {
|
|
205
221
|
const connection = await this.connectionAccessor().byKey(connectionId);
|
|
@@ -221,8 +237,12 @@ class AXMIntegrationConnectionManager {
|
|
|
221
237
|
userId: data.connectionScope === AXP_INTEGRATION_CONNECTION_SCOPE.User ? userId : undefined,
|
|
222
238
|
});
|
|
223
239
|
const scopeInfo = this.buildOwnershipInfo(tenantId, applicationId, data.connectionScope, userId);
|
|
240
|
+
const config = data.connectionScope === AXP_INTEGRATION_CONNECTION_SCOPE.User
|
|
241
|
+
? { ...(data.config ?? {}), ownerUserId: userId }
|
|
242
|
+
: (data.config ?? null);
|
|
224
243
|
const payload = {
|
|
225
244
|
...data,
|
|
245
|
+
config,
|
|
226
246
|
scopeInfo,
|
|
227
247
|
isRevoked: defaultTo(data.isRevoked, false),
|
|
228
248
|
isDisabled: defaultTo(data.isDisabled, false),
|
|
@@ -230,7 +250,11 @@ class AXMIntegrationConnectionManager {
|
|
|
230
250
|
lastConnectedAt: data.lastConnectedAt ?? new Date().toISOString(),
|
|
231
251
|
};
|
|
232
252
|
if (existing) {
|
|
233
|
-
|
|
253
|
+
const condition = this.writeScope?.condition(`${RootConfig.module.name}.${RootConfig.entities.integrationConnection.name}`, this.connectionReadKey(data, { tenantId, applicationId, userId }));
|
|
254
|
+
const fields = payload;
|
|
255
|
+
if (condition && !Object.prototype.hasOwnProperty.call(fields, '_writeCondition') && !Object.prototype.hasOwnProperty.call(fields, '_writeStamp'))
|
|
256
|
+
fields['_writeCondition'] = condition;
|
|
257
|
+
await this.connectionAccessor().update(existing.id, payload, this.writeScope ? undefined : existing);
|
|
234
258
|
const updated = await this.connectionAccessor().byKey(existing.id);
|
|
235
259
|
if (!updated) {
|
|
236
260
|
throw new Error('Connection not found after update.');
|
|
@@ -258,7 +282,7 @@ class AXMIntegrationConnectionManager {
|
|
|
258
282
|
lastSyncAt: data.lastSyncAt ?? null,
|
|
259
283
|
lastErrorCode: data.lastErrorCode ?? null,
|
|
260
284
|
lastErrorMessage: data.lastErrorMessage ?? null,
|
|
261
|
-
config
|
|
285
|
+
config,
|
|
262
286
|
};
|
|
263
287
|
const id = await this.connectionAccessor().create(createPayload);
|
|
264
288
|
const created = await this.connectionAccessor().byKey(id);
|
|
@@ -272,7 +296,7 @@ class AXMIntegrationConnectionManager {
|
|
|
272
296
|
if (!existing) {
|
|
273
297
|
throw new Error('Connection not found or access denied.');
|
|
274
298
|
}
|
|
275
|
-
await this.connectionAccessor().update(connectionId, patch);
|
|
299
|
+
await this.connectionAccessor().update(connectionId, patch, this.writeScope ? undefined : existing);
|
|
276
300
|
const updated = await this.connectionAccessor().byKey(connectionId);
|
|
277
301
|
if (!updated) {
|
|
278
302
|
throw new Error('Connection not found after update.');
|
|
@@ -299,7 +323,7 @@ class AXMIntegrationConnectionManager {
|
|
|
299
323
|
if (connection.connectionScope === AXP_INTEGRATION_CONNECTION_SCOPE.Tenant) {
|
|
300
324
|
return true;
|
|
301
325
|
}
|
|
302
|
-
return connection
|
|
326
|
+
return connectionOwnerUserId(connection) === userId;
|
|
303
327
|
}
|
|
304
328
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMIntegrationConnectionManager, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
305
329
|
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMIntegrationConnectionManager, providedIn: 'root' }); }
|
|
@@ -372,28 +396,28 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
372
396
|
//#region ---- Imports ----
|
|
373
397
|
//#endregion
|
|
374
398
|
//#region ---- Settings Provider ----
|
|
375
|
-
const I18N$
|
|
399
|
+
const I18N$2 = '@integration-management:settings';
|
|
376
400
|
class AXMIntegrationManagementSettingProvider {
|
|
377
401
|
async provide(context) {
|
|
378
402
|
if (context.hasGroup('integrations')) {
|
|
379
403
|
return;
|
|
380
404
|
}
|
|
381
405
|
context
|
|
382
|
-
.addGroup('integrations', `${I18N$
|
|
406
|
+
.addGroup('integrations', `${I18N$2}.group.nav-title`, `${I18N$2}.group.description`, 'fa-light fa-plug', `${I18N$2}.group.title`, 45)
|
|
383
407
|
.endGroup();
|
|
384
408
|
}
|
|
385
409
|
}
|
|
386
410
|
//#endregion
|
|
387
411
|
|
|
388
|
-
const I18N = '@integration-management:settings.domains.other';
|
|
412
|
+
const I18N$1 = '@integration-management:settings.domains.other';
|
|
389
413
|
/** Fallback domain for connectors not yet assigned to a first-class integration domain. */
|
|
390
414
|
class AXMIntegrationLegacyDomainProvider {
|
|
391
415
|
async provide(context) {
|
|
392
416
|
context.register({
|
|
393
417
|
id: 'other',
|
|
394
418
|
module: RootConfig.module.name,
|
|
395
|
-
displayName: `${I18N}.title`,
|
|
396
|
-
description: `${I18N}.description`,
|
|
419
|
+
displayName: `${I18N$1}.title`,
|
|
420
|
+
description: `${I18N$1}.description`,
|
|
397
421
|
icon: 'fa-light fa-plug',
|
|
398
422
|
category: AXP_INTEGRATION_CATEGORY.Other,
|
|
399
423
|
capabilities: [],
|
|
@@ -564,7 +588,7 @@ function integrationManagementRoutesFactory() {
|
|
|
564
588
|
children: [
|
|
565
589
|
{
|
|
566
590
|
path: '',
|
|
567
|
-
loadComponent: () => import('./acorex-platform-module-integration-management-client-integrations-page.component-
|
|
591
|
+
loadComponent: () => import('./acorex-platform-module-integration-management-client-integrations-page.component-BUQG6o29.mjs').then((c) => c.AXMIntegrationsPageComponent),
|
|
568
592
|
data: { reuse: true },
|
|
569
593
|
},
|
|
570
594
|
],
|
|
@@ -577,12 +601,12 @@ const integrationOAuthCallbackRoutes = [
|
|
|
577
601
|
// App-agnostic callback first — must win over `:appName/...` (else appName="integrations").
|
|
578
602
|
{
|
|
579
603
|
path: 'integrations/oauth/callback/:providerId',
|
|
580
|
-
loadComponent: () => import('./acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-
|
|
604
|
+
loadComponent: () => import('./acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-iBh2QP2t.mjs').then((c) => c.AXMIntegrationOAuthCallbackPageComponent),
|
|
581
605
|
},
|
|
582
606
|
// Legacy app-prefixed callback (older provider redirect URI configs).
|
|
583
607
|
{
|
|
584
608
|
path: ':appName/integrations/oauth/callback/:providerId',
|
|
585
|
-
loadComponent: () => import('./acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-
|
|
609
|
+
loadComponent: () => import('./acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-iBh2QP2t.mjs').then((c) => c.AXMIntegrationOAuthCallbackPageComponent),
|
|
586
610
|
},
|
|
587
611
|
];
|
|
588
612
|
|
|
@@ -608,9 +632,10 @@ const AXMIntegrationRefFilterWidget = {
|
|
|
608
632
|
properties: [AXP_NAME_PROPERTY, AXP_DATA_PATH_PROPERTY, AXP_DISABLED_PROPERTY],
|
|
609
633
|
components: {
|
|
610
634
|
edit: {
|
|
611
|
-
component: () => import('./acorex-platform-module-integration-management-client-integration-ref-filter-widget-edit.component-
|
|
635
|
+
component: () => import('./acorex-platform-module-integration-management-client-integration-ref-filter-widget-edit.component-Dy9tVipC.mjs').then((c) => c.AXMIntegrationRefFilterWidgetEditComponent),
|
|
612
636
|
},
|
|
613
637
|
},
|
|
638
|
+
toString: `display(value)`,
|
|
614
639
|
};
|
|
615
640
|
//#endregion
|
|
616
641
|
|
|
@@ -633,12 +658,13 @@ const AXMIntegrationRefWidget = {
|
|
|
633
658
|
properties: [],
|
|
634
659
|
components: {
|
|
635
660
|
column: {
|
|
636
|
-
component: () => import('./acorex-platform-module-integration-management-client-integration-ref-widget-column.component-
|
|
661
|
+
component: () => import('./acorex-platform-module-integration-management-client-integration-ref-widget-column.component-CNdvygau.mjs').then((c) => c.AXMIntegrationRefWidgetColumnComponent),
|
|
637
662
|
},
|
|
638
663
|
view: {
|
|
639
|
-
component: () => import('./acorex-platform-module-integration-management-client-integration-ref-widget-view.component-
|
|
664
|
+
component: () => import('./acorex-platform-module-integration-management-client-integration-ref-widget-view.component-BlO90XqK.mjs').then((c) => c.AXMIntegrationRefWidgetViewComponent),
|
|
640
665
|
},
|
|
641
666
|
},
|
|
667
|
+
toString: `display(value)`,
|
|
642
668
|
};
|
|
643
669
|
//#endregion
|
|
644
670
|
|
|
@@ -770,6 +796,7 @@ function applyIntegrationRefEnhancements(ctx, options = {}) {
|
|
|
770
796
|
ctx.entity.pages ??= [];
|
|
771
797
|
const page = {
|
|
772
798
|
componentKey: AXM_INTEGRATION_REF_PAGE_COMPONENT_KEY,
|
|
799
|
+
readFields: ['integrationRef'],
|
|
773
800
|
title: pageTitle,
|
|
774
801
|
icon: pageIcon,
|
|
775
802
|
layout: { order: pageOrder, position: 'after' },
|
|
@@ -886,7 +913,7 @@ class AXMIntegrationRefPageComponentProvider {
|
|
|
886
913
|
return [
|
|
887
914
|
{
|
|
888
915
|
key: AXM_INTEGRATION_REF_PAGE_COMPONENT_KEY,
|
|
889
|
-
loader: () => import('./acorex-platform-module-integration-management-client-integration-ref-page.component-
|
|
916
|
+
loader: () => import('./acorex-platform-module-integration-management-client-integration-ref-page.component-DKotZKGJ.mjs').then((m) => m.AXMIntegrationRefPageComponent),
|
|
890
917
|
},
|
|
891
918
|
];
|
|
892
919
|
}
|
|
@@ -917,6 +944,7 @@ class AXMIntegrationManagementModule {
|
|
|
917
944
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMIntegrationManagementModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
918
945
|
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "22.0.8", ngImport: i0, type: AXMIntegrationManagementModule, imports: [CommonModule, AXPRuntimeModule, AXMIntegrationRefPluginModule] }); }
|
|
919
946
|
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMIntegrationManagementModule, providers: [
|
|
947
|
+
{ provide: AXP_COMMAND_EXECUTION_PROVIDERS, multi: true, useFactory: () => inject(AXP_RECORD_CONCURRENCY, { optional: true }) ? [AXMIntegrationConnectionManager] : [] },
|
|
920
948
|
{
|
|
921
949
|
provide: ROUTES,
|
|
922
950
|
multi: true,
|
|
@@ -964,41 +992,41 @@ class AXMIntegrationManagementModule {
|
|
|
964
992
|
provideCommandSetups([
|
|
965
993
|
{
|
|
966
994
|
key: AXMIntegrationManagementCommandKeys.ConnectionConnectWithCredentials,
|
|
967
|
-
command: () => import('./acorex-platform-module-integration-management-client-connect-with-credentials.command-
|
|
995
|
+
command: () => import('./acorex-platform-module-integration-management-client-connect-with-credentials.command-i8HJe3MA.mjs').then((c) => c.ConnectWithCredentialsCommand),
|
|
968
996
|
},
|
|
969
997
|
{
|
|
970
998
|
key: AXMIntegrationManagementCommandKeys.ConnectionDisconnect,
|
|
971
|
-
command: () => import('./acorex-platform-module-integration-management-client-disconnect-connection.command-
|
|
999
|
+
command: () => import('./acorex-platform-module-integration-management-client-disconnect-connection.command-DwgAYZvz.mjs').then((c) => c.DisconnectConnectionCommand),
|
|
972
1000
|
},
|
|
973
1001
|
{
|
|
974
1002
|
key: AXMIntegrationManagementCommandKeys.ConnectionDelete,
|
|
975
|
-
command: () => import('./acorex-platform-module-integration-management-client-delete-connection.command-
|
|
1003
|
+
command: () => import('./acorex-platform-module-integration-management-client-delete-connection.command-DXxr1N1S.mjs').then((c) => c.DeleteConnectionCommand),
|
|
976
1004
|
},
|
|
977
1005
|
{
|
|
978
1006
|
key: AXMIntegrationManagementCommandKeys.ConnectionUpdate,
|
|
979
|
-
command: () => import('./acorex-platform-module-integration-management-client-update-connection.command-
|
|
1007
|
+
command: () => import('./acorex-platform-module-integration-management-client-update-connection.command-B-WPsT5j.mjs').then((c) => c.UpdateConnectionCommand),
|
|
980
1008
|
},
|
|
981
1009
|
{
|
|
982
1010
|
key: AXMIntegrationManagementCommandKeys.ConnectionValidate,
|
|
983
|
-
command: () => import('./acorex-platform-module-integration-management-client-validate-connection.command-
|
|
1011
|
+
command: () => import('./acorex-platform-module-integration-management-client-validate-connection.command-D2QgFRTV.mjs').then((c) => c.ValidateConnectionCommand),
|
|
984
1012
|
},
|
|
985
1013
|
]),
|
|
986
1014
|
provideQuerySetups([
|
|
987
1015
|
{
|
|
988
1016
|
key: AXMIntegrationManagementQueryKeys.DomainList,
|
|
989
|
-
loader: () => import('./acorex-platform-module-integration-management-client-list-domains.query
|
|
1017
|
+
loader: () => import('./acorex-platform-module-integration-management-client-list-domains.query-Ca1m9f4f.mjs').then((c) => c.ListDomainsQuery),
|
|
990
1018
|
},
|
|
991
1019
|
{
|
|
992
1020
|
key: AXMIntegrationManagementQueryKeys.ProviderList,
|
|
993
|
-
loader: () => import('./acorex-platform-module-integration-management-client-list-providers.query-
|
|
1021
|
+
loader: () => import('./acorex-platform-module-integration-management-client-list-providers.query-J5DtFS0C.mjs').then((c) => c.ListProvidersQuery),
|
|
994
1022
|
},
|
|
995
1023
|
{
|
|
996
1024
|
key: AXMIntegrationManagementQueryKeys.ProviderGet,
|
|
997
|
-
loader: () => import('./acorex-platform-module-integration-management-client-get-provider.query-
|
|
1025
|
+
loader: () => import('./acorex-platform-module-integration-management-client-get-provider.query-C6OAU1vi.mjs').then((c) => c.GetProviderQuery),
|
|
998
1026
|
},
|
|
999
1027
|
{
|
|
1000
1028
|
key: AXMIntegrationManagementQueryKeys.ConnectionListMine,
|
|
1001
|
-
loader: () => import('./acorex-platform-module-integration-management-client-list-my-connections.query-
|
|
1029
|
+
loader: () => import('./acorex-platform-module-integration-management-client-list-my-connections.query-DSeVnGtV.mjs').then((c) => c.ListMyConnectionsQuery),
|
|
1002
1030
|
},
|
|
1003
1031
|
]),
|
|
1004
1032
|
], imports: [CommonModule, AXPRuntimeModule, AXMIntegrationRefPluginModule] }); }
|
|
@@ -1008,6 +1036,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
1008
1036
|
args: [{
|
|
1009
1037
|
imports: [CommonModule, AXPRuntimeModule, AXMIntegrationRefPluginModule],
|
|
1010
1038
|
providers: [
|
|
1039
|
+
{ provide: AXP_COMMAND_EXECUTION_PROVIDERS, multi: true, useFactory: () => inject(AXP_RECORD_CONCURRENCY, { optional: true }) ? [AXMIntegrationConnectionManager] : [] },
|
|
1011
1040
|
{
|
|
1012
1041
|
provide: ROUTES,
|
|
1013
1042
|
multi: true,
|
|
@@ -1055,50 +1084,79 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
1055
1084
|
provideCommandSetups([
|
|
1056
1085
|
{
|
|
1057
1086
|
key: AXMIntegrationManagementCommandKeys.ConnectionConnectWithCredentials,
|
|
1058
|
-
command: () => import('./acorex-platform-module-integration-management-client-connect-with-credentials.command-
|
|
1087
|
+
command: () => import('./acorex-platform-module-integration-management-client-connect-with-credentials.command-i8HJe3MA.mjs').then((c) => c.ConnectWithCredentialsCommand),
|
|
1059
1088
|
},
|
|
1060
1089
|
{
|
|
1061
1090
|
key: AXMIntegrationManagementCommandKeys.ConnectionDisconnect,
|
|
1062
|
-
command: () => import('./acorex-platform-module-integration-management-client-disconnect-connection.command-
|
|
1091
|
+
command: () => import('./acorex-platform-module-integration-management-client-disconnect-connection.command-DwgAYZvz.mjs').then((c) => c.DisconnectConnectionCommand),
|
|
1063
1092
|
},
|
|
1064
1093
|
{
|
|
1065
1094
|
key: AXMIntegrationManagementCommandKeys.ConnectionDelete,
|
|
1066
|
-
command: () => import('./acorex-platform-module-integration-management-client-delete-connection.command-
|
|
1095
|
+
command: () => import('./acorex-platform-module-integration-management-client-delete-connection.command-DXxr1N1S.mjs').then((c) => c.DeleteConnectionCommand),
|
|
1067
1096
|
},
|
|
1068
1097
|
{
|
|
1069
1098
|
key: AXMIntegrationManagementCommandKeys.ConnectionUpdate,
|
|
1070
|
-
command: () => import('./acorex-platform-module-integration-management-client-update-connection.command-
|
|
1099
|
+
command: () => import('./acorex-platform-module-integration-management-client-update-connection.command-B-WPsT5j.mjs').then((c) => c.UpdateConnectionCommand),
|
|
1071
1100
|
},
|
|
1072
1101
|
{
|
|
1073
1102
|
key: AXMIntegrationManagementCommandKeys.ConnectionValidate,
|
|
1074
|
-
command: () => import('./acorex-platform-module-integration-management-client-validate-connection.command-
|
|
1103
|
+
command: () => import('./acorex-platform-module-integration-management-client-validate-connection.command-D2QgFRTV.mjs').then((c) => c.ValidateConnectionCommand),
|
|
1075
1104
|
},
|
|
1076
1105
|
]),
|
|
1077
1106
|
provideQuerySetups([
|
|
1078
1107
|
{
|
|
1079
1108
|
key: AXMIntegrationManagementQueryKeys.DomainList,
|
|
1080
|
-
loader: () => import('./acorex-platform-module-integration-management-client-list-domains.query
|
|
1109
|
+
loader: () => import('./acorex-platform-module-integration-management-client-list-domains.query-Ca1m9f4f.mjs').then((c) => c.ListDomainsQuery),
|
|
1081
1110
|
},
|
|
1082
1111
|
{
|
|
1083
1112
|
key: AXMIntegrationManagementQueryKeys.ProviderList,
|
|
1084
|
-
loader: () => import('./acorex-platform-module-integration-management-client-list-providers.query-
|
|
1113
|
+
loader: () => import('./acorex-platform-module-integration-management-client-list-providers.query-J5DtFS0C.mjs').then((c) => c.ListProvidersQuery),
|
|
1085
1114
|
},
|
|
1086
1115
|
{
|
|
1087
1116
|
key: AXMIntegrationManagementQueryKeys.ProviderGet,
|
|
1088
|
-
loader: () => import('./acorex-platform-module-integration-management-client-get-provider.query-
|
|
1117
|
+
loader: () => import('./acorex-platform-module-integration-management-client-get-provider.query-C6OAU1vi.mjs').then((c) => c.GetProviderQuery),
|
|
1089
1118
|
},
|
|
1090
1119
|
{
|
|
1091
1120
|
key: AXMIntegrationManagementQueryKeys.ConnectionListMine,
|
|
1092
|
-
loader: () => import('./acorex-platform-module-integration-management-client-list-my-connections.query-
|
|
1121
|
+
loader: () => import('./acorex-platform-module-integration-management-client-list-my-connections.query-DSeVnGtV.mjs').then((c) => c.ListMyConnectionsQuery),
|
|
1093
1122
|
},
|
|
1094
1123
|
]),
|
|
1095
1124
|
],
|
|
1096
1125
|
}]
|
|
1097
1126
|
}] });
|
|
1098
1127
|
|
|
1128
|
+
//#region ----- Imports -----
|
|
1129
|
+
//#endregion
|
|
1130
|
+
//#region ----- Constants -----
|
|
1131
|
+
const INTEGRATIONS_SETTINGS_GROUP = 'integrations';
|
|
1132
|
+
/** One section for every personal connection card (Telegram, WhatsApp, Jira, …). */
|
|
1133
|
+
const USER_CONNECTIONS_SECTION = 'user-connections';
|
|
1134
|
+
const I18N = '@integration-management:settings.section.connections';
|
|
1135
|
+
//#endregion
|
|
1136
|
+
//#region ----- Section -----
|
|
1137
|
+
/**
|
|
1138
|
+
* Returns the shared user-connections section on the Integrations settings group.
|
|
1139
|
+
* The first caller creates it. Later callers append cards to the same section.
|
|
1140
|
+
*/
|
|
1141
|
+
function ensureUserIntegrationConnectionsSection(context) {
|
|
1142
|
+
if (!context.hasGroup(INTEGRATIONS_SETTINGS_GROUP)) {
|
|
1143
|
+
return null;
|
|
1144
|
+
}
|
|
1145
|
+
const integrations = context.group(INTEGRATIONS_SETTINGS_GROUP);
|
|
1146
|
+
const group = context.getGroup(INTEGRATIONS_SETTINGS_GROUP);
|
|
1147
|
+
if (!integrations || !group) {
|
|
1148
|
+
return null;
|
|
1149
|
+
}
|
|
1150
|
+
if (group.sections.some((section) => section.name === USER_CONNECTIONS_SECTION)) {
|
|
1151
|
+
return integrations.section(USER_CONNECTIONS_SECTION);
|
|
1152
|
+
}
|
|
1153
|
+
return integrations.addSection(USER_CONNECTIONS_SECTION, `${I18N}.title`, `${I18N}.description`);
|
|
1154
|
+
}
|
|
1155
|
+
//#endregion
|
|
1156
|
+
|
|
1099
1157
|
/**
|
|
1100
1158
|
* Generated bundle index. Do not edit.
|
|
1101
1159
|
*/
|
|
1102
1160
|
|
|
1103
|
-
export { AXMIntegrationConnectionManager, AXMIntegrationManagementModule, AXP_INTEGRATION_CREDENTIAL_MASK, hasConfiguredIntegrationCredentials, isMaskedIntegrationCredential, scrubDisconnectedConnectionConfig, toSafeIntegrationConnectionDto };
|
|
1161
|
+
export { AXMIntegrationConnectionManager, AXMIntegrationManagementModule, AXP_INTEGRATION_CREDENTIAL_MASK, ensureUserIntegrationConnectionsSection, hasConfiguredIntegrationCredentials, isMaskedIntegrationCredential, scrubDisconnectedConnectionConfig, toSafeIntegrationConnectionDto };
|
|
1104
1162
|
//# sourceMappingURL=acorex-platform-module-integration-management-client.mjs.map
|