Skip to content

Commit

Permalink
chore: release v2.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
johannschopplich committed Dec 26, 2024
1 parent f5a4455 commit 9ae7ce9
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "johannschopplich/kirby-live-preview",
"description": "Real-time page preview in the Kirby Panel",
"type": "kirby-plugin",
"version": "2.0.0",
"version": "2.0.1",
"keywords": [
"content",
"kirby",
Expand Down
2 changes: 1 addition & 1 deletion composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "kirby-live-preview",
"type": "module",
"version": "2.0.0",
"version": "2.0.1",
"private": true,
"packageManager": "pnpm@9.15.1",
"scripts": {
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/installed.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,23 +52,23 @@
},
{
"name": "johannschopplich/kirby-tools-licensing",
"version": "0.6.0",
"version_normalized": "0.6.0.0",
"version": "0.7.0",
"version_normalized": "0.7.0.0",
"source": {
"type": "git",
"url": "https://github.com/kirby-tools/licensing-backend.git",
"reference": "2b39760e35964f3ba41b71f7b05a68a998559847"
"reference": "d8b469f7ab0f38b9540c2f20d85ed3a962b5f343"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/kirby-tools/licensing-backend/zipball/2b39760e35964f3ba41b71f7b05a68a998559847",
"reference": "2b39760e35964f3ba41b71f7b05a68a998559847",
"url": "https://api.github.com/repos/kirby-tools/licensing-backend/zipball/d8b469f7ab0f38b9540c2f20d85ed3a962b5f343",
"reference": "d8b469f7ab0f38b9540c2f20d85ed3a962b5f343",
"shasum": ""
},
"require-dev": {
"getkirby/cms": "^4"
},
"time": "2024-12-19T06:36:45+00:00",
"time": "2024-12-26T09:48:09+00:00",
"type": "library",
"extra": {
"kirby-cms-path": false
Expand All @@ -94,7 +94,7 @@
"homepage": "https://github.com/kirby-tools/licensing-backend#readme",
"support": {
"issues": "https://github.com/kirby-tools/licensing-backend/issues",
"source": "https://github.com/kirby-tools/licensing-backend/tree/v0.6.0"
"source": "https://github.com/kirby-tools/licensing-backend/tree/v0.7.0"
},
"install-path": "../johannschopplich/kirby-tools-licensing"
}
Expand Down
14 changes: 7 additions & 7 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?php return array(
'root' => array(
'name' => 'johannschopplich/kirby-live-preview',
'pretty_version' => '2.0.0',
'version' => '2.0.0.0',
'pretty_version' => '2.0.1',
'version' => '2.0.1.0',
'reference' => null,
'type' => 'kirby-plugin',
'install_path' => __DIR__ . '/../../',
Expand All @@ -20,18 +20,18 @@
'dev_requirement' => false,
),
'johannschopplich/kirby-live-preview' => array(
'pretty_version' => '2.0.0',
'version' => '2.0.0.0',
'pretty_version' => '2.0.1',
'version' => '2.0.1.0',
'reference' => null,
'type' => 'kirby-plugin',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
'dev_requirement' => false,
),
'johannschopplich/kirby-tools-licensing' => array(
'pretty_version' => '0.6.0',
'version' => '0.6.0.0',
'reference' => '2b39760e35964f3ba41b71f7b05a68a998559847',
'pretty_version' => '0.7.0',
'version' => '0.7.0.0',
'reference' => 'd8b469f7ab0f38b9540c2f20d85ed3a962b5f343',
'type' => 'library',
'install_path' => __DIR__ . '/../johannschopplich/kirby-tools-licensing',
'aliases' => array(),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "johannschopplich/kirby-tools-licensing",
"description": "Shared tooling for Kirby Tools licensing in Kirby",
"type": "library",
"version": "0.6.0",
"version": "0.7.0",
"license": "AGPL-3.0-or-later",
"homepage": "https://github.com/kirby-tools/licensing-backend#readme",
"authors": [
Expand Down
18 changes: 9 additions & 9 deletions vendor/johannschopplich/kirby-tools-licensing/src/Licenses.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function getStatus(): string

public function getLicense(): array|bool
{
if (!$this->isRegistered()) {
if (!$this->isActivated()) {
return false;
}

Expand Down Expand Up @@ -117,7 +117,7 @@ public function getPluginVersion(): string|null
return App::instance()->plugin($kirbyPackageName)?->version();
}

public function isRegistered(): bool
public function isActivated(): bool
{
return $this->isValid($this->getLicenseKey()) && $this->isCompatible($this->getLicenseCompatibility());
}
Expand Down Expand Up @@ -172,13 +172,13 @@ public function isUpgradeable(string|null $versionConstraint): bool
return false;
}

public function register(string $email, string|int $orderId): void
public function activate(string $email, string|int $orderId): void
{
if ($this->isRegistered()) {
throw new LogicException('License key already registered');
if ($this->isActivated()) {
throw new LogicException('License key already activated');
}

$response = $this->request('licenses', [
$response = $this->request('auth/activate', [
'method' => 'POST',
'data' => [
'email' => $email,
Expand All @@ -203,7 +203,7 @@ public function register(string $email, string|int $orderId): void
$this->update($this->packageName, $response);
}

public function registerFromRequest(): array
public function activateFromRequest(): array
{
$request = App::instance()->request();
$email = $request->get('email');
Expand All @@ -213,12 +213,12 @@ public function registerFromRequest(): array
throw new LogicException('Missing license registration parameters "email" or "orderId"');
}

$this->register($email, $orderId);
$this->activate($email, $orderId);

return [
'code' => 200,
'status' => 'ok',
'message' => 'License key registered successfully'
'message' => 'License key successfully activated'
];
}

Expand Down

0 comments on commit 9ae7ce9

Please sign in to comment.