@acorex-platform/extension-cloudflare-turnstile-client 2.0.0-next.49 → 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.
@@ -144,4 +144,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
144
144
  }] });
145
145
 
146
146
  export { ConnectCloudflareTurnstileCommand };
147
- //# sourceMappingURL=acorex-platform-extension-cloudflare-turnstile-client-connect-cloudflare-turnstile.command-BiFV2Irg.mjs.map
147
+ //# sourceMappingURL=acorex-platform-extension-cloudflare-turnstile-client-connect-cloudflare-turnstile.command-D7vkWc_Z.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"acorex-platform-extension-cloudflare-turnstile-client-connect-cloudflare-turnstile.command-BiFV2Irg.mjs","sources":["../../../../libs/extensions/cloudflare-turnstile/client/src/lib/features/connect/connect-cloudflare-turnstile.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 AXECloudflareTurnstileConnectionConfig,\n} from '@acorex-platform/extension-cloudflare-turnstile-client/contracts';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport interface ConnectCloudflareTurnstileCommandInput {\n providerId?: string;\n connectionScope?: AXPIntegrationConnectionScope;\n}\n\ninterface CloudflareTurnstileConnectFormResult {\n siteKey: string;\n secretKey: string;\n}\n\n//#endregion\n\n//#region ----- Connect Cloudflare Turnstile -----\n\n/**\n * Saves platform tenant Turnstile keys on IntegrationConnection.\n */\n@Injectable({ providedIn: 'root' })\nexport class ConnectCloudflareTurnstileCommand\n implements AXPCommand<ConnectCloudflareTurnstileCommandInput, 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: ConnectCloudflareTurnstileCommandInput = {},\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 AXECloudflareTurnstileConnectionConfig;\n\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 ?? 'Cloudflare Turnstile',\n instanceUrl: existing?.instanceUrl ?? null,\n externalAccountName: siteKey,\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 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 Cloudflare Turnstile.';\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<CloudflareTurnstileConnectFormResult | null> {\n const result = await this.layoutBuilder\n .create()\n .dialog<CloudflareTurnstileConnectFormResult | null>(\n (dialog: IDialogBuilder<CloudflareTurnstileConnectFormResult | 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<CloudflareTurnstileConnectFormResult>(result);\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;AA8CA;AAEA;AAEA;;AAEG;MAEU,iCAAiC,CAAA;AAD9C,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;AA2IlF,IAAA;AAzIC,IAAA,MAAM,OAAO,CACX,KAAA,GAAgD,EAAE,EAAA;AAElD,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,IAAI,CAAC,iBAAiB,CAAC,eAAe,CAAC;gBAC5D,UAAU;gBACV,eAAe;AACf,gBAAA,aAAa,EAAE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,CAAsB,CAAC;AACtD,YAAA,CAAC;AACA,iBAAA,QAAQ,CAAC,OAAO,GAAiB,KAAI;AACpC,gBAAA,IAAI,GAAG,CAAC,MAAM,EAAE,KAAK,QAAQ,EAAE;AAC7B,oBAAA,OAAO,IAAI;gBACb;AACA,gBAAA,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,EAA8C;gBACrE,MAAM,OAAO,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC;gBACvC,MAAM,SAAS,GAAG,IAAI,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC;AAC3C,gBAAA,IAAI,CAAC,OAAO,IAAI,CAAC,SAAS,EAAE;oBAC1B,MAAM,IAAI,KAAK,CAAC,CAAA,EAAG,KAAK,CAAC,UAAU,CAAA,8BAAA,CAAgC,CAAC;gBACtE;AACA,gBAAA,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE;AAC/B,YAAA,CAAC,CAAC;AACN,QAAA,CAAC;AAEF,aAAA,IAAI,EAAE;AAET,QAAA,OAAO,gCAAgC,CAAuC,MAAM,CAAC;IACvF;8GA/IW,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjC,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,iCAAiC,cADpB,MAAM,EAAA,CAAA,CAAA;;2FACnB,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAD7C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
1
+ {"version":3,"file":"acorex-platform-extension-cloudflare-turnstile-client-connect-cloudflare-turnstile.command-D7vkWc_Z.mjs","sources":["../../../../libs/extensions/cloudflare-turnstile/client/src/lib/features/connect/connect-cloudflare-turnstile.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 AXECloudflareTurnstileConnectionConfig,\n} from '@acorex-platform/extension-cloudflare-turnstile-client/contracts';\n\n//#endregion\n\n//#region ----- Types -----\n\nexport interface ConnectCloudflareTurnstileCommandInput {\n providerId?: string;\n connectionScope?: AXPIntegrationConnectionScope;\n}\n\ninterface CloudflareTurnstileConnectFormResult {\n siteKey: string;\n secretKey: string;\n}\n\n//#endregion\n\n//#region ----- Connect Cloudflare Turnstile -----\n\n/**\n * Saves platform tenant Turnstile keys on IntegrationConnection.\n */\n@Injectable({ providedIn: 'root' })\nexport class ConnectCloudflareTurnstileCommand\n implements AXPCommand<ConnectCloudflareTurnstileCommandInput, 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: ConnectCloudflareTurnstileCommandInput = {},\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 AXECloudflareTurnstileConnectionConfig;\n\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 ?? 'Cloudflare Turnstile',\n instanceUrl: existing?.instanceUrl ?? null,\n externalAccountName: siteKey,\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 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 Cloudflare Turnstile.';\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<CloudflareTurnstileConnectFormResult | null> {\n const result = await this.layoutBuilder\n .create()\n .dialog<CloudflareTurnstileConnectFormResult | null>(\n (dialog: IDialogBuilder<CloudflareTurnstileConnectFormResult | 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<CloudflareTurnstileConnectFormResult>(result);\n }\n}\n\n//#endregion\n"],"names":[],"mappings":";;;;;;;;;AA8CA;AAEA;AAEA;;AAEG;MAEU,iCAAiC,CAAA;AAD9C,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B,YAAA,CAAC,CAAC;AACN,QAAA,CAAC;AAEF,aAAA,IAAI,EAAE;AAET,QAAA,OAAO,gCAAgC,CAAuC,MAAM,CAAC;IACvF;8GA/IW,iCAAiC,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA;AAAjC,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,iCAAiC,cADpB,MAAM,EAAA,CAAA,CAAA;;2FACnB,iCAAiC,EAAA,UAAA,EAAA,CAAA;kBAD7C,UAAU;mBAAC,EAAE,UAAU,EAAE,MAAM,EAAE;;;"}
@@ -435,7 +435,7 @@ class AXECloudflareTurnstileExtensionModule {
435
435
  provideCommandSetups([
436
436
  {
437
437
  key: AXECloudflareTurnstileCommandKeys.ConnectionConnect,
438
- command: () => import('./acorex-platform-extension-cloudflare-turnstile-client-connect-cloudflare-turnstile.command-BiFV2Irg.mjs').then((c) => c.ConnectCloudflareTurnstileCommand),
438
+ command: () => import('./acorex-platform-extension-cloudflare-turnstile-client-connect-cloudflare-turnstile.command-D7vkWc_Z.mjs').then((c) => c.ConnectCloudflareTurnstileCommand),
439
439
  },
440
440
  ]),
441
441
  ], imports: [AXMIntegrationManagementModule] }); }
@@ -473,7 +473,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.8", ngImpor
473
473
  provideCommandSetups([
474
474
  {
475
475
  key: AXECloudflareTurnstileCommandKeys.ConnectionConnect,
476
- command: () => import('./acorex-platform-extension-cloudflare-turnstile-client-connect-cloudflare-turnstile.command-BiFV2Irg.mjs').then((c) => c.ConnectCloudflareTurnstileCommand),
476
+ command: () => import('./acorex-platform-extension-cloudflare-turnstile-client-connect-cloudflare-turnstile.command-D7vkWc_Z.mjs').then((c) => c.ConnectCloudflareTurnstileCommand),
477
477
  },
478
478
  ]),
479
479
  ],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@acorex-platform/extension-cloudflare-turnstile-client",
3
- "version": "2.0.0-next.49",
3
+ "version": "2.0.0-next.54",
4
4
  "sideEffects": false,
5
5
  "peerDependencies": {
6
6
  "@angular/common": "^21.0.0 || ^22.0.0",