@acorex-platform/extension-acorex-captcha-client 2.0.0-next.50 → 2.0.0-next.54
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-extension-acorex-captcha-client-connect-acorex-captcha.command-LYVHf1Ji.mjs → acorex-platform-extension-acorex-captcha-client-connect-acorex-captcha.command-BCsKPmTs.mjs} +1 -1
- package/fesm2022/{acorex-platform-extension-acorex-captcha-client-connect-acorex-captcha.command-LYVHf1Ji.mjs.map → acorex-platform-extension-acorex-captcha-client-connect-acorex-captcha.command-BCsKPmTs.mjs.map} +1 -1
- package/fesm2022/acorex-platform-extension-acorex-captcha-client.mjs +2 -2
- package/package.json +1 -1
|
@@ -99,4 +99,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
99
99
|
}] });
|
|
100
100
|
|
|
101
101
|
export { ConnectAcorexCaptchaCommand };
|
|
102
|
-
//# sourceMappingURL=acorex-platform-extension-acorex-captcha-client-connect-acorex-captcha.command-
|
|
102
|
+
//# sourceMappingURL=acorex-platform-extension-acorex-captcha-client-connect-acorex-captcha.command-BCsKPmTs.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-extension-acorex-captcha-client-connect-acorex-captcha.command-
|
|
1
|
+
{"version":3,"file":"acorex-platform-extension-acorex-captcha-client-connect-acorex-captcha.command-BCsKPmTs.mjs","sources":["../../../../libs/extensions/acorex-captcha/client/src/lib/features/connect/connect-acorex-captcha.command.ts"],"sourcesContent":["//#region ----- Imports -----\n\nimport { AXPCommand, type AXPCommandExecuteResultPromise } from '@acorex-platform/framework-shared/runtime';\nimport {\n AXP_INTEGRATION_AUTH_METHOD_TYPE,\n AXP_INTEGRATION_CONNECTION_STATUS,\n createRandomUuid,\n type AXPIntegrationConnectionScope,\n} from '@acorex-platform/framework-shared/core';\nimport {\n AXMIntegrationConnectionManager,\n toSafeIntegrationConnectionDto,\n type ConnectCommandResult,\n} from '@acorex-platform/module-integration-management-client';\nimport { AXPSettingDefinitionProviderService } from '@acorex-platform/framework-client/common';\nimport {\n AXPLayoutBuilderService,\n resolveLayoutBuilderDialogResult,\n type AXPDialogRef,\n type IActionBuilder,\n type IDialogBuilder,\n type IFlexContainerBuilder,\n} from '@acorex-platform/framework-client/layout/builder';\nimport { Injectable, inject } from '@angular/core';\nimport { RootConfig } from '@acorex-platform/extension-acorex-captcha-client/contracts';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport interface ConnectAcorexCaptchaCommandInput {\n providerId?: string;\n connectionScope?: AXPIntegrationConnectionScope;\n}\n\n//#endregion\n\n//#region ----- Connect ACoreX Captcha -----\n\n/**\n * Enables built-in ACoreX Captcha on IntegrationConnection (no external keys).\n */\n@Injectable({ providedIn: 'root' })\nexport class ConnectAcorexCaptchaCommand\n implements AXPCommand<ConnectAcorexCaptchaCommandInput, ConnectCommandResult>\n{\n private readonly layoutBuilder = inject(AXPLayoutBuilderService);\n private readonly connectionManager = inject(AXMIntegrationConnectionManager);\n private readonly settingDefinitions = inject(AXPSettingDefinitionProviderService);\n\n async execute(\n input: ConnectAcorexCaptchaCommandInput = {},\n ): AXPCommandExecuteResultPromise<ConnectCommandResult> {\n try {\n const providerId = input.providerId ?? RootConfig.integration.providerId;\n const connectionScope = input.connectionScope ?? 'tenant';\n const I18N = `@${RootConfig.config.i18n}:integration.connect`;\n\n const confirmed = await this.openEnableDialog(I18N);\n if (!confirmed) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n\n const existing = await this.connectionManager.findByUniqueKey({\n providerId,\n connectionScope,\n connectionKey: 'default',\n });\n\n const connection = await this.connectionManager.upsertConnection({\n providerId,\n authMethodType: AXP_INTEGRATION_AUTH_METHOD_TYPE.ApiToken,\n connectionScope,\n connectionKey: 'default',\n displayName: existing?.displayName ?? 'ACoreX Captcha',\n instanceUrl: existing?.instanceUrl ?? null,\n externalAccountName: 'acorex-captcha',\n config: {\n enabled: true,\n // Presence marker for shared credential helpers.\n clientSecret:\n (typeof existing?.config?.['clientSecret'] === 'string' &&\n existing.config['clientSecret']) ||\n createRandomUuid(),\n } as Record<string, unknown>,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n isRevoked: false,\n isDisabled: false,\n });\n\n await this.settingDefinitions.reload().catch(() => undefined);\n\n return {\n success: true,\n kind: 'object',\n data: { outcome: 'connected', connection: toSafeIntegrationConnectionDto(connection) },\n };\n } catch (error: unknown) {\n const message = error instanceof Error ? error.message : 'Failed to enable ACoreX Captcha.';\n return { success: false, message: { text: message } };\n }\n }\n\n private async openEnableDialog(i18nPrefix: string): Promise<boolean> {\n const result = await this.layoutBuilder\n .create()\n .dialog<boolean>(\n (dialog: IDialogBuilder<boolean>) => {\n dialog\n .setTitle(`${i18nPrefix}.dialog.title`)\n .setSize('md')\n .setCloseButton(true)\n .content((flex: IFlexContainerBuilder) => {\n flex\n .setDirection('column')\n .setGap('12px')\n .customWidget('text-block-layout', {\n content: `${i18nPrefix}.dialog.instructions`,\n });\n })\n .setActions((actions: IActionBuilder) => {\n actions\n .cancel('@general:actions.cancel.title')\n .submit(`${i18nPrefix}.dialog.actions.enable`);\n })\n .onAction(async (ref: AXPDialogRef) => {\n return ref.action() !== 'cancel';\n });\n },\n )\n .show();\n\n return resolveLayoutBuilderDialogResult<boolean>(result) === true;\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;AAmCA;AAEA;AAEA;;AAEG;MAEU,2BAA2B,CAAA;AADxC,IAAA,WAAA,GAAA;AAImB,QAAA,IAAA,CAAA,aAAa,GAAG,MAAM,CAAC,uBAAuB,CAAC;AAC/C,QAAA,IAAA,CAAA,iBAAiB,GAAG,MAAM,CAAC,+BAA+B,CAAC;AAC3D,QAAA,IAAA,CAAA,kBAAkB,GAAG,MAAM,CAAC,mCAAmC,CAAC;AAsFlF,IAAA;AApFC,IAAA,MAAM,OAAO,CACX,KAAA,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CAAC;AACA,iBAAA,QAAQ,CAAC,OAAO,GAAiB,KAAI;AACpC,gBAAA,OAAO,GAAG,CAAC,MAAM,EAAE,KAAK,QAAQ;AAClC,YAAA,CAAC,CAAC;AACN,QAAA,CAAC;AAEF,aAAA,IAAI,EAAE;AAET,QAAA,OAAO,gCAAgC,CAAU,MAAM,CAAC,KAAK,IAAI;IACnE;8GA1FW,2BAA2B,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA3B,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,2BAA2B,cADd,MAAM,EAAA,CAAA,CAAA;;2FACnB,2BAA2B,EAAA,UAAA,EAAA,CAAA;kBADvC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
@@ -426,7 +426,7 @@ class AXEAcorexCaptchaExtensionModule {
|
|
|
426
426
|
provideCommandSetups([
|
|
427
427
|
{
|
|
428
428
|
key: AXEAcorexCaptchaCommandKeys.ConnectionConnect,
|
|
429
|
-
command: () => import('./acorex-platform-extension-acorex-captcha-client-connect-acorex-captcha.command-
|
|
429
|
+
command: () => import('./acorex-platform-extension-acorex-captcha-client-connect-acorex-captcha.command-BCsKPmTs.mjs').then((c) => c.ConnectAcorexCaptchaCommand),
|
|
430
430
|
},
|
|
431
431
|
]),
|
|
432
432
|
], imports: [AXMIntegrationManagementModule] }); }
|
|
@@ -464,7 +464,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
464
464
|
provideCommandSetups([
|
|
465
465
|
{
|
|
466
466
|
key: AXEAcorexCaptchaCommandKeys.ConnectionConnect,
|
|
467
|
-
command: () => import('./acorex-platform-extension-acorex-captcha-client-connect-acorex-captcha.command-
|
|
467
|
+
command: () => import('./acorex-platform-extension-acorex-captcha-client-connect-acorex-captcha.command-BCsKPmTs.mjs').then((c) => c.ConnectAcorexCaptchaCommand),
|
|
468
468
|
},
|
|
469
469
|
]),
|
|
470
470
|
],
|