@acorex-platform/module-integration-management-client 0.0.30 → 0.0.33

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.
Files changed (40) hide show
  1. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entities-integration-application.mjs +153 -0
  2. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entities-integration-application.mjs.map +1 -0
  3. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entities-integration-connection.mjs +191 -0
  4. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entities-integration-connection.mjs.map +1 -0
  5. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entities-integration-oauth-state.mjs +127 -0
  6. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entities-integration-oauth-state.mjs.map +1 -0
  7. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entity-catalog-acorex-platform-module-integration-management-client-contracts-entity-catalog-BT3-xrGZ.mjs +69 -0
  8. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entity-catalog-acorex-platform-module-integration-management-client-contracts-entity-catalog-BT3-xrGZ.mjs.map +1 -0
  9. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-application.entity-BGZKCUt8.mjs +105 -0
  10. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-application.entity-BGZKCUt8.mjs.map +1 -0
  11. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-connection.entity-CYQq6jv2.mjs +143 -0
  12. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-connection.entity-CYQq6jv2.mjs.map +1 -0
  13. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-oauth-state.entity-BPvTE55S.mjs +79 -0
  14. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-oauth-state.entity-BPvTE55S.mjs.map +1 -0
  15. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entity-catalog.mjs +2 -0
  16. package/fesm2022/acorex-platform-module-integration-management-client-contracts-entity-catalog.mjs.map +1 -0
  17. package/fesm2022/{acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-XhloXUsZ.mjs → acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-CZu5mKUA.mjs} +4 -4
  18. package/fesm2022/{acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-XhloXUsZ.mjs.map → acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-CZu5mKUA.mjs.map} +1 -1
  19. package/fesm2022/acorex-platform-module-integration-management-client-integration-ref-display.service-CP818xou.mjs +126 -0
  20. package/fesm2022/acorex-platform-module-integration-management-client-integration-ref-display.service-CP818xou.mjs.map +1 -0
  21. package/fesm2022/acorex-platform-module-integration-management-client-integration-ref-filter-widget-edit.component-D9kaBnug.mjs +163 -0
  22. package/fesm2022/acorex-platform-module-integration-management-client-integration-ref-filter-widget-edit.component-D9kaBnug.mjs.map +1 -0
  23. package/fesm2022/acorex-platform-module-integration-management-client-integration-ref-page.component-D9hdpnQq.mjs +148 -0
  24. package/fesm2022/acorex-platform-module-integration-management-client-integration-ref-page.component-D9hdpnQq.mjs.map +1 -0
  25. package/fesm2022/acorex-platform-module-integration-management-client-integration-ref-widget-column.component-CPLhmHOe.mjs +137 -0
  26. package/fesm2022/acorex-platform-module-integration-management-client-integration-ref-widget-column.component-CPLhmHOe.mjs.map +1 -0
  27. package/fesm2022/acorex-platform-module-integration-management-client-integration-ref-widget-view.component-BRpGpWHZ.mjs +46 -0
  28. package/fesm2022/acorex-platform-module-integration-management-client-integration-ref-widget-view.component-BRpGpWHZ.mjs.map +1 -0
  29. package/fesm2022/{acorex-platform-module-integration-management-client-integrations-page.component-Q-SHidYA.mjs → acorex-platform-module-integration-management-client-integrations-page.component-iH0DqEak.mjs} +3 -3
  30. package/fesm2022/{acorex-platform-module-integration-management-client-integrations-page.component-Q-SHidYA.mjs.map → acorex-platform-module-integration-management-client-integrations-page.component-iH0DqEak.mjs.map} +1 -1
  31. package/fesm2022/acorex-platform-module-integration-management-client-local-entities.mjs +31 -0
  32. package/fesm2022/acorex-platform-module-integration-management-client-local-entities.mjs.map +1 -0
  33. package/fesm2022/acorex-platform-module-integration-management-client.mjs +235 -4
  34. package/fesm2022/acorex-platform-module-integration-management-client.mjs.map +1 -1
  35. package/package.json +21 -1
  36. package/types/acorex-platform-module-integration-management-client-contracts-entities-integration-application.d.ts +5 -0
  37. package/types/acorex-platform-module-integration-management-client-contracts-entities-integration-connection.d.ts +5 -0
  38. package/types/acorex-platform-module-integration-management-client-contracts-entities-integration-oauth-state.d.ts +5 -0
  39. package/types/acorex-platform-module-integration-management-client-contracts-entity-catalog.d.ts +10 -0
  40. package/types/acorex-platform-module-integration-management-client-local-entities.d.ts +12 -0
@@ -0,0 +1,105 @@
1
+ import { AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';
2
+ import { entityMasterRecordActions, createAllQueryView, entityMasterCrudActions } from '@acorex-platform/framework-shared/entity';
3
+ import { R as RootConfig } from './acorex-platform-module-integration-management-client-contracts-entity-catalog-acorex-platform-module-integration-management-client-contracts-entity-catalog-BT3-xrGZ.mjs';
4
+
5
+ //#region ---- Entity Factory ----
6
+ async function factoryIntegrationApplication() {
7
+ const i18n = `${RootConfig.config.i18n}:applications.entities.application`;
8
+ const entityDef = {
9
+ module: RootConfig.module.name,
10
+ name: RootConfig.entities.integrationApplication.name,
11
+ title: RootConfig.entities.integrationApplication.title,
12
+ icon: RootConfig.entities.integrationApplication.icon,
13
+ formats: {
14
+ individual: RootConfig.entities.integrationApplication.title,
15
+ plural: RootConfig.entities.integrationApplication.titlePlural,
16
+ searchResult: { title: '{{ providerId }}', description: '{{ clientId }}' },
17
+ },
18
+ plugins: [
19
+ {
20
+ name: 'unique-fields',
21
+ options: {
22
+ fields: ['scopeInfo.tenantId', 'scopeInfo.applicationId', 'providerId'],
23
+ scope: 'global',
24
+ },
25
+ },
26
+ { name: 'history' },
27
+ ],
28
+ groups: [
29
+ { id: 'basic-info', title: '@general:terms.interface.basic-info' },
30
+ { id: 'oauth', title: `@${i18n}.groups.oauth` },
31
+ ],
32
+ properties: [
33
+ {
34
+ name: 'id',
35
+ title: '@general:terms.common.id',
36
+ groupId: 'basic-info',
37
+ schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },
38
+ },
39
+ {
40
+ name: 'providerId',
41
+ title: `@${i18n}.fields.provider-id.title`,
42
+ groupId: 'basic-info',
43
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },
44
+ validations: [{ rule: 'required' }],
45
+ },
46
+ {
47
+ name: 'clientId',
48
+ title: `@${i18n}.fields.client-id.title`,
49
+ groupId: 'oauth',
50
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },
51
+ validations: [{ rule: 'required' }],
52
+ },
53
+ {
54
+ name: 'clientSecretRef',
55
+ title: `@${i18n}.fields.client-secret-ref.title`,
56
+ groupId: 'oauth',
57
+ schema: { dataType: 'string', visible: false, interface: { type: AXPWidgetsCatalog.text }, readonly: true },
58
+ },
59
+ {
60
+ name: 'authorizationEndpoint',
61
+ title: `@${i18n}.fields.authorization-endpoint.title`,
62
+ groupId: 'oauth',
63
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },
64
+ },
65
+ {
66
+ name: 'tokenEndpoint',
67
+ title: `@${i18n}.fields.token-endpoint.title`,
68
+ groupId: 'oauth',
69
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },
70
+ },
71
+ {
72
+ name: 'redirectUri',
73
+ title: `@${i18n}.fields.redirect-uri.title`,
74
+ groupId: 'oauth',
75
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },
76
+ },
77
+ {
78
+ name: 'isActive',
79
+ title: '@general:terms.common.active',
80
+ groupId: 'basic-info',
81
+ schema: { dataType: 'boolean', defaultValue: true, interface: { type: AXPWidgetsCatalog.toggle } },
82
+ },
83
+ ],
84
+ interfaces: {
85
+ master: {
86
+ list: {
87
+ actions: [...entityMasterCrudActions()],
88
+ views: [createAllQueryView({ sorts: [{ name: 'providerId', dir: 'asc' }] })],
89
+ },
90
+ create: { sections: [{ id: 'basic-info' }, { id: 'oauth' }] },
91
+ update: { sections: [{ id: 'basic-info' }, { id: 'oauth' }] },
92
+ single: {
93
+ title: '{{ providerId }}',
94
+ sections: [{ id: 'basic-info' }, { id: 'oauth' }],
95
+ actions: [...entityMasterRecordActions()],
96
+ },
97
+ },
98
+ },
99
+ };
100
+ return entityDef;
101
+ }
102
+ //#endregion
103
+
104
+ export { factoryIntegrationApplication };
105
+ //# sourceMappingURL=acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-application.entity-BGZKCUt8.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-application.entity-BGZKCUt8.mjs","sources":["../../../../libs/modules/integration-management/contracts/src/entities/integration-application/integration-application.entity.ts"],"sourcesContent":["import { AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';\nimport { AXPEntity, createAllQueryView, entityMasterCrudActions, entityMasterRecordActions } from '@acorex-platform/framework-shared/entity';\nimport { RootConfig } from '../../root-config';\n\n//#region ---- Entity Factory ----\n\nexport async function factoryIntegrationApplication(): Promise<AXPEntity | null> {\n const i18n = `${RootConfig.config.i18n}:applications.entities.application`;\n\n const entityDef: AXPEntity = {\n module: RootConfig.module.name,\n name: RootConfig.entities.integrationApplication.name,\n title: RootConfig.entities.integrationApplication.title,\n icon: RootConfig.entities.integrationApplication.icon,\n formats: {\n individual: RootConfig.entities.integrationApplication.title,\n plural: RootConfig.entities.integrationApplication.titlePlural,\n searchResult: { title: '{{ providerId }}', description: '{{ clientId }}' },\n },\n plugins: [\n {\n name: 'unique-fields',\n options: {\n fields: ['scopeInfo.tenantId', 'scopeInfo.applicationId', 'providerId'],\n scope: 'global',\n },\n },\n { name: 'history' },\n ],\n groups: [\n { id: 'basic-info', title: '@general:terms.interface.basic-info' },\n { id: 'oauth', title: `@${i18n}.groups.oauth` },\n ],\n properties: [\n {\n name: 'id',\n title: '@general:terms.common.id',\n groupId: 'basic-info',\n schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },\n },\n {\n name: 'providerId',\n title: `@${i18n}.fields.provider-id.title`,\n groupId: 'basic-info',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'clientId',\n title: `@${i18n}.fields.client-id.title`,\n groupId: 'oauth',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'clientSecretRef',\n title: `@${i18n}.fields.client-secret-ref.title`,\n groupId: 'oauth',\n schema: { dataType: 'string', visible: false, interface: { type: AXPWidgetsCatalog.text }, readonly: true },\n },\n {\n name: 'authorizationEndpoint',\n title: `@${i18n}.fields.authorization-endpoint.title`,\n groupId: 'oauth',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },\n },\n {\n name: 'tokenEndpoint',\n title: `@${i18n}.fields.token-endpoint.title`,\n groupId: 'oauth',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },\n },\n {\n name: 'redirectUri',\n title: `@${i18n}.fields.redirect-uri.title`,\n groupId: 'oauth',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },\n },\n {\n name: 'isActive',\n title: '@general:terms.common.active',\n groupId: 'basic-info',\n schema: { dataType: 'boolean', defaultValue: true, interface: { type: AXPWidgetsCatalog.toggle } },\n },\n ],\n interfaces: {\n master: {\n list: {\n actions: [...entityMasterCrudActions()],\n views: [createAllQueryView({ sorts: [{ name: 'providerId', dir: 'asc' }] })],\n },\n create: { sections: [{ id: 'basic-info' }, { id: 'oauth' }] },\n update: { sections: [{ id: 'basic-info' }, { id: 'oauth' }] },\n single: {\n title: '{{ providerId }}',\n sections: [{ id: 'basic-info' }, { id: 'oauth' }],\n actions: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,CAAC,GAAG,uBAAuB,EAAE,CAAC;oBACvC,KAAK,EAAE,CAAC,kBAAkB,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAE,CAAC,CAAC;AAC7E,iBAAA;AACD,gBAAA,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;AAC7D,gBAAA,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC,EAAE;AAC7D,gBAAA,MAAM,EAAE;AACN,oBAAA,KAAK,EAAE,kBAAkB;AACzB,oBAAA,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,EAAE,OAAO,EAAE,CAAC;AACjD,oBAAA,OAAO,EAAE,CAAC,GAAG,yBAAyB,EAAE,CAAC;AAC1C,iBAAA;AACF,aAAA;AACF,SAAA;KACF;AAED,IAAA,OAAO,SAAS;AAClB;AAEA;;;;"}
@@ -0,0 +1,143 @@
1
+ import { AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';
2
+ import { entityMasterRecordActions, createAllQueryView, entityMasterCrudActions } from '@acorex-platform/framework-shared/entity';
3
+ import { R as RootConfig } from './acorex-platform-module-integration-management-client-contracts-entity-catalog-acorex-platform-module-integration-management-client-contracts-entity-catalog-BT3-xrGZ.mjs';
4
+
5
+ //#region ---- Entity Factory ----
6
+ async function factoryIntegrationConnection() {
7
+ const i18n = `${RootConfig.config.i18n}:connections.entities.connection`;
8
+ const entityDef = {
9
+ module: RootConfig.module.name,
10
+ name: RootConfig.entities.integrationConnection.name,
11
+ title: RootConfig.entities.integrationConnection.title,
12
+ icon: RootConfig.entities.integrationConnection.icon,
13
+ formats: {
14
+ individual: RootConfig.entities.integrationConnection.title,
15
+ plural: RootConfig.entities.integrationConnection.titlePlural,
16
+ searchResult: { title: '{{ displayName }}', description: '{{ providerId }}' },
17
+ },
18
+ plugins: [
19
+ {
20
+ name: 'unique-fields',
21
+ options: {
22
+ fields: [
23
+ 'scopeInfo.tenantId',
24
+ 'scopeInfo.applicationId',
25
+ 'scopeInfo.userId',
26
+ 'connectionScope',
27
+ 'providerId',
28
+ 'connectionKey',
29
+ ],
30
+ scope: 'global',
31
+ },
32
+ },
33
+ { name: 'history' },
34
+ ],
35
+ groups: [
36
+ { id: 'basic-info', title: '@general:terms.interface.basic-info' },
37
+ { id: 'connection', title: `@${i18n}.groups.connection` },
38
+ { id: 'status', title: `@${i18n}.groups.status` },
39
+ ],
40
+ properties: [
41
+ {
42
+ name: 'id',
43
+ title: '@general:terms.common.id',
44
+ groupId: 'basic-info',
45
+ schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },
46
+ },
47
+ {
48
+ name: 'providerId',
49
+ title: `@${i18n}.fields.provider-id.title`,
50
+ groupId: 'basic-info',
51
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },
52
+ validations: [{ rule: 'required' }],
53
+ },
54
+ {
55
+ name: 'displayName',
56
+ title: '@general:terms.common.title',
57
+ groupId: 'basic-info',
58
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },
59
+ validations: [{ rule: 'required' }],
60
+ },
61
+ {
62
+ name: 'connectionScope',
63
+ title: `@${i18n}.fields.connection-scope.title`,
64
+ groupId: 'connection',
65
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },
66
+ },
67
+ {
68
+ name: 'connectionKey',
69
+ title: `@${i18n}.fields.connection-key.title`,
70
+ groupId: 'connection',
71
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },
72
+ },
73
+ {
74
+ name: 'authMethodType',
75
+ title: `@${i18n}.fields.auth-method-type.title`,
76
+ groupId: 'connection',
77
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },
78
+ },
79
+ {
80
+ name: 'status',
81
+ title: '@general:terms.common.status',
82
+ groupId: 'status',
83
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },
84
+ },
85
+ {
86
+ name: 'instanceUrl',
87
+ title: `@${i18n}.fields.instance-url.title`,
88
+ groupId: 'connection',
89
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },
90
+ },
91
+ {
92
+ name: 'externalAccountName',
93
+ title: `@${i18n}.fields.external-account-name.title`,
94
+ groupId: 'connection',
95
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },
96
+ },
97
+ {
98
+ name: 'secretRef',
99
+ title: `@${i18n}.fields.secret-ref.title`,
100
+ groupId: 'connection',
101
+ schema: { dataType: 'string', visible: false, interface: { type: AXPWidgetsCatalog.text }, readonly: true },
102
+ },
103
+ {
104
+ name: 'config',
105
+ title: `@${i18n}.fields.config.title`,
106
+ groupId: 'connection',
107
+ schema: { dataType: 'object', visible: false, interface: { type: 'json' } },
108
+ },
109
+ {
110
+ name: 'isRevoked',
111
+ title: `@${i18n}.fields.is-revoked.title`,
112
+ groupId: 'status',
113
+ schema: { dataType: 'boolean', defaultValue: false, interface: { type: AXPWidgetsCatalog.toggle }, readonly: true },
114
+ },
115
+ {
116
+ name: 'isDisabled',
117
+ title: `@${i18n}.fields.is-disabled.title`,
118
+ groupId: 'status',
119
+ schema: { dataType: 'boolean', defaultValue: false, interface: { type: AXPWidgetsCatalog.toggle } },
120
+ },
121
+ ],
122
+ interfaces: {
123
+ master: {
124
+ list: {
125
+ actions: [...entityMasterCrudActions()],
126
+ views: [createAllQueryView({ sorts: [{ name: 'displayName', dir: 'asc' }] })],
127
+ },
128
+ create: { sections: [{ id: 'basic-info' }, { id: 'connection' }] },
129
+ update: { sections: [{ id: 'basic-info' }, { id: 'connection' }, { id: 'status' }] },
130
+ single: {
131
+ title: '{{ displayName }}',
132
+ sections: [{ id: 'basic-info' }, { id: 'connection' }, { id: 'status' }],
133
+ actions: [...entityMasterRecordActions()],
134
+ },
135
+ },
136
+ },
137
+ };
138
+ return entityDef;
139
+ }
140
+ //#endregion
141
+
142
+ export { factoryIntegrationConnection };
143
+ //# sourceMappingURL=acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-connection.entity-CYQq6jv2.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-connection.entity-CYQq6jv2.mjs","sources":["../../../../libs/modules/integration-management/contracts/src/entities/integration-connection/integration-connection.entity.ts"],"sourcesContent":["import { AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';\nimport { AXPEntity, createAllQueryView, entityMasterCrudActions, entityMasterRecordActions } from '@acorex-platform/framework-shared/entity';\nimport { RootConfig } from '../../root-config';\n\n//#region ---- Entity Factory ----\n\nexport async function factoryIntegrationConnection(): Promise<AXPEntity | null> {\n const i18n = `${RootConfig.config.i18n}:connections.entities.connection`;\n\n const entityDef: AXPEntity = {\n module: RootConfig.module.name,\n name: RootConfig.entities.integrationConnection.name,\n title: RootConfig.entities.integrationConnection.title,\n icon: RootConfig.entities.integrationConnection.icon,\n formats: {\n individual: RootConfig.entities.integrationConnection.title,\n plural: RootConfig.entities.integrationConnection.titlePlural,\n searchResult: { title: '{{ displayName }}', description: '{{ providerId }}' },\n },\n plugins: [\n {\n name: 'unique-fields',\n options: {\n fields: [\n 'scopeInfo.tenantId',\n 'scopeInfo.applicationId',\n 'scopeInfo.userId',\n 'connectionScope',\n 'providerId',\n 'connectionKey',\n ],\n scope: 'global',\n },\n },\n { name: 'history' },\n ],\n groups: [\n { id: 'basic-info', title: '@general:terms.interface.basic-info' },\n { id: 'connection', title: `@${i18n}.groups.connection` },\n { id: 'status', title: `@${i18n}.groups.status` },\n ],\n properties: [\n {\n name: 'id',\n title: '@general:terms.common.id',\n groupId: 'basic-info',\n schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },\n },\n {\n name: 'providerId',\n title: `@${i18n}.fields.provider-id.title`,\n groupId: 'basic-info',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'displayName',\n title: '@general:terms.common.title',\n groupId: 'basic-info',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },\n validations: [{ rule: 'required' }],\n },\n {\n name: 'connectionScope',\n title: `@${i18n}.fields.connection-scope.title`,\n groupId: 'connection',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },\n },\n {\n name: 'connectionKey',\n title: `@${i18n}.fields.connection-key.title`,\n groupId: 'connection',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },\n },\n {\n name: 'authMethodType',\n title: `@${i18n}.fields.auth-method-type.title`,\n groupId: 'connection',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },\n },\n {\n name: 'status',\n title: '@general:terms.common.status',\n groupId: 'status',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },\n },\n {\n name: 'instanceUrl',\n title: `@${i18n}.fields.instance-url.title`,\n groupId: 'connection',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text } },\n },\n {\n name: 'externalAccountName',\n title: `@${i18n}.fields.external-account-name.title`,\n groupId: 'connection',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },\n },\n {\n name: 'secretRef',\n title: `@${i18n}.fields.secret-ref.title`,\n groupId: 'connection',\n schema: { dataType: 'string', visible: false, interface: { type: AXPWidgetsCatalog.text }, readonly: true },\n },\n {\n name: 'config',\n title: `@${i18n}.fields.config.title`,\n groupId: 'connection',\n schema: { dataType: 'object', visible: false, interface: { type: 'json' } },\n },\n {\n name: 'isRevoked',\n title: `@${i18n}.fields.is-revoked.title`,\n groupId: 'status',\n schema: { dataType: 'boolean', defaultValue: false, interface: { type: AXPWidgetsCatalog.toggle }, readonly: true },\n },\n {\n name: 'isDisabled',\n title: `@${i18n}.fields.is-disabled.title`,\n groupId: 'status',\n schema: { dataType: 'boolean', defaultValue: false, interface: { type: AXPWidgetsCatalog.toggle } },\n },\n ],\n interfaces: {\n master: {\n list: {\n actions: [...entityMasterCrudActions()],\n views: [createAllQueryView({ sorts: [{ name: 'displayName', dir: 'asc' }] })],\n },\n create: { sections: [{ id: 'basic-info' }, { id: 'connection' }] },\n update: { sections: [{ id: 'basic-info' }, { id: 'connection' }, { id: 'status' }] },\n single: {\n title: '{{ displayName }}',\n sections: [{ id: 'basic-info' }, { id: 'connection' }, { id: 'status' }],\n actions: [...entityMasterRecordActions()],\n },\n },\n },\n };\n\n return entityDef;\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AAIA;AAEO,eAAe,4BAA4B,GAAA;IAChD,MAAM,IAAI,GAAG,CAAA,EAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,gCAAA,CAAkC;AAExE,IAAA,MAAM,SAAS,GAAc;AAC3B,QAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC9B,QAAA,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI;AACpD,QAAA,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK;AACtD,QAAA,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI;AACpD,QAAA,OAAO,EAAE;AACP,YAAA,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK;AAC3D,YAAA,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,WAAW;YAC7D,YAAY,EAAE,EAAE,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,kBAAkB,EAAE;AAC9E,SAAA;AACD,QAAA,OAAO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E;gBAClE,MAAM,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC,EAAE;AACpF,gBAAA,MAAM,EAAE;AACN,oBAAA,KAAK,EAAE,mBAAmB;AAC1B,oBAAA,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,EAAE,YAAY,EAAE,EAAE,EAAE,EAAE,EAAE,QAAQ,EAAE,CAAC;AACxE,oBAAA,OAAO,EAAE,CAAC,GAAG,yBAAyB,EAAE,CAAC;AAC1C,iBAAA;AACF,aAAA;AACF,SAAA;KACF;AAED,IAAA,OAAO,SAAS;AAClB;AAEA;;;;"}
@@ -0,0 +1,79 @@
1
+ import { AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';
2
+ import { createAllQueryView } from '@acorex-platform/framework-shared/entity';
3
+ import { R as RootConfig } from './acorex-platform-module-integration-management-client-contracts-entity-catalog-acorex-platform-module-integration-management-client-contracts-entity-catalog-BT3-xrGZ.mjs';
4
+
5
+ //#region ---- Entity Factory ----
6
+ async function factoryIntegrationOAuthState() {
7
+ const i18n = `${RootConfig.config.i18n}:oauth-states.entities.oauth-state`;
8
+ const entityDef = {
9
+ module: RootConfig.module.name,
10
+ name: RootConfig.entities.integrationOAuthState.name,
11
+ title: RootConfig.entities.integrationOAuthState.title,
12
+ icon: RootConfig.entities.integrationOAuthState.icon,
13
+ formats: {
14
+ individual: RootConfig.entities.integrationOAuthState.title,
15
+ plural: RootConfig.entities.integrationOAuthState.titlePlural,
16
+ },
17
+ plugins: [
18
+ {
19
+ name: 'unique-fields',
20
+ options: { fields: 'state', scope: 'global' },
21
+ },
22
+ ],
23
+ groups: [{ id: 'basic-info', title: '@general:terms.interface.basic-info' }],
24
+ properties: [
25
+ {
26
+ name: 'id',
27
+ title: '@general:terms.common.id',
28
+ groupId: 'basic-info',
29
+ schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },
30
+ },
31
+ {
32
+ name: 'state',
33
+ title: `@${i18n}.fields.state.title`,
34
+ groupId: 'basic-info',
35
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },
36
+ },
37
+ {
38
+ name: 'providerId',
39
+ title: `@${i18n}.fields.provider-id.title`,
40
+ groupId: 'basic-info',
41
+ schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },
42
+ },
43
+ {
44
+ name: 'expiresAt',
45
+ title: `@${i18n}.fields.expires-at.title`,
46
+ groupId: 'basic-info',
47
+ schema: { dataType: 'datetime', interface: { type: AXPWidgetsCatalog.dateTime }, readonly: true },
48
+ },
49
+ {
50
+ name: 'codeVerifier',
51
+ title: `@${i18n}.fields.code-verifier.title`,
52
+ groupId: 'basic-info',
53
+ schema: { dataType: 'string', visible: false, interface: { type: AXPWidgetsCatalog.text }, readonly: true },
54
+ },
55
+ {
56
+ name: 'redirectUri',
57
+ title: `@${i18n}.fields.redirect-uri.title`,
58
+ groupId: 'basic-info',
59
+ schema: { dataType: 'string', visible: false, interface: { type: AXPWidgetsCatalog.text }, readonly: true },
60
+ },
61
+ {
62
+ name: 'consumedAt',
63
+ title: `@${i18n}.fields.consumed-at.title`,
64
+ groupId: 'basic-info',
65
+ schema: { dataType: 'datetime', visible: false, interface: { type: AXPWidgetsCatalog.dateTime }, readonly: true },
66
+ },
67
+ ],
68
+ interfaces: {
69
+ master: {
70
+ list: { views: [createAllQueryView({ sorts: [{ name: 'expiresAt', dir: 'desc' }] })] },
71
+ },
72
+ },
73
+ };
74
+ return entityDef;
75
+ }
76
+ //#endregion
77
+
78
+ export { factoryIntegrationOAuthState };
79
+ //# sourceMappingURL=acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-oauth-state.entity-BPvTE55S.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-integration-management-client-contracts-entity-catalog-integration-oauth-state.entity-BPvTE55S.mjs","sources":["../../../../libs/modules/integration-management/contracts/src/entities/integration-oauth-state/integration-oauth-state.entity.ts"],"sourcesContent":["import { AXPWidgetsCatalog } from '@acorex-platform/framework-shared/core';\nimport { AXPEntity, createAllQueryView } from '@acorex-platform/framework-shared/entity';\nimport { RootConfig } from '../../root-config';\n\n//#region ---- Entity Factory ----\n\nexport async function factoryIntegrationOAuthState(): Promise<AXPEntity | null> {\n const i18n = `${RootConfig.config.i18n}:oauth-states.entities.oauth-state`;\n\n const entityDef: AXPEntity = {\n module: RootConfig.module.name,\n name: RootConfig.entities.integrationOAuthState.name,\n title: RootConfig.entities.integrationOAuthState.title,\n icon: RootConfig.entities.integrationOAuthState.icon,\n formats: {\n individual: RootConfig.entities.integrationOAuthState.title,\n plural: RootConfig.entities.integrationOAuthState.titlePlural,\n },\n plugins: [\n {\n name: 'unique-fields',\n options: { fields: 'state', scope: 'global' },\n },\n ],\n groups: [{ id: 'basic-info', title: '@general:terms.interface.basic-info' }],\n properties: [\n {\n name: 'id',\n title: '@general:terms.common.id',\n groupId: 'basic-info',\n schema: { dataType: 'uuid', visible: false, nullable: false, readonly: true, unique: { enabled: true } },\n },\n {\n name: 'state',\n title: `@${i18n}.fields.state.title`,\n groupId: 'basic-info',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },\n },\n {\n name: 'providerId',\n title: `@${i18n}.fields.provider-id.title`,\n groupId: 'basic-info',\n schema: { dataType: 'string', interface: { type: AXPWidgetsCatalog.text }, readonly: true },\n },\n {\n name: 'expiresAt',\n title: `@${i18n}.fields.expires-at.title`,\n groupId: 'basic-info',\n schema: { dataType: 'datetime', interface: { type: AXPWidgetsCatalog.dateTime }, readonly: true },\n },\n {\n name: 'codeVerifier',\n title: `@${i18n}.fields.code-verifier.title`,\n groupId: 'basic-info',\n schema: { dataType: 'string', visible: false, interface: { type: AXPWidgetsCatalog.text }, readonly: true },\n },\n {\n name: 'redirectUri',\n title: `@${i18n}.fields.redirect-uri.title`,\n groupId: 'basic-info',\n schema: { dataType: 'string', visible: false, interface: { type: AXPWidgetsCatalog.text }, readonly: true },\n },\n {\n name: 'consumedAt',\n title: `@${i18n}.fields.consumed-at.title`,\n groupId: 'basic-info',\n schema: { dataType: 'datetime', visible: false, interface: { type: AXPWidgetsCatalog.dateTime }, readonly: true },\n },\n ],\n interfaces: {\n master: {\n list: { views: [createAllQueryView({ sorts: [{ name: 'expiresAt', dir: 'desc' }] })] },\n },\n },\n };\n\n return entityDef;\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;AAIA;AAEO,eAAe,4BAA4B,GAAA;IAChD,MAAM,IAAI,GAAG,CAAA,EAAG,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,kCAAA,CAAoC;AAE1E,IAAA,MAAM,SAAS,GAAc;AAC3B,QAAA,MAAM,EAAE,UAAU,CAAC,MAAM,CAAC,IAAI;AAC9B,QAAA,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI;AACpD,QAAA,KAAK,EAAE,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK;AACtD,QAAA,IAAI,EAAE,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,IAAI;AACpD,QAAA,OAAO,EAAE;AACP,YAAA,UAAU,EAAE,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,KAAK;AAC3D,YAAA,MAAM,EAAE,UAAU,CAAC,QAAQ,CAAC,qBAAqB,CAAC,WAAW;AAC9D,SAAA;AACD,QAAA,OAAO,EAAE;AACP,YAAA;AACE,gBAAA,IAAI,EAAE,eAAe;gBACrB,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE;AAC9C,aAAA;AACF,SAAA;QACD,MAAM,EAAE,CAAC,EAAE,EAAE,EAAE,YAAY,EAAE,KAAK,EAAE,qCAAqC,EAAE,CAAC;AAC5E,QAAA,UA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from './acorex-platform-module-integration-management-client-contracts-entity-catalog-acorex-platform-module-integration-management-client-contracts-entity-catalog-BT3-xrGZ.mjs';
2
+ //# sourceMappingURL=acorex-platform-module-integration-management-client-contracts-entity-catalog.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acorex-platform-module-integration-management-client-contracts-entity-catalog.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
@@ -1,6 +1,6 @@
1
1
  import * as i3 from '@acorex/components/button';
2
2
  import { AXButtonModule } from '@acorex/components/button';
3
- import * as i11 from '@acorex/core/translation';
3
+ import * as i3$1 from '@acorex/core/translation';
4
4
  import { AXTranslationModule } from '@acorex/core/translation';
5
5
  import { AXPSessionService } from '@acorex-platform/framework-client/auth';
6
6
  import { AXPIntegrationProviderRegistryService } from '@acorex-platform/framework-client/common';
@@ -8,7 +8,7 @@ import { AXPStateMessageComponent } from '@acorex-platform/framework-client/layo
8
8
  import { commandMessageTextForError } from '@acorex-platform/framework-client/layout/entity';
9
9
  import { AXPCommandService } from '@acorex-platform/framework-client/runtime';
10
10
  import { resolveAppRouteName, buildTenantIntegrationsPagePath } from '@acorex-platform/module-integration-management-client/contracts';
11
- import * as i3$1 from '@angular/common';
11
+ import * as i3$2 from '@angular/common';
12
12
  import { CommonModule } from '@angular/common';
13
13
  import * as i0 from '@angular/core';
14
14
  import { inject, ChangeDetectionStrategy, Component } from '@angular/core';
@@ -125,7 +125,7 @@ class AXMIntegrationOAuthCallbackPageComponent {
125
125
  </div>
126
126
  </div>
127
127
  </ng-container>
128
- `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i11.AXTranslatorDirective, selector: "[translate]" }, { kind: "component", type: AXPStateMessageComponent, selector: "axp-state-message", inputs: ["mode", "icon", "title", "description", "titleParams", "descriptionParams", "look"] }, { kind: "pipe", type: i3$1.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
128
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i3.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "directive", type: i3$1.AXTranslatorDirective, selector: "[translate]" }, { kind: "component", type: AXPStateMessageComponent, selector: "axp-state-message", inputs: ["mode", "icon", "title", "description", "titleParams", "descriptionParams", "look"] }, { kind: "pipe", type: i3$2.AsyncPipe, name: "async" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
129
129
  }
130
130
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMIntegrationOAuthCallbackPageComponent, decorators: [{
131
131
  type: Component,
@@ -173,4 +173,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
173
173
  }] });
174
174
 
175
175
  export { AXMIntegrationOAuthCallbackPageComponent };
176
- //# sourceMappingURL=acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-XhloXUsZ.mjs.map
176
+ //# sourceMappingURL=acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-CZu5mKUA.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-XhloXUsZ.mjs","sources":["../../../../libs/modules/integration-management/client/src/lib/features/oauth-callback/integration-oauth-callback-page.component.ts"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPIntegrationProviderRegistryService } from '@acorex-platform/framework-client/common';\nimport { AXPStateMessageComponent } from '@acorex-platform/framework-client/layout/components';\nimport { commandMessageTextForError } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport {\n buildTenantIntegrationsPagePath,\n resolveAppRouteName,\n} from '@acorex-platform/module-integration-management-client/contracts';\nimport { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n OnInit,\n} from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { BehaviorSubject, firstValueFrom } from 'rxjs';\n\n@Component({\n standalone: true,\n imports: [\n CommonModule,\n AXButtonModule,\n AXTranslationModule,\n AXPStateMessageComponent,\n ],\n template: `\n <ng-container *translate=\"let t\">\n <div class=\"h-full flex flex-col items-center justify-center p-8\">\n <div class=\"w-96 text-center\">\n @if (isLoading$ | async) {\n <axp-state-message\n mode=\"loading\"\n icon=\"fa-solid fa-spinner fa-spin\"\n title=\"Completing authorization...\"\n description=\"Please wait while we finish connecting your integration.\"\n ></axp-state-message>\n } @else if (error$ | async; as error) {\n <axp-state-message\n mode=\"error\"\n icon=\"fa-solid fa-exclamation-triangle\"\n title=\"Authorization failed\"\n [description]=\"error\"\n >\n <div slot=\"actions\" class=\"flex justify-center\">\n <ax-button\n color=\"primary\"\n text=\"Back to integrations\"\n (onClick)=\"goToIntegrations()\"\n ></ax-button>\n </div>\n </axp-state-message>\n }\n </div>\n </div>\n </ng-container>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AXMIntegrationOAuthCallbackPageComponent implements OnInit {\n private readonly route = inject(ActivatedRoute);\n private readonly router = inject(Router);\n private readonly commandService = inject(AXPCommandService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly providerRegistry = inject(AXPIntegrationProviderRegistryService);\n\n protected readonly isLoading$ = new BehaviorSubject<boolean>(true);\n protected readonly error$ = new BehaviorSubject<string | null>(null);\n\n async ngOnInit(): Promise<void> {\n const sessionReady = await this.ensureSessionReady();\n if (!sessionReady) {\n return;\n }\n\n await this.completeCallback();\n }\n\n /** Wait for app init + persisted session (user, tenant, app, permissions) before OAuth completion. */\n private async ensureSessionReady(): Promise<boolean> {\n let authorized = await firstValueFrom(\n this.sessionService.isAuthorizedWithLoading$,\n );\n if (!authorized) {\n await this.sessionService.restoreSession();\n authorized = await firstValueFrom(\n this.sessionService.isAuthorizedWithLoading$,\n );\n }\n\n if (!authorized) {\n this.isLoading$.next(false);\n this.error$.next(\n 'Session is not ready. Please sign in again and retry the connection.',\n );\n return false;\n }\n\n return true;\n }\n\n private async completeCallback(): Promise<void> {\n const providerId = this.route.snapshot.paramMap.get('providerId') ?? '';\n const state = this.route.snapshot.queryParamMap.get('state') ?? '';\n const code = this.route.snapshot.queryParamMap.get('code') ?? '';\n const oauthError = this.route.snapshot.queryParamMap.get('error') ?? '';\n\n if (oauthError) {\n this.isLoading$.next(false);\n this.error$.next(oauthError);\n return;\n }\n\n if (!providerId || !state || !code) {\n this.isLoading$.next(false);\n this.error$.next('Missing OAuth callback parameters.');\n return;\n }\n\n const provider = await this.providerRegistry.get(providerId);\n const commandKey = provider?.completeOAuthCommandKey;\n if (!commandKey) {\n this.isLoading$.next(false);\n this.error$.next(`OAuth callback is not configured for provider '${providerId}'.`);\n return;\n }\n\n try {\n const result = await this.commandService.execute(commandKey, { state, code });\n\n if (!result?.success) {\n this.error$.next(\n commandMessageTextForError(result?.message?.text) ||\n 'OAuth callback failed.',\n );\n return;\n }\n\n await this.goToIntegrations();\n } catch (error: unknown) {\n const message =\n error instanceof Error ? error.message : 'OAuth callback failed.';\n this.error$.next(message);\n } finally {\n this.isLoading$.next(false);\n }\n }\n\n protected async goToIntegrations(): Promise<void> {\n // Prefer session app slug — callback URLs are often app-agnostic or legacy `/demo/...`.\n const appName = resolveAppRouteName(\n this.sessionService.application?.name,\n this.route.snapshot.paramMap.get('appName'),\n );\n if (!appName) {\n this.error$.next('Unable to determine the current application after authorization.');\n return;\n }\n await this.router.navigateByUrl(buildTenantIntegrationsPagePath(appName));\n }\n}\n\n"],"names":["i1","i3"],"mappings":";;;;;;;;;;;;;;;;;MA8Da,wCAAwC,CAAA;AAzCrD,IAAA,WAAA,GAAA;AA0CmB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,qCAAqC,CAAC;AAE9D,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,eAAe,CAAU,IAAI,CAAC;AAC/C,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,eAAe,CAAgB,IAAI,CAAC;AA6FrE,IAAA;AA3FC,IAAA,MAAM,QAAQ,GAAA;AACZ,QAAA,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,kBAAkB,EAAE;QACpD,IAAI,CAAC,YAAY,EAAE;YACjB;QACF;AAEA,QAAA,MAAM,IAAI,CAAC,gBAAgB,EAAE;IAC/B;;AAGQ,IAAA,MAAM,kBAAkB,GAAA;QAC9B,IAAI,UAAU,GAAG,MAAM,cAAc,CACnC,IAAI,CAAC,cAAc,CAAC,wBAAwB,CAC7C;QACD,IAAI,CAAC,UAAU,EAAE;AACf,YAAA,MAAM,IAAI,CAAC,cAAc,CAAC,cAAc,EAAE;YAC1C,UAAU,GAAG,MAAM,cAAc,CAC/B,IAAI,CAAC,cAAc,CAAC,wBAAwB,CAC7C;QACH;QAEA,IAAI,C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CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAmCf,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBAzCpD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,mBAAmB;wBACnB,wBAAwB;AACzB,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAChD,iBAAA;;;;;"}
1
+ {"version":3,"file":"acorex-platform-module-integration-management-client-integration-oauth-callback-page.component-CZu5mKUA.mjs","sources":["../../../../libs/modules/integration-management/client/src/lib/features/oauth-callback/integration-oauth-callback-page.component.ts"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\nimport { AXTranslationModule } from '@acorex/core/translation';\nimport { AXPSessionService } from '@acorex-platform/framework-client/auth';\nimport { AXPIntegrationProviderRegistryService } from '@acorex-platform/framework-client/common';\nimport { AXPStateMessageComponent } from '@acorex-platform/framework-client/layout/components';\nimport { commandMessageTextForError } from '@acorex-platform/framework-client/layout/entity';\nimport { AXPCommandService } from '@acorex-platform/framework-client/runtime';\nimport {\n buildTenantIntegrationsPagePath,\n resolveAppRouteName,\n} from '@acorex-platform/module-integration-management-client/contracts';\nimport { CommonModule } from '@angular/common';\nimport {\n ChangeDetectionStrategy,\n Component,\n inject,\n OnInit,\n} from '@angular/core';\nimport { ActivatedRoute, Router } from '@angular/router';\nimport { BehaviorSubject, firstValueFrom } from 'rxjs';\n\n@Component({\n standalone: true,\n imports: [\n CommonModule,\n AXButtonModule,\n AXTranslationModule,\n AXPStateMessageComponent,\n ],\n template: `\n <ng-container *translate=\"let t\">\n <div class=\"h-full flex flex-col items-center justify-center p-8\">\n <div class=\"w-96 text-center\">\n @if (isLoading$ | async) {\n <axp-state-message\n mode=\"loading\"\n icon=\"fa-solid fa-spinner fa-spin\"\n title=\"Completing authorization...\"\n description=\"Please wait while we finish connecting your integration.\"\n ></axp-state-message>\n } @else if (error$ | async; as error) {\n <axp-state-message\n mode=\"error\"\n icon=\"fa-solid fa-exclamation-triangle\"\n title=\"Authorization failed\"\n [description]=\"error\"\n >\n <div slot=\"actions\" class=\"flex justify-center\">\n <ax-button\n color=\"primary\"\n text=\"Back to integrations\"\n (onClick)=\"goToIntegrations()\"\n ></ax-button>\n </div>\n </axp-state-message>\n }\n </div>\n </div>\n </ng-container>\n `,\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class AXMIntegrationOAuthCallbackPageComponent implements OnInit {\n private readonly route = inject(ActivatedRoute);\n private readonly router = inject(Router);\n private readonly commandService = inject(AXPCommandService);\n private readonly sessionService = inject(AXPSessionService);\n private readonly providerRegistry = inject(AXPIntegrationProviderRegistryService);\n\n protected readonly isLoading$ = new BehaviorSubject<boolean>(true);\n protected readonly error$ = new BehaviorSubject<string | null>(null);\n\n async ngOnInit(): Promise<void> {\n const sessionReady = await this.ensureSessionReady();\n if (!sessionReady) {\n return;\n }\n\n await this.completeCallback();\n }\n\n /** Wait for app init + persisted session (user, tenant, app, permissions) before OAuth completion. */\n private async ensureSessionReady(): Promise<boolean> {\n let authorized = await firstValueFrom(\n this.sessionService.isAuthorizedWithLoading$,\n );\n if (!authorized) {\n await this.sessionService.restoreSession();\n authorized = await firstValueFrom(\n this.sessionService.isAuthorizedWithLoading$,\n );\n }\n\n if (!authorized) {\n this.isLoading$.next(false);\n this.error$.next(\n 'Session is not ready. Please sign in again and retry the connection.',\n );\n return false;\n }\n\n return true;\n }\n\n private async completeCallback(): Promise<void> {\n const providerId = this.route.snapshot.paramMap.get('providerId') ?? '';\n const state = this.route.snapshot.queryParamMap.get('state') ?? '';\n const code = this.route.snapshot.queryParamMap.get('code') ?? '';\n const oauthError = this.route.snapshot.queryParamMap.get('error') ?? '';\n\n if (oauthError) {\n this.isLoading$.next(false);\n this.error$.next(oauthError);\n return;\n }\n\n if (!providerId || !state || !code) {\n this.isLoading$.next(false);\n this.error$.next('Missing OAuth callback parameters.');\n return;\n }\n\n const provider = await this.providerRegistry.get(providerId);\n const commandKey = provider?.completeOAuthCommandKey;\n if (!commandKey) {\n this.isLoading$.next(false);\n this.error$.next(`OAuth callback is not configured for provider '${providerId}'.`);\n return;\n }\n\n try {\n const result = await this.commandService.execute(commandKey, { state, code });\n\n if (!result?.success) {\n this.error$.next(\n commandMessageTextForError(result?.message?.text) ||\n 'OAuth callback failed.',\n );\n return;\n }\n\n await this.goToIntegrations();\n } catch (error: unknown) {\n const message =\n error instanceof Error ? error.message : 'OAuth callback failed.';\n this.error$.next(message);\n } finally {\n this.isLoading$.next(false);\n }\n }\n\n protected async goToIntegrations(): Promise<void> {\n // Prefer session app slug — callback URLs are often app-agnostic or legacy `/demo/...`.\n const appName = resolveAppRouteName(\n this.sessionService.application?.name,\n this.route.snapshot.paramMap.get('appName'),\n );\n if (!appName) {\n this.error$.next('Unable to determine the current application after authorization.');\n return;\n }\n await this.router.navigateByUrl(buildTenantIntegrationsPagePath(appName));\n }\n}\n\n"],"names":["i1","i3"],"mappings":";;;;;;;;;;;;;;;;;MA8Da,wCAAwC,CAAA;AAzCrD,IAAA,WAAA,GAAA;AA0CmB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,cAAc,GAAG,MAAM,CAAC,iBAAiB,CAAC;AAC1C,QAAA,IAAA,CAAA,gBAAgB,GAAG,MAAM,CAAC,qCAAqC,CAAC;AAE9D,QAAA,IAAA,CAAA,UAAU,GAAG,IAAI,eAAe,CAAU,IAAI,CAAC;AAC/C,QAAA,IAAA,CAAA,MAAM,GAAG,IAAI,eAAe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UAAA,EAAA,MAAA,EAAA,aAAA,CAAA,EAAA,OAAA,EAAA,CAAA,QAAA,EAAA,SAAA,EAAA,SAAA,EAAA,gBAAA,EAAA,kBAAA,EAAA,YAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,mBAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,UAAA,EAAA,IAAA,EACd,mBAAmB,iHACnB,wBAAwB,EAAA,QAAA,EAAA,mBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,MAAA,EAAA,OAAA,EAAA,aAAA,EAAA,aAAA,EAAA,mBAAA,EAAA,MAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAAC,IAAA,CAAA,SAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA,CAAA;;2FAmCf,wCAAwC,EAAA,UAAA,EAAA,CAAA;kBAzCpD,SAAS;AAAC,YAAA,IAAA,EAAA,CAAA;AACT,oBAAA,UAAU,EAAE,IAAI;AAChB,oBAAA,OAAO,EAAE;wBACP,YAAY;wBACZ,cAAc;wBACd,mBAAmB;wBACnB,wBAAwB;AACzB,qBAAA;AACD,oBAAA,QAAQ,EAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BT,EAAA,CAAA;oBACD,eAAe,EAAE,uBAAuB,CAAC,MAAM;AAChD,iBAAA;;;;;"}
@@ -0,0 +1,126 @@
1
+ import { AXPIntegrationDomainRegistryService } from '@acorex-platform/framework-client/common';
2
+ import { AXPEntityService } from '@acorex-platform/framework-client/layout/entity';
3
+ import { RootConfig } from '@acorex-platform/module-integration-management-client/contracts';
4
+ import * as i0 from '@angular/core';
5
+ import { inject, Injectable } from '@angular/core';
6
+ import { trim, isPlainObject, isString } from 'lodash';
7
+
8
+ //#region ----- Imports -----
9
+ //#endregion
10
+ //#region ----- Service -----
11
+ /**
12
+ * Resolves provider logo/icon for an entity `integrationRef`
13
+ * via `source` (provider id) or `connectionId` → IntegrationConnection.providerId.
14
+ */
15
+ class AXMIntegrationRefDisplayService {
16
+ constructor() {
17
+ //#region ----- Services & Dependencies -----
18
+ this.domainRegistry = inject(AXPIntegrationDomainRegistryService);
19
+ this.entityService = inject(AXPEntityService);
20
+ //#endregion
21
+ //#region ----- State -----
22
+ this.connectionProviderCache = new Map();
23
+ this.connectionCache = new Map();
24
+ this.displayCache = new Map();
25
+ }
26
+ //#endregion
27
+ //#region ----- Public API -----
28
+ parseIntegrationRef(value) {
29
+ return this.asIntegrationRef(value);
30
+ }
31
+ async resolve(value) {
32
+ const ref = this.asIntegrationRef(value);
33
+ if (!ref) {
34
+ return null;
35
+ }
36
+ const providerId = await this.resolveProviderId(ref);
37
+ if (!providerId) {
38
+ return null;
39
+ }
40
+ const cached = this.displayCache.get(providerId);
41
+ if (cached !== undefined) {
42
+ return cached;
43
+ }
44
+ const provider = await this.domainRegistry.getProvider(providerId);
45
+ if (!provider) {
46
+ this.displayCache.set(providerId, null);
47
+ return null;
48
+ }
49
+ const display = {
50
+ providerId: provider.id,
51
+ displayName: provider.displayName,
52
+ logoKey: provider.logoKey,
53
+ icon: provider.icon,
54
+ };
55
+ this.displayCache.set(providerId, display);
56
+ return display;
57
+ }
58
+ async getConnectionById(connectionId) {
59
+ const id = trim(connectionId);
60
+ if (!id) {
61
+ return null;
62
+ }
63
+ const cached = this.connectionCache.get(id);
64
+ if (cached !== undefined) {
65
+ return cached;
66
+ }
67
+ try {
68
+ const connection = await this.entityService
69
+ .withEntity(RootConfig.module.name, RootConfig.entities.integrationConnection.name)
70
+ .data()
71
+ .byKey(id);
72
+ const resolved = connection ?? null;
73
+ this.connectionCache.set(id, resolved);
74
+ if (resolved?.providerId) {
75
+ this.connectionProviderCache.set(id, trim(resolved.providerId) || null);
76
+ }
77
+ return resolved;
78
+ }
79
+ catch {
80
+ this.connectionCache.set(id, null);
81
+ return null;
82
+ }
83
+ }
84
+ //#endregion
85
+ //#region ----- Helpers -----
86
+ asIntegrationRef(value) {
87
+ if (!isPlainObject(value)) {
88
+ return null;
89
+ }
90
+ const record = value;
91
+ const source = isString(record['source']) ? trim(record['source']) : '';
92
+ const connectionId = isString(record['connectionId']) ? trim(record['connectionId']) : '';
93
+ if (!source && !connectionId) {
94
+ return null;
95
+ }
96
+ return record;
97
+ }
98
+ async resolveProviderId(ref) {
99
+ const source = trim(ref.source ?? '');
100
+ if (source) {
101
+ return source;
102
+ }
103
+ const connectionId = trim(ref.connectionId ?? '');
104
+ if (!connectionId) {
105
+ return null;
106
+ }
107
+ const cached = this.connectionProviderCache.get(connectionId);
108
+ if (cached !== undefined) {
109
+ return cached;
110
+ }
111
+ const connection = await this.getConnectionById(connectionId);
112
+ const providerId = connection?.providerId ? trim(connection.providerId) : '';
113
+ const resolved = providerId || null;
114
+ this.connectionProviderCache.set(connectionId, resolved);
115
+ return resolved;
116
+ }
117
+ static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMIntegrationRefDisplayService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
118
+ static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMIntegrationRefDisplayService, providedIn: 'root' }); }
119
+ }
120
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImport: i0, type: AXMIntegrationRefDisplayService, decorators: [{
121
+ type: Injectable,
122
+ args: [{ providedIn: 'root' }]
123
+ }] });
124
+
125
+ export { AXMIntegrationRefDisplayService as A };
126
+ //# sourceMappingURL=acorex-platform-module-integration-management-client-integration-ref-display.service-CP818xou.mjs.map