@kirby-tools/licensing 0.4.2 → 0.5.0
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/dist/constants.mjs +4 -4
- package/dist/license.mjs +5 -5
- package/package.json +4 -4
package/dist/constants.mjs
CHANGED
|
@@ -7,7 +7,7 @@ export const TRANSLATIONS = {
|
|
|
7
7
|
"modal.error.invalid.licenseKey": "License key invalid for this plugin",
|
|
8
8
|
"modal.error.incompatible": "License key invalid for this plugin version",
|
|
9
9
|
"modal.error.upgradeable": "License key invalid for this plugin version. Upgrade now on https://hub.kirby.tools.",
|
|
10
|
-
"modal.error.
|
|
10
|
+
"modal.error.activated": "License key already activated",
|
|
11
11
|
"activate": "Activate",
|
|
12
12
|
"activated": "Plugin activated",
|
|
13
13
|
"buy": "Buy a license",
|
|
@@ -21,7 +21,7 @@ export const TRANSLATIONS = {
|
|
|
21
21
|
"modal.error.invalid.licenseKey": "Lizenzschl\xFCssel ung\xFCltig f\xFCr dieses Plugin",
|
|
22
22
|
"modal.error.incompatible": "Lizenzschl\xFCssel ung\xFCltig f\xFCr diese Plugin-Version",
|
|
23
23
|
"modal.error.upgradeable": "Lizenzschl\xFCssel ung\xFCltig f\xFCr diese Plugin-Version. Aktualisiere jetzt auf https://hub.kirby.tools.",
|
|
24
|
-
"modal.error.
|
|
24
|
+
"modal.error.activated": "Lizenzschl\xFCssel bereits aktiviert",
|
|
25
25
|
"activate": "Aktivieren",
|
|
26
26
|
"activated": "Plugin aktiviert",
|
|
27
27
|
"buy": "Lizenz kaufen",
|
|
@@ -35,7 +35,7 @@ export const TRANSLATIONS = {
|
|
|
35
35
|
"modal.error.invalid.licenseKey": "Cl\xE9 de licence invalide pour ce plugin",
|
|
36
36
|
"modal.error.incompatible": "Cl\xE9 de licence invalide pour cette version du plugin",
|
|
37
37
|
"modal.error.upgradeable": "Cl\xE9 de licence invalide pour cette version du plugin. Mettez \xE0 niveau maintenant sur https://hub.kirby.tools.",
|
|
38
|
-
"modal.error.
|
|
38
|
+
"modal.error.activated": "Cl\xE9 de licence d\xE9j\xE0 activ\xE9e",
|
|
39
39
|
"activate": "Activer",
|
|
40
40
|
"activated": "Plugin activ\xE9",
|
|
41
41
|
"buy": "Acheter une licence",
|
|
@@ -49,7 +49,7 @@ export const TRANSLATIONS = {
|
|
|
49
49
|
"modal.error.invalid.licenseKey": "Licentiesleutel ongeldig voor dit plug-in",
|
|
50
50
|
"modal.error.incompatible": "Licentiesleutel ongeldig voor deze plug-inversie",
|
|
51
51
|
"modal.error.upgradeable": "Licentiesleutel ongeldig voor deze plug-inversie. Upgrade nu op https://hub.kirby.tools.",
|
|
52
|
-
"modal.error.
|
|
52
|
+
"modal.error.activated": "Licentiesleutel al geactiveerd",
|
|
53
53
|
"activate": "Activeren",
|
|
54
54
|
"activated": "Plugin geactiveerd",
|
|
55
55
|
"buy": "Koop een licentie",
|
package/dist/license.mjs
CHANGED
|
@@ -5,7 +5,7 @@ const ERROR_MESSAGE_TRANSLATIONS = {
|
|
|
5
5
|
"License key not valid for this plugin": "modal.error.invalid.licenseKey",
|
|
6
6
|
"License key not valid for this plugin version": "modal.error.incompatible",
|
|
7
7
|
"License key not valid for this plugin version, please upgrade your license": "modal.error.upgradeable",
|
|
8
|
-
"License key already
|
|
8
|
+
"License key already activated": "modal.error.activated"
|
|
9
9
|
};
|
|
10
10
|
export function useLicense(licenseOptions) {
|
|
11
11
|
const panel = usePanel();
|
|
@@ -45,7 +45,7 @@ export function useLicense(licenseOptions) {
|
|
|
45
45
|
resolve({ isLicenseActive });
|
|
46
46
|
},
|
|
47
47
|
submit: async (event) => {
|
|
48
|
-
isLicenseActive = await
|
|
48
|
+
isLicenseActive = await activateLicense(event, licenseOptions);
|
|
49
49
|
if (isLicenseActive) {
|
|
50
50
|
panel.dialog.close();
|
|
51
51
|
panel.notification.success(t("activated"));
|
|
@@ -70,7 +70,7 @@ export function useLicense(licenseOptions) {
|
|
|
70
70
|
openLicenseModal
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
async function
|
|
73
|
+
async function activateLicense(event, licenseOptions) {
|
|
74
74
|
const panel = usePanel();
|
|
75
75
|
const { email, orderId } = event;
|
|
76
76
|
if (!email || !orderId) {
|
|
@@ -78,12 +78,12 @@ async function registerLicense(event, licenseOptions) {
|
|
|
78
78
|
return false;
|
|
79
79
|
}
|
|
80
80
|
try {
|
|
81
|
-
const response = await panel.api.post(`${licenseOptions.apiNamespace}/
|
|
81
|
+
const response = await panel.api.post(`${licenseOptions.apiNamespace}/activate`, {
|
|
82
82
|
email,
|
|
83
83
|
orderId: Number(orderId)
|
|
84
84
|
});
|
|
85
85
|
if (response?.status !== "ok") {
|
|
86
|
-
throw new Error("Failed to
|
|
86
|
+
throw new Error("Failed to activate license key");
|
|
87
87
|
}
|
|
88
88
|
return true;
|
|
89
89
|
} catch (error) {
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kirby-tools/licensing",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.
|
|
5
|
-
"packageManager": "pnpm@9.15.
|
|
4
|
+
"version": "0.5.0",
|
|
5
|
+
"packageManager": "pnpm@9.15.1",
|
|
6
6
|
"description": "Shared tooling for Kirby Tools licensing in the Kirby Panel",
|
|
7
7
|
"author": "Johann Schopplich <hello@johannschopplich.com>",
|
|
8
8
|
"license": "AGPL-3.0-or-later",
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"vue": "^2.7.16"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@antfu/eslint-config": "^3.12.
|
|
46
|
-
"bumpp": "^9.9.
|
|
45
|
+
"@antfu/eslint-config": "^3.12.1",
|
|
46
|
+
"bumpp": "^9.9.2",
|
|
47
47
|
"eslint": "^9.17.0",
|
|
48
48
|
"kirbyuse": "^0.9.2",
|
|
49
49
|
"typescript": "^5.7.2",
|