Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions packages/plugin/src/Bundles/GraphQL/Arguments/CaptchaArguments.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,17 @@ public static function getArguments(): array
'name' => [
'name' => 'name',
'type' => Type::string(),
'description' => 'The Captcha field input name (E.g "g-recaptcha-response", "h-captcha-response" or "cf-turnstile-response")',
'description' => 'The Captcha field input name (e.g. "g-recaptcha-response", "h-captcha-response", "cf-turnstile-response", or "frc-captcha-response")',
],
'startMode' => [
'name' => 'startMode',
'type' => Type::string(),
'description' => 'Friendly Captcha start mode: auto, focus, or none',
],
'apiEndpoint' => [
'name' => 'apiEndpoint',
'type' => Type::string(),
'description' => 'Friendly Captcha API endpoint region (e.g. global)',
],

/*
Expand All @@ -69,7 +79,7 @@ public static function getArguments(): array
'handle' => [
'name' => 'handle',
'type' => Type::string(),
'description' => 'The Captcha field input name (E.g "g-recaptcha-response", "h-captcha-response" or "cf-turnstile-response"). Deprecated. Will be removed in Freeform 6.0.',
'description' => 'The Captcha field input name (e.g. "g-recaptcha-response", "h-captcha-response", "cf-turnstile-response", or "frc-captcha-response"). Deprecated. Will be removed in Freeform 6.0.',
],

/*
Expand Down
10 changes: 10 additions & 0 deletions packages/plugin/src/Bundles/GraphQL/Resolvers/CaptchaResolver.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use GraphQL\Type\Definition\ResolveInfo;
use Solspace\Freeform\Attributes\Integration\Type;
use Solspace\Freeform\Freeform;
use Solspace\Freeform\Integrations\Captchas\FriendlyCaptcha\FriendlyCaptcha;
use Solspace\Freeform\Integrations\Captchas\hCaptcha\hCaptcha;
use Solspace\Freeform\Integrations\Captchas\ReCaptcha\ReCaptcha;
use Solspace\Freeform\Integrations\Captchas\Turnstile\Turnstile;
Expand Down Expand Up @@ -112,6 +113,15 @@ public static function getArguments(CaptchaIntegrationInterface $integration): a
$arguments['name'] = 'cf-turnstile-response';
}

if ($integration instanceof FriendlyCaptcha) {
$arguments['action'] = null;
$arguments['version'] = null;
$arguments['scoreThreshold'] = null;
$arguments['name'] = 'frc-captcha-response';
$arguments['startMode'] = $integration->getStartMode();
$arguments['apiEndpoint'] = 'global';
}

return $arguments;
}
}
8 changes: 8 additions & 0 deletions packages/plugin/src/Bundles/GraphQL/Types/CaptchaType.php
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,14 @@ protected function resolve($source, $arguments, mixed $context, ResolveInfo $res
return $source['name'] ?? null;
}

if ('startMode' === $resolveInfo->fieldName) {
return $source['startMode'] ?? null;
}

if ('apiEndpoint' === $resolveInfo->fieldName) {
return $source['apiEndpoint'] ?? null;
}

/*
* @deprecated - this argument is no longer used
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,4 +75,4 @@ If you want the form submitter to automatically (or optionally) be opted into an

---

<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/premium/) to build any feature or change you need.</small>
<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/custom-development/) to build any feature or change you need.</small>
2 changes: 1 addition & 1 deletion packages/plugin/src/Integrations/CRM/Freshdesk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,4 +65,4 @@ To use this integration on your form(s), you'll need to configure each form indi

---

<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/premium/) to build any feature or change you need.</small>
<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/custom-development/) to build any feature or change you need.</small>
2 changes: 1 addition & 1 deletion packages/plugin/src/Integrations/CRM/HubSpot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,4 +101,4 @@ To use this integration on your form(s), you'll need to configure each form indi

---

<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/premium/) to build any feature or change you need.</small>
<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/custom-development/) to build any feature or change you need.</small>
2 changes: 1 addition & 1 deletion packages/plugin/src/Integrations/CRM/Insightly/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,4 @@ To use this integration on your form(s), you'll need to configure each form indi

---

<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/premium/) to build any feature or change you need.</small>
<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/custom-development/) to build any feature or change you need.</small>
2 changes: 1 addition & 1 deletion packages/plugin/src/Integrations/CRM/Pardot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,4 @@ To use this integration on your form(s), you'll need to configure each form indi

---

<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/premium/) to build any feature or change you need.</small>
<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/custom-development/) to build any feature or change you need.</small>
2 changes: 1 addition & 1 deletion packages/plugin/src/Integrations/CRM/Pipedrive/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,4 +108,4 @@ To use this integration on your form(s), you'll need to configure each form indi

---

<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/premium/) to build any feature or change you need.</small>
<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/custom-development/) to build any feature or change you need.</small>
2 changes: 1 addition & 1 deletion packages/plugin/src/Integrations/CRM/Salesforce/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,4 @@ To use this integration on your form(s), you'll need to configure each form indi

---

<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/premium/) to build any feature or change you need.</small>
<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/custom-development/) to build any feature or change you need.</small>
2 changes: 1 addition & 1 deletion packages/plugin/src/Integrations/CRM/Zoho/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,4 +69,4 @@ To use this integration on your form(s), you'll need to configure each form indi

---

<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/premium/) to build any feature or change you need.</small>
<small>Do you need more from this integration? Is the integration you're looking for not here? Solspace offers [custom software development services](https://docs.solspace.com/support/custom-development/) to build any feature or change you need.</small>
2 changes: 2 additions & 0 deletions packages/plugin/src/Integrations/Captchas/CaptchasBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
use Solspace\Freeform\Events\Forms\ValidationEvent;
use Solspace\Freeform\Events\Integrations\RegisterIntegrationTypesEvent;
use Solspace\Freeform\Form\Form;
use Solspace\Freeform\Integrations\Captchas\FriendlyCaptcha\FriendlyCaptcha;
use Solspace\Freeform\Integrations\Captchas\hCaptcha\hCaptcha;
use Solspace\Freeform\Integrations\Captchas\ReCaptcha\ReCaptcha;
use Solspace\Freeform\Integrations\Captchas\Turnstile\Turnstile;
Expand Down Expand Up @@ -210,6 +211,7 @@ public function registerTypes(RegisterIntegrationTypesEvent $event): void
$event->addType(ReCaptcha::class);
$event->addType(hCaptcha::class);
$event->addType(Turnstile::class);
$event->addType(FriendlyCaptcha::class);
}

public function processOptions(SetPropertiesEvent $event): void
Expand Down
Loading
Loading