@translationstudio/translationstudio-strapi-extension 1.0.3 → 1.0.4
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/server/index.js +11 -11
- package/dist/server/index.mjs +11 -11
- package/package.json +1 -1
package/dist/server/index.js
CHANGED
|
@@ -19,7 +19,7 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
19
19
|
ctx.body = { error: "Missing authorization header" };
|
|
20
20
|
return false;
|
|
21
21
|
}
|
|
22
|
-
const storedToken = await strapi2.plugin("translationstudio").service("service").getToken();
|
|
22
|
+
const storedToken = await strapi2.plugin("translationstudio-strapi-extension").service("service").getToken();
|
|
23
23
|
if (!storedToken?.token || authHeader !== storedToken.token) {
|
|
24
24
|
ctx.status = 401;
|
|
25
25
|
ctx.body = { error: "Invalid token" };
|
|
@@ -28,7 +28,7 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
28
28
|
return true;
|
|
29
29
|
},
|
|
30
30
|
async getLicense(ctx) {
|
|
31
|
-
const result = await strapi2.plugin("translationstudio").service("service").getLicense();
|
|
31
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").getLicense();
|
|
32
32
|
if (result.license) {
|
|
33
33
|
ctx.status = 200;
|
|
34
34
|
} else {
|
|
@@ -38,7 +38,7 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
38
38
|
},
|
|
39
39
|
async setLicense(ctx) {
|
|
40
40
|
const license = ctx.request.body.license;
|
|
41
|
-
const result = await strapi2.plugin("translationstudio").service("service").setLicense(license);
|
|
41
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").setLicense(license);
|
|
42
42
|
if (result.success) {
|
|
43
43
|
ctx.status = 200;
|
|
44
44
|
} else {
|
|
@@ -47,7 +47,7 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
47
47
|
ctx.body = result;
|
|
48
48
|
},
|
|
49
49
|
async getToken(ctx) {
|
|
50
|
-
const result = await strapi2.plugin("translationstudio").service("service").getToken();
|
|
50
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").getToken();
|
|
51
51
|
if (result.token) {
|
|
52
52
|
ctx.status = 200;
|
|
53
53
|
} else {
|
|
@@ -56,12 +56,12 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
56
56
|
ctx.body = result;
|
|
57
57
|
},
|
|
58
58
|
async generateToken(ctx) {
|
|
59
|
-
const result = await strapi2.plugin("translationstudio").service("service").generateToken();
|
|
59
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").generateToken();
|
|
60
60
|
ctx.status = 200;
|
|
61
61
|
ctx.body = result;
|
|
62
62
|
},
|
|
63
63
|
async getLanguageOptions(ctx) {
|
|
64
|
-
const result = await strapi2.plugin("translationstudio").service("service").getLanguageOptions();
|
|
64
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").getLanguageOptions();
|
|
65
65
|
ctx.status = 200;
|
|
66
66
|
ctx.body = result;
|
|
67
67
|
},
|
|
@@ -76,7 +76,7 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
76
76
|
return;
|
|
77
77
|
}
|
|
78
78
|
const payload = JSON.parse(ctx.request.body);
|
|
79
|
-
const result = await strapi2.plugin("translationstudio").service("service").exportData(payload);
|
|
79
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").exportData(payload);
|
|
80
80
|
ctx.status = 200;
|
|
81
81
|
ctx.body = [{ fields: result }];
|
|
82
82
|
},
|
|
@@ -86,11 +86,11 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
86
86
|
return;
|
|
87
87
|
}
|
|
88
88
|
const payload = JSON.parse(ctx.request.body);
|
|
89
|
-
const result = await strapi2.plugin("translationstudio").service("service").importData(payload);
|
|
89
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").importData(payload);
|
|
90
90
|
ctx.body = result;
|
|
91
91
|
},
|
|
92
92
|
async ping(ctx) {
|
|
93
|
-
const result = await strapi2.plugin("translationstudio").service("service").ping();
|
|
93
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").ping();
|
|
94
94
|
ctx.status = 204;
|
|
95
95
|
ctx.body = result;
|
|
96
96
|
},
|
|
@@ -99,12 +99,12 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
99
99
|
ctx.status = 400;
|
|
100
100
|
return;
|
|
101
101
|
}
|
|
102
|
-
const result = await strapi2.plugin("translationstudio").service("service").getLanguages();
|
|
102
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").getLanguages();
|
|
103
103
|
ctx.status = 200;
|
|
104
104
|
ctx.body = result;
|
|
105
105
|
},
|
|
106
106
|
async getEmail(ctx) {
|
|
107
|
-
const result = await strapi2.plugin("translationstudio").service("service").getEmail(ctx);
|
|
107
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").getEmail(ctx);
|
|
108
108
|
ctx.body = result;
|
|
109
109
|
},
|
|
110
110
|
async getEntryData(ctx) {
|
package/dist/server/index.mjs
CHANGED
|
@@ -18,7 +18,7 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
18
18
|
ctx.body = { error: "Missing authorization header" };
|
|
19
19
|
return false;
|
|
20
20
|
}
|
|
21
|
-
const storedToken = await strapi2.plugin("translationstudio").service("service").getToken();
|
|
21
|
+
const storedToken = await strapi2.plugin("translationstudio-strapi-extension").service("service").getToken();
|
|
22
22
|
if (!storedToken?.token || authHeader !== storedToken.token) {
|
|
23
23
|
ctx.status = 401;
|
|
24
24
|
ctx.body = { error: "Invalid token" };
|
|
@@ -27,7 +27,7 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
27
27
|
return true;
|
|
28
28
|
},
|
|
29
29
|
async getLicense(ctx) {
|
|
30
|
-
const result = await strapi2.plugin("translationstudio").service("service").getLicense();
|
|
30
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").getLicense();
|
|
31
31
|
if (result.license) {
|
|
32
32
|
ctx.status = 200;
|
|
33
33
|
} else {
|
|
@@ -37,7 +37,7 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
37
37
|
},
|
|
38
38
|
async setLicense(ctx) {
|
|
39
39
|
const license = ctx.request.body.license;
|
|
40
|
-
const result = await strapi2.plugin("translationstudio").service("service").setLicense(license);
|
|
40
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").setLicense(license);
|
|
41
41
|
if (result.success) {
|
|
42
42
|
ctx.status = 200;
|
|
43
43
|
} else {
|
|
@@ -46,7 +46,7 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
46
46
|
ctx.body = result;
|
|
47
47
|
},
|
|
48
48
|
async getToken(ctx) {
|
|
49
|
-
const result = await strapi2.plugin("translationstudio").service("service").getToken();
|
|
49
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").getToken();
|
|
50
50
|
if (result.token) {
|
|
51
51
|
ctx.status = 200;
|
|
52
52
|
} else {
|
|
@@ -55,12 +55,12 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
55
55
|
ctx.body = result;
|
|
56
56
|
},
|
|
57
57
|
async generateToken(ctx) {
|
|
58
|
-
const result = await strapi2.plugin("translationstudio").service("service").generateToken();
|
|
58
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").generateToken();
|
|
59
59
|
ctx.status = 200;
|
|
60
60
|
ctx.body = result;
|
|
61
61
|
},
|
|
62
62
|
async getLanguageOptions(ctx) {
|
|
63
|
-
const result = await strapi2.plugin("translationstudio").service("service").getLanguageOptions();
|
|
63
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").getLanguageOptions();
|
|
64
64
|
ctx.status = 200;
|
|
65
65
|
ctx.body = result;
|
|
66
66
|
},
|
|
@@ -75,7 +75,7 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
75
75
|
return;
|
|
76
76
|
}
|
|
77
77
|
const payload = JSON.parse(ctx.request.body);
|
|
78
|
-
const result = await strapi2.plugin("translationstudio").service("service").exportData(payload);
|
|
78
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").exportData(payload);
|
|
79
79
|
ctx.status = 200;
|
|
80
80
|
ctx.body = [{ fields: result }];
|
|
81
81
|
},
|
|
@@ -85,11 +85,11 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
85
85
|
return;
|
|
86
86
|
}
|
|
87
87
|
const payload = JSON.parse(ctx.request.body);
|
|
88
|
-
const result = await strapi2.plugin("translationstudio").service("service").importData(payload);
|
|
88
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").importData(payload);
|
|
89
89
|
ctx.body = result;
|
|
90
90
|
},
|
|
91
91
|
async ping(ctx) {
|
|
92
|
-
const result = await strapi2.plugin("translationstudio").service("service").ping();
|
|
92
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").ping();
|
|
93
93
|
ctx.status = 204;
|
|
94
94
|
ctx.body = result;
|
|
95
95
|
},
|
|
@@ -98,12 +98,12 @@ const controller = ({ strapi: strapi2 }) => ({
|
|
|
98
98
|
ctx.status = 400;
|
|
99
99
|
return;
|
|
100
100
|
}
|
|
101
|
-
const result = await strapi2.plugin("translationstudio").service("service").getLanguages();
|
|
101
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").getLanguages();
|
|
102
102
|
ctx.status = 200;
|
|
103
103
|
ctx.body = result;
|
|
104
104
|
},
|
|
105
105
|
async getEmail(ctx) {
|
|
106
|
-
const result = await strapi2.plugin("translationstudio").service("service").getEmail(ctx);
|
|
106
|
+
const result = await strapi2.plugin("translationstudio-strapi-extension").service("service").getEmail(ctx);
|
|
107
107
|
ctx.body = result;
|
|
108
108
|
},
|
|
109
109
|
async getEntryData(ctx) {
|