@acorex-platform/extension-google-recaptcha-client 2.0.0-next.50 → 2.0.0-next.55
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-google-recaptcha-client-connect-google-recaptcha.command-Ds7Lw59J.mjs → acorex-platform-extension-google-recaptcha-client-connect-google-recaptcha.command-ugpdcZZx.mjs} +1 -1
- package/fesm2022/{acorex-platform-extension-google-recaptcha-client-connect-google-recaptcha.command-Ds7Lw59J.mjs.map → acorex-platform-extension-google-recaptcha-client-connect-google-recaptcha.command-ugpdcZZx.mjs.map} +1 -1
- package/fesm2022/acorex-platform-extension-google-recaptcha-client.mjs +2 -2
- package/package.json +1 -1
|
@@ -149,4 +149,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
149
149
|
}] });
|
|
150
150
|
|
|
151
151
|
export { ConnectGoogleRecaptchaCommand };
|
|
152
|
-
//# sourceMappingURL=acorex-platform-extension-google-recaptcha-client-connect-google-recaptcha.command-
|
|
152
|
+
//# sourceMappingURL=acorex-platform-extension-google-recaptcha-client-connect-google-recaptcha.command-ugpdcZZx.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acorex-platform-extension-google-recaptcha-client-connect-google-recaptcha.command-Ds7Lw59J.mjs","sources":["../../../../libs/extensions/google-recaptcha/client/src/lib/features/connect/connect-google-recaptcha.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 type AXPIntegrationConnectionScope,\n} from '@acorex-platform/framework-shared/core';\nimport {\n AXMIntegrationConnectionManager,\n AXP_INTEGRATION_CREDENTIAL_MASK,\n hasConfiguredIntegrationCredentials,\n isMaskedIntegrationCredential,\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 { trim } from 'lodash-es';\nimport {\n RootConfig,\n type AXEGoogleRecaptchaConnectionConfig,\n} from '@acorex-platform/extension-google-recaptcha-client/contracts';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport interface ConnectGoogleRecaptchaCommandInput {\n providerId?: string;\n connectionScope?: AXPIntegrationConnectionScope;\n}\n\ninterface GoogleRecaptchaConnectFormResult {\n siteKey: string;\n secretKey: string;\n}\n\n//#endregion\n\n//#region ----- Connect Google reCAPTCHA -----\n\n/**\n * Saves platform tenant reCAPTCHA keys on IntegrationConnection.\n * Does not call Google APIs (skeleton).\n */\n@Injectable({ providedIn: 'root' })\nexport class ConnectGoogleRecaptchaCommand\n implements AXPCommand<ConnectGoogleRecaptchaCommandInput, 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: ConnectGoogleRecaptchaCommandInput = {},\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 const existing = await this.connectionManager.findByUniqueKey({\n providerId,\n connectionScope,\n connectionKey: 'default',\n });\n const isReconfigure = hasConfiguredIntegrationCredentials(existing);\n const existingConfig = (existing?.config ?? {}) as AXEGoogleRecaptchaConnectionConfig;\n\n // Prefill the real secret when present so password revealToggle can show it.\n // Fall back to the shared mask only when the stored secret is unavailable.\n const storedSecret = trim(existingConfig.secretKey ?? existingConfig.clientSecret ?? '');\n const form = await this.openConnectDialog({\n i18nPrefix: I18N,\n isReconfigure,\n siteKey: isReconfigure ? (existingConfig.siteKey ?? '') : '',\n secretKey: isReconfigure ? storedSecret || AXP_INTEGRATION_CREDENTIAL_MASK : '',\n });\n\n if (!form) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n\n let siteKey = trim(form.siteKey);\n let secretKey = trim(form.secretKey);\n\n if (isMaskedIntegrationCredential(secretKey) && existing) {\n secretKey = trim(existingConfig.secretKey ?? '');\n }\n\n if (!siteKey || !secretKey) {\n return {\n success: false,\n message: { text: `${I18N}.dialog.messages.keys-required` },\n };\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 ?? 'Google reCAPTCHA v2',\n instanceUrl: existing?.instanceUrl ?? null,\n externalAccountName: siteKey,\n // clientSecret mirrors secretKey so hasConfiguredIntegrationCredentials detects the connection.\n config: {\n siteKey,\n secretKey,\n clientSecret: secretKey,\n } as Record<string, unknown>,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n isRevoked: false,\n isDisabled: false,\n });\n\n // Rebuild settings catalog so Default Captcha Provider lists the new connection.\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 connect Google reCAPTCHA.';\n return { success: false, message: { text: message } };\n }\n }\n\n private async openConnectDialog(input: {\n i18nPrefix: string;\n isReconfigure: boolean;\n siteKey: string;\n secretKey: string;\n }): Promise<GoogleRecaptchaConnectFormResult | null> {\n const result = await this.layoutBuilder\n .create()\n .dialog<GoogleRecaptchaConnectFormResult | null>(\n (dialog: IDialogBuilder<GoogleRecaptchaConnectFormResult | null>) => {\n dialog\n .setTitle(\n input.isReconfigure\n ? `${input.i18nPrefix}.dialog.configure-title`\n : `${input.i18nPrefix}.dialog.title`,\n )\n .setSize('md')\n .setCloseButton(true)\n .setContext({ siteKey: input.siteKey, secretKey: input.secretKey })\n .content((flex: IFlexContainerBuilder) => {\n flex\n .setDirection('column')\n .setGap('12px')\n .customWidget('text-block-layout', {\n content: `${input.i18nPrefix}.dialog.instructions`,\n })\n .formField(`${input.i18nPrefix}.dialog.fields.site-key`, (field) => {\n field.path('siteKey');\n field.textBox({\n placeholder: `${input.i18nPrefix}.dialog.placeholders.site-key`,\n validations: [{ rule: 'required' }],\n });\n })\n .formField(`${input.i18nPrefix}.dialog.fields.secret-key`, (field) => {\n field.path('secretKey');\n field.passwordBox({\n placeholder: `${input.i18nPrefix}.dialog.placeholders.secret-key`,\n revealToggle: true,\n validations: [{ rule: 'required' }],\n });\n });\n })\n .setActions((actions: IActionBuilder) => {\n actions\n .cancel('@general:actions.cancel.title')\n .submit(`${input.i18nPrefix}.dialog.actions.save`);\n })\n .onAction(async (ref: AXPDialogRef) => {\n if (ref.action() === 'cancel') {\n return null;\n }\n const ctx = ref.context() as { siteKey?: string; secretKey?: string };\n const siteKey = trim(ctx.siteKey ?? '');\n const secretKey = trim(ctx.secretKey ?? '');\n if (!siteKey || !secretKey) {\n throw new Error(`${input.i18nPrefix}.dialog.messages.keys-required`);\n }\n return { siteKey, secretKey };\n });\n },\n )\n .show();\n\n return resolveLayoutBuilderDialogResult<GoogleRecaptchaConnectFormResult>(result);\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;AA8CA;AAEA;AAEA;;;AAGG;MAEU,6BAA6B,CAAA;AAD1C,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,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EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAA7B,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,6BAA6B,cADhB,MAAM,EAAA,CAAA,CAAA;;2FACnB,6BAA6B,EAAA,UAAA,EAAA,CAAA;kBADzC,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
|
|
1
|
+
{"version":3,"file":"acorex-platform-extension-google-recaptcha-client-connect-google-recaptcha.command-ugpdcZZx.mjs","sources":["../../../../libs/extensions/google-recaptcha/client/src/lib/features/connect/connect-google-recaptcha.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 type AXPIntegrationConnectionScope,\n} from '@acorex-platform/framework-shared/core';\nimport {\n AXMIntegrationConnectionManager,\n AXP_INTEGRATION_CREDENTIAL_MASK,\n hasConfiguredIntegrationCredentials,\n isMaskedIntegrationCredential,\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 { trim } from 'lodash-es';\nimport {\n RootConfig,\n type AXEGoogleRecaptchaConnectionConfig,\n} from '@acorex-platform/extension-google-recaptcha-client/contracts';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport interface ConnectGoogleRecaptchaCommandInput {\n providerId?: string;\n connectionScope?: AXPIntegrationConnectionScope;\n}\n\ninterface GoogleRecaptchaConnectFormResult {\n siteKey: string;\n secretKey: string;\n}\n\n//#endregion\n\n//#region ----- Connect Google reCAPTCHA -----\n\n/**\n * Saves platform tenant reCAPTCHA keys on IntegrationConnection.\n * Does not call Google APIs (skeleton).\n */\n@Injectable({ providedIn: 'root' })\nexport class ConnectGoogleRecaptchaCommand\n implements AXPCommand<ConnectGoogleRecaptchaCommandInput, 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: ConnectGoogleRecaptchaCommandInput = {},\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 const existing = await this.connectionManager.findByUniqueKey({\n providerId,\n connectionScope,\n connectionKey: 'default',\n });\n const isReconfigure = hasConfiguredIntegrationCredentials(existing);\n const existingConfig = (existing?.config ?? {}) as AXEGoogleRecaptchaConnectionConfig;\n\n // Prefill the real secret when present so password revealToggle can show it.\n // Fall back to the shared mask only when the stored secret is unavailable.\n const storedSecret = trim(existingConfig.secretKey ?? existingConfig.clientSecret ?? '');\n const form = await this.openConnectDialog({\n i18nPrefix: I18N,\n isReconfigure,\n siteKey: isReconfigure ? (existingConfig.siteKey ?? '') : '',\n secretKey: isReconfigure ? storedSecret || AXP_INTEGRATION_CREDENTIAL_MASK : '',\n });\n\n if (!form) {\n return { success: true, kind: 'object', data: { outcome: 'cancelled' } };\n }\n\n let siteKey = trim(form.siteKey);\n let secretKey = trim(form.secretKey);\n\n if (isMaskedIntegrationCredential(secretKey) && existing) {\n secretKey = trim(existingConfig.secretKey ?? '');\n }\n\n if (!siteKey || !secretKey) {\n return {\n success: false,\n message: { text: `${I18N}.dialog.messages.keys-required` },\n };\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 ?? 'Google reCAPTCHA v2',\n instanceUrl: existing?.instanceUrl ?? null,\n externalAccountName: siteKey,\n // clientSecret mirrors secretKey so hasConfiguredIntegrationCredentials detects the connection.\n config: {\n siteKey,\n secretKey,\n clientSecret: secretKey,\n } as Record<string, unknown>,\n status: AXP_INTEGRATION_CONNECTION_STATUS.Connected,\n isRevoked: false,\n isDisabled: false,\n });\n\n // Rebuild settings catalog so Default Captcha Provider lists the new connection.\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 connect Google reCAPTCHA.';\n return { success: false, message: { text: message } };\n }\n }\n\n private async openConnectDialog(input: {\n i18nPrefix: string;\n isReconfigure: boolean;\n siteKey: string;\n secretKey: string;\n }): Promise<GoogleRecaptchaConnectFormResult | null> {\n const result = await this.layoutBuilder\n .create()\n .dialog<GoogleRecaptchaConnectFormResult | null>(\n (dialog: IDialogBuilder<GoogleRecaptchaConnectFormResult | null>) => {\n dialog\n .setTitle(\n input.isReconfigure\n ? `${input.i18nPrefix}.dialog.configure-title`\n : `${input.i18nPrefix}.dialog.title`,\n )\n .setSize('md')\n .setCloseButton(true)\n .setContext({ siteKey: input.siteKey, secretKey: input.secretKey })\n .content((flex: IFlexContainerBuilder) => {\n flex\n .setDirection('column')\n .setGap('12px')\n .customWidget('text-block-layout', {\n content: `${input.i18nPrefix}.dialog.instructions`,\n })\n .formField(`${input.i18nPrefix}.dialog.fields.site-key`, (field) => {\n field.path('siteKey');\n field.textBox({\n placeholder: `${input.i18nPrefix}.dialog.placeholders.site-key`,\n validations: [{ rule: 'required' }],\n });\n })\n .formField(`${input.i18nPrefix}.dialog.fields.secret-key`, (field) => {\n field.path('secretKey');\n field.passwordBox({\n placeholder: `${input.i18nPrefix}.dialog.placeholders.secret-key`,\n revealToggle: true,\n validations: [{ rule: 'required' }],\n });\n });\n })\n .setActions((actions: IActionBuilder) => {\n actions\n .cancel('@general:actions.cancel.title')\n .submit(`${input.i18nPrefix}.dialog.actions.save`);\n })\n .onAction(async (ref: AXPDialogRef) => {\n if (ref.action() === 'cancel') {\n return null;\n }\n const ctx = ref.context() as { siteKey?: string; secretKey?: string };\n const siteKey = trim(ctx.siteKey ?? '');\n const secretKey = trim(ctx.secretKey ?? '');\n if (!siteKey || !secretKey) {\n throw new Error(`${input.i18nPrefix}.dialog.messages.keys-required`);\n }\n return { siteKey, secretKey };\n });\n },\n )\n .show();\n\n return resolveLayoutBuilderDialogResult<GoogleRecaptchaConnectFormResult>(result);\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;AA8CA;AAEA;AAEA;;;AAGG;MAEU,6BAA6B,CAAA;AAD1C,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;AA+IlF,IAAA;AA7IC,IAAA,MAAM,OAAO,CACX,KAAA,GAA4C,EAAE,EAAA;AAE9C,QAAA,IAAI;YACF,MAAM,UAAU,GAAG,KAAK,CAAC,UAAU,IAAI,UAAU,CAAC,WAAW,CAAC,UAAU;AACxE,YAAA,MAAM,eAAe,GAAG,KAAK,CAAC,eAAe,IAAI,QAAQ;YACzD,MAAM,IAAI,GAAG,CAAA,CAAA,EAAI,UAAU,CAAC,MAAM,CAAC,IAAI,CAAA,oBAAA,CAAsB;YAC7D,MAAM,QAAQ,GAAG,MAAM,IAA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{
|
|
|
436
436
|
provideCommandSetups([
|
|
437
437
|
{
|
|
438
438
|
key: AXEGoogleRecaptchaCommandKeys.ConnectionConnect,
|
|
439
|
-
command: () => import('./acorex-platform-extension-google-recaptcha-client-connect-google-recaptcha.command-
|
|
439
|
+
command: () => import('./acorex-platform-extension-google-recaptcha-client-connect-google-recaptcha.command-ugpdcZZx.mjs').then((c) => c.ConnectGoogleRecaptchaCommand),
|
|
440
440
|
},
|
|
441
441
|
]),
|
|
442
442
|
], imports: [AXMIntegrationManagementModule] }); }
|
|
@@ -470,7 +470,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
|
|
|
470
470
|
provideCommandSetups([
|
|
471
471
|
{
|
|
472
472
|
key: AXEGoogleRecaptchaCommandKeys.ConnectionConnect,
|
|
473
|
-
command: () => import('./acorex-platform-extension-google-recaptcha-client-connect-google-recaptcha.command-
|
|
473
|
+
command: () => import('./acorex-platform-extension-google-recaptcha-client-connect-google-recaptcha.command-ugpdcZZx.mjs').then((c) => c.ConnectGoogleRecaptchaCommand),
|
|
474
474
|
},
|
|
475
475
|
]),
|
|
476
476
|
],
|