@localazy/strapi-plugin 1.0.0-beta.0 → 1.0.0-beta.2
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/_chunks/{App-BSFfgZKU.mjs → App-1cXVSnL0.mjs} +59 -32
- package/dist/_chunks/{App-D1QaIMHX.js → App-CU_T8iLT.js} +66 -39
- package/dist/_chunks/{ContentTransferSetup-DtjcF_jM.mjs → ContentTransferSetup-D2R15gJS.mjs} +27 -8
- package/dist/_chunks/{ContentTransferSetup-DHXJIxAp.js → ContentTransferSetup-DTcnul1w.js} +27 -8
- package/dist/_chunks/{GlobalSettings-BcdibqNS.mjs → GlobalSettings-7pI5vIna.mjs} +8 -5
- package/dist/_chunks/{GlobalSettings-BON3kjHK.js → GlobalSettings-D_jeqPWF.js} +8 -5
- package/dist/_chunks/{LanguagesSelector-fyAIUp7M.mjs → LanguagesSelector-D2AP7FE0.mjs} +2 -2
- package/dist/_chunks/{LanguagesSelector-BeijBEjg.js → LanguagesSelector-DU5YJVQa.js} +2 -2
- package/dist/_chunks/{has-model-changed-BMCQX2Dd.js → has-model-changed-9PCipZvK.js} +2 -2
- package/dist/_chunks/{has-model-changed-Dvtzpc9v.mjs → has-model-changed-wAFZY5Ma.mjs} +2 -2
- package/dist/_chunks/{index-CN3Gyh5F.mjs → index-CT0CH6N8.mjs} +19 -43
- package/dist/_chunks/{index-BQw2qi2G.js → index-Ca5_8RSo.js} +18 -42
- package/dist/_chunks/{isEqual-B-YVnzrp.js → isEqual--zmPN5yr.js} +1 -1
- package/dist/_chunks/{isEqual-CEyT97-3.mjs → isEqual-DPUlu6B0.mjs} +1 -1
- package/dist/_chunks/{set-DulHAQhq.mjs → set-BkLLlpnD.mjs} +4 -1
- package/dist/_chunks/{set-DUdH3vE5.js → set-DDy9ZASU.js} +4 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/modules/@common/utils/iso-locales-utils.d.ts +3 -3
- package/dist/admin/src/modules/plugin-settings/locale/en.d.ts +3 -0
- package/dist/admin/src/modules/plugin-settings/models/admin-panel-user.d.ts +11 -0
- package/dist/admin/src/modules/plugin-settings/services/strapi-users-service.d.ts +2 -1
- package/dist/admin/src/state/localazy-identity.d.ts +2 -0
- package/dist/server/index.js +111 -34
- package/dist/server/index.mjs +111 -34
- package/dist/server/src/core/index.d.ts +3 -3
- package/dist/server/src/index.d.ts +20 -5
- package/dist/server/src/middlewares/index.d.ts +5 -1
- package/dist/server/src/middlewares/verify-webhook.d.ts +5 -0
- package/dist/server/src/routes/index.d.ts +12 -1
- package/dist/server/src/routes/localazy-public-transfer-routes.d.ts +11 -0
- package/dist/server/src/services/index.d.ts +3 -3
- package/dist/server/src/services/localazy-pubapi-service.d.ts +6 -5
- package/package.json +1 -1
- package/dist/admin/src/modules/@common/utils/is-plugin-route.d.ts +0 -2
package/dist/server/index.mjs
CHANGED
|
@@ -826,7 +826,7 @@ var merge = createAssigner(function(object, source, srcIndex) {
|
|
|
826
826
|
baseMerge(object, source, srcIndex);
|
|
827
827
|
});
|
|
828
828
|
const name = "@localazy/strapi-plugin";
|
|
829
|
-
const version$1 = "1.0.0-beta.
|
|
829
|
+
const version$1 = "1.0.0-beta.1";
|
|
830
830
|
const description = "The official Strapi Plugin by Localazy.";
|
|
831
831
|
const keywords = [
|
|
832
832
|
"strapi",
|
|
@@ -986,7 +986,7 @@ const _package$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePr
|
|
|
986
986
|
type,
|
|
987
987
|
version: version$1
|
|
988
988
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
989
|
-
const PLUGIN_NAME = name;
|
|
989
|
+
const PLUGIN_NAME = strapi$1.name;
|
|
990
990
|
const DEFAULT_MAX_POPULATE_DEPTH = 10;
|
|
991
991
|
const DEFAULT_POPULATE_DEPTH$1 = 5;
|
|
992
992
|
const getModelPopulationAttributes$2 = (model) => {
|
|
@@ -24195,13 +24195,66 @@ const controllers = {
|
|
|
24195
24195
|
PluginSettingsController,
|
|
24196
24196
|
LocalazyTransferController
|
|
24197
24197
|
};
|
|
24198
|
-
const
|
|
24198
|
+
const verifyWebhook = (config2, { strapi: strapi2 }) => {
|
|
24199
|
+
return async (ctx, next) => {
|
|
24200
|
+
try {
|
|
24201
|
+
const pluginSettingsServiceHelper = new PluginSettingsServiceHelper();
|
|
24202
|
+
await pluginSettingsServiceHelper.setup();
|
|
24203
|
+
if (!pluginSettingsServiceHelper.shouldAllowWebhookDownloadProcess()) {
|
|
24204
|
+
throw new Error("Localazy Plugin: Webhook download process is disabled; terminating execution");
|
|
24205
|
+
}
|
|
24206
|
+
const requestBody = ctx.request.body;
|
|
24207
|
+
strapi2.log.info(`Localazy Plugin: Webhook of type '${requestBody.type}' procedure started`);
|
|
24208
|
+
const LocalazyPubApiService = getLocalazyPubAPIService();
|
|
24209
|
+
const LocalazyUserService2 = getLocalazyUserService();
|
|
24210
|
+
const user = await LocalazyUserService2.getUser();
|
|
24211
|
+
const secret = await LocalazyPubApiService.getWebhooksSecret(user.project.id);
|
|
24212
|
+
const xLocalazyHmac = ctx.request.header["x-localazy-hmac"];
|
|
24213
|
+
const xLocalazyTimestamp = ctx.request.header["x-localazy-timestamp"];
|
|
24214
|
+
const THRESHOLD = 9e5;
|
|
24215
|
+
const intXLocalazyTimestamp = parseInt(xLocalazyTimestamp);
|
|
24216
|
+
if (Number.isNaN(intXLocalazyTimestamp)) {
|
|
24217
|
+
throw new Error("Localazy Plugin: Webhook request invalid timestamp provided; terminating execution");
|
|
24218
|
+
}
|
|
24219
|
+
if (intXLocalazyTimestamp * 1e3 + THRESHOLD < Date.now()) {
|
|
24220
|
+
throw new Error("Localazy Plugin: Webhook request is older than threshold; terminating execution");
|
|
24221
|
+
}
|
|
24222
|
+
const strapiHmac = require$$0$2.createHmac("sha256", secret);
|
|
24223
|
+
const signedMessage = strapiHmac.update(`${xLocalazyTimestamp}-${JSON.stringify(requestBody)}`).digest("hex");
|
|
24224
|
+
if (xLocalazyHmac !== signedMessage) {
|
|
24225
|
+
throw new Error("Localazy Plugin: Webhook verification did not pass; terminating execution");
|
|
24226
|
+
} else {
|
|
24227
|
+
strapi2.log.info("Localazy Plugin: Webhook verification passed");
|
|
24228
|
+
}
|
|
24229
|
+
if (!ctx.state.user) {
|
|
24230
|
+
const webhookAuthorId = pluginSettingsServiceHelper.getWebhookAuthorId();
|
|
24231
|
+
if (Number.isNaN(webhookAuthorId)) {
|
|
24232
|
+
throw new Error("Localazy Plugin: Webhook author is not set; terminating execution");
|
|
24233
|
+
}
|
|
24234
|
+
ctx.state.user = {
|
|
24235
|
+
id: webhookAuthorId
|
|
24236
|
+
};
|
|
24237
|
+
}
|
|
24238
|
+
await next();
|
|
24239
|
+
strapi2.log.info(`Localazy Plugin: Webhook of type '${requestBody.type}' procedure finished`);
|
|
24240
|
+
} catch (e3) {
|
|
24241
|
+
strapi2.log.warn(e3.message);
|
|
24242
|
+
ctx.body = {
|
|
24243
|
+
success: false,
|
|
24244
|
+
message: e3.message
|
|
24245
|
+
};
|
|
24246
|
+
}
|
|
24247
|
+
};
|
|
24248
|
+
};
|
|
24249
|
+
const middlewares = {
|
|
24250
|
+
verifyWebhook
|
|
24251
|
+
};
|
|
24199
24252
|
const policies = {};
|
|
24200
|
-
const ROUTE_PREFIX$
|
|
24253
|
+
const ROUTE_PREFIX$6 = "/user";
|
|
24201
24254
|
const LocalazyUserRoutes = [
|
|
24202
24255
|
{
|
|
24203
24256
|
method: "GET",
|
|
24204
|
-
path: `${ROUTE_PREFIX$
|
|
24257
|
+
path: `${ROUTE_PREFIX$6}`,
|
|
24205
24258
|
handler: "LocalazyUserController.getUser",
|
|
24206
24259
|
config: {
|
|
24207
24260
|
policies: []
|
|
@@ -24209,7 +24262,7 @@ const LocalazyUserRoutes = [
|
|
|
24209
24262
|
},
|
|
24210
24263
|
{
|
|
24211
24264
|
method: "PUT",
|
|
24212
|
-
path: `${ROUTE_PREFIX$
|
|
24265
|
+
path: `${ROUTE_PREFIX$6}`,
|
|
24213
24266
|
handler: "LocalazyUserController.updateUser",
|
|
24214
24267
|
config: {
|
|
24215
24268
|
policies: []
|
|
@@ -24217,18 +24270,18 @@ const LocalazyUserRoutes = [
|
|
|
24217
24270
|
},
|
|
24218
24271
|
{
|
|
24219
24272
|
method: "DELETE",
|
|
24220
|
-
path: `${ROUTE_PREFIX$
|
|
24273
|
+
path: `${ROUTE_PREFIX$6}`,
|
|
24221
24274
|
handler: "LocalazyUserController.deleteUser",
|
|
24222
24275
|
config: {
|
|
24223
24276
|
policies: []
|
|
24224
24277
|
}
|
|
24225
24278
|
}
|
|
24226
24279
|
];
|
|
24227
|
-
const ROUTE_PREFIX$
|
|
24280
|
+
const ROUTE_PREFIX$5 = "/auth";
|
|
24228
24281
|
const LocalazyAuthRoutes = [
|
|
24229
24282
|
{
|
|
24230
24283
|
method: "GET",
|
|
24231
|
-
path: `${ROUTE_PREFIX$
|
|
24284
|
+
path: `${ROUTE_PREFIX$5}/generate-keys`,
|
|
24232
24285
|
handler: "LocalazyAuthController.generateKeys",
|
|
24233
24286
|
config: {
|
|
24234
24287
|
policies: []
|
|
@@ -24236,18 +24289,18 @@ const LocalazyAuthRoutes = [
|
|
|
24236
24289
|
},
|
|
24237
24290
|
{
|
|
24238
24291
|
method: "GET",
|
|
24239
|
-
path: `${ROUTE_PREFIX$
|
|
24292
|
+
path: `${ROUTE_PREFIX$5}/continuous-poll`,
|
|
24240
24293
|
handler: "LocalazyAuthController.continuousPoll",
|
|
24241
24294
|
config: {
|
|
24242
24295
|
policies: []
|
|
24243
24296
|
}
|
|
24244
24297
|
}
|
|
24245
24298
|
];
|
|
24246
|
-
const ROUTE_PREFIX$
|
|
24299
|
+
const ROUTE_PREFIX$4 = "/plugin-settings";
|
|
24247
24300
|
const PluginSettingsRoutes = [
|
|
24248
24301
|
{
|
|
24249
24302
|
method: "GET",
|
|
24250
|
-
path: `${ROUTE_PREFIX$
|
|
24303
|
+
path: `${ROUTE_PREFIX$4}/content-transfer-setup`,
|
|
24251
24304
|
handler: "PluginSettingsController.getContentTransferSetup",
|
|
24252
24305
|
config: {
|
|
24253
24306
|
policies: []
|
|
@@ -24255,7 +24308,7 @@ const PluginSettingsRoutes = [
|
|
|
24255
24308
|
},
|
|
24256
24309
|
{
|
|
24257
24310
|
method: "PUT",
|
|
24258
|
-
path: `${ROUTE_PREFIX$
|
|
24311
|
+
path: `${ROUTE_PREFIX$4}/content-transfer-setup`,
|
|
24259
24312
|
handler: "PluginSettingsController.updateContentTransferSetup",
|
|
24260
24313
|
config: {
|
|
24261
24314
|
policies: []
|
|
@@ -24263,7 +24316,7 @@ const PluginSettingsRoutes = [
|
|
|
24263
24316
|
},
|
|
24264
24317
|
{
|
|
24265
24318
|
method: "GET",
|
|
24266
|
-
path: `${ROUTE_PREFIX$
|
|
24319
|
+
path: `${ROUTE_PREFIX$4}/plugin-settings`,
|
|
24267
24320
|
handler: "PluginSettingsController.getPluginSettings",
|
|
24268
24321
|
config: {
|
|
24269
24322
|
policies: []
|
|
@@ -24271,18 +24324,18 @@ const PluginSettingsRoutes = [
|
|
|
24271
24324
|
},
|
|
24272
24325
|
{
|
|
24273
24326
|
method: "PUT",
|
|
24274
|
-
path: `${ROUTE_PREFIX$
|
|
24327
|
+
path: `${ROUTE_PREFIX$4}/plugin-settings`,
|
|
24275
24328
|
handler: "PluginSettingsController.updatePluginSettings",
|
|
24276
24329
|
config: {
|
|
24277
24330
|
policies: []
|
|
24278
24331
|
}
|
|
24279
24332
|
}
|
|
24280
24333
|
];
|
|
24281
|
-
const ROUTE_PREFIX$
|
|
24334
|
+
const ROUTE_PREFIX$3 = "/strapi";
|
|
24282
24335
|
const StrapiRoutes = [
|
|
24283
24336
|
{
|
|
24284
24337
|
method: "GET",
|
|
24285
|
-
path: `${ROUTE_PREFIX$
|
|
24338
|
+
path: `${ROUTE_PREFIX$3}/models`,
|
|
24286
24339
|
handler: "StrapiController.getModels",
|
|
24287
24340
|
config: {
|
|
24288
24341
|
policies: []
|
|
@@ -24290,7 +24343,7 @@ const StrapiRoutes = [
|
|
|
24290
24343
|
},
|
|
24291
24344
|
{
|
|
24292
24345
|
method: "GET",
|
|
24293
|
-
path: `${ROUTE_PREFIX$
|
|
24346
|
+
path: `${ROUTE_PREFIX$3}/localizable-models`,
|
|
24294
24347
|
handler: "StrapiController.getLocalizableModels",
|
|
24295
24348
|
config: {
|
|
24296
24349
|
policies: []
|
|
@@ -24298,7 +24351,7 @@ const StrapiRoutes = [
|
|
|
24298
24351
|
},
|
|
24299
24352
|
{
|
|
24300
24353
|
method: "POST",
|
|
24301
|
-
path: `${ROUTE_PREFIX$
|
|
24354
|
+
path: `${ROUTE_PREFIX$3}/lifecycle/localazy-webhooks`,
|
|
24302
24355
|
handler: "StrapiController.postLifecycleLocalazyWebhooks",
|
|
24303
24356
|
config: {
|
|
24304
24357
|
policies: []
|
|
@@ -24306,18 +24359,18 @@ const StrapiRoutes = [
|
|
|
24306
24359
|
},
|
|
24307
24360
|
{
|
|
24308
24361
|
method: "GET",
|
|
24309
|
-
path: `${ROUTE_PREFIX$
|
|
24362
|
+
path: `${ROUTE_PREFIX$3}/version`,
|
|
24310
24363
|
handler: "StrapiController.getPluginVersion",
|
|
24311
24364
|
config: {
|
|
24312
24365
|
policies: []
|
|
24313
24366
|
}
|
|
24314
24367
|
}
|
|
24315
24368
|
];
|
|
24316
|
-
const ROUTE_PREFIX$
|
|
24369
|
+
const ROUTE_PREFIX$2 = "/transfer";
|
|
24317
24370
|
const LocalazyTransferRoutes = [
|
|
24318
24371
|
{
|
|
24319
24372
|
method: "POST",
|
|
24320
|
-
path: `${ROUTE_PREFIX$
|
|
24373
|
+
path: `${ROUTE_PREFIX$2}/upload`,
|
|
24321
24374
|
handler: "LocalazyTransferController.upload",
|
|
24322
24375
|
config: {
|
|
24323
24376
|
policies: []
|
|
@@ -24325,27 +24378,40 @@ const LocalazyTransferRoutes = [
|
|
|
24325
24378
|
},
|
|
24326
24379
|
{
|
|
24327
24380
|
method: "POST",
|
|
24328
|
-
path: `${ROUTE_PREFIX$
|
|
24381
|
+
path: `${ROUTE_PREFIX$2}/download`,
|
|
24329
24382
|
handler: "LocalazyTransferController.download",
|
|
24330
24383
|
config: {
|
|
24331
24384
|
policies: []
|
|
24332
24385
|
}
|
|
24333
24386
|
}
|
|
24334
24387
|
];
|
|
24335
|
-
const ROUTE_PREFIX = "/project";
|
|
24388
|
+
const ROUTE_PREFIX$1 = "/project";
|
|
24336
24389
|
const LocalazyProjectRoutes = [
|
|
24337
24390
|
{
|
|
24338
24391
|
method: "GET",
|
|
24339
|
-
path: `${ROUTE_PREFIX}`,
|
|
24392
|
+
path: `${ROUTE_PREFIX$1}`,
|
|
24340
24393
|
handler: "LocalazyProjectController.getConnectedProject",
|
|
24341
24394
|
config: {
|
|
24342
24395
|
policies: []
|
|
24343
24396
|
}
|
|
24344
24397
|
}
|
|
24345
24398
|
];
|
|
24399
|
+
const ROUTE_PREFIX = "/public/transfer";
|
|
24400
|
+
const LocalazyPublicTransferRoutes = [
|
|
24401
|
+
{
|
|
24402
|
+
method: "POST",
|
|
24403
|
+
path: `${ROUTE_PREFIX}/download`,
|
|
24404
|
+
handler: "LocalazyTransferController.download",
|
|
24405
|
+
config: {
|
|
24406
|
+
policies: [],
|
|
24407
|
+
auth: false,
|
|
24408
|
+
// make the route public
|
|
24409
|
+
middlewares: [`plugin::${PLUGIN_NAME}.verifyWebhook`]
|
|
24410
|
+
}
|
|
24411
|
+
}
|
|
24412
|
+
];
|
|
24346
24413
|
const routes = {
|
|
24347
24414
|
"content-api": {
|
|
24348
|
-
type: "content-api",
|
|
24349
24415
|
routes: [...StrapiRoutes]
|
|
24350
24416
|
},
|
|
24351
24417
|
admin: {
|
|
@@ -24358,8 +24424,10 @@ const routes = {
|
|
|
24358
24424
|
...LocalazyTransferRoutes,
|
|
24359
24425
|
...LocalazyProjectRoutes
|
|
24360
24426
|
]
|
|
24427
|
+
},
|
|
24428
|
+
LocalazyPublicTransferRoutes: {
|
|
24429
|
+
routes: [...LocalazyPublicTransferRoutes]
|
|
24361
24430
|
}
|
|
24362
|
-
// localazyPublicTransferRoutes,
|
|
24363
24431
|
};
|
|
24364
24432
|
const KEY$2 = "identity";
|
|
24365
24433
|
const emptyIdentity = {
|
|
@@ -24499,13 +24567,23 @@ const LocalazyPubAPIService = ({ strapi: strapi2 }) => ({
|
|
|
24499
24567
|
}
|
|
24500
24568
|
},
|
|
24501
24569
|
async getProject(projectId, addOrganization = true, addLanguages = true) {
|
|
24502
|
-
|
|
24503
|
-
|
|
24570
|
+
try {
|
|
24571
|
+
const projects = await this.listProjects(addOrganization, addLanguages);
|
|
24572
|
+
return projects.find((project) => project.id === projectId) || null;
|
|
24573
|
+
} catch (e3) {
|
|
24574
|
+
strapi2.log.error(e3);
|
|
24575
|
+
return null;
|
|
24576
|
+
}
|
|
24504
24577
|
},
|
|
24505
24578
|
async getWebhooksSecret(projectId) {
|
|
24506
|
-
|
|
24507
|
-
|
|
24508
|
-
|
|
24579
|
+
try {
|
|
24580
|
+
const LocalazyApi = await LocalazyApiClientFactory();
|
|
24581
|
+
const result = await LocalazyApi.webhooks.getSecret({ project: projectId });
|
|
24582
|
+
return result;
|
|
24583
|
+
} catch (e3) {
|
|
24584
|
+
strapi2.log.error(e3);
|
|
24585
|
+
return null;
|
|
24586
|
+
}
|
|
24509
24587
|
}
|
|
24510
24588
|
});
|
|
24511
24589
|
const KEY$1 = "content-transfer-setup";
|
|
@@ -25951,11 +26029,10 @@ const StrapiLocalazyI18nService = ({ strapi: strapi2 }) => ({
|
|
|
25951
26029
|
uid,
|
|
25952
26030
|
isoStrapi
|
|
25953
26031
|
);
|
|
25954
|
-
const filteredUpdateEntry = dropPropertyDeep(updateEntry, "documentId");
|
|
25955
26032
|
const updatedEntry = await StrapiI18nService2.updateLocalizationForAnExistingEntry(
|
|
25956
26033
|
uid,
|
|
25957
26034
|
localizedDocumentId,
|
|
25958
|
-
|
|
26035
|
+
updateEntry,
|
|
25959
26036
|
isoStrapi
|
|
25960
26037
|
);
|
|
25961
26038
|
return updatedEntry;
|
|
@@ -4,11 +4,11 @@ export declare const getLocalazyUserService: () => {
|
|
|
4
4
|
deleteUser(): Promise<import("../db/model/localazy-user").Identity>;
|
|
5
5
|
};
|
|
6
6
|
export declare const getLocalazyPubAPIService: () => {
|
|
7
|
-
listFiles(projectId:
|
|
8
|
-
getStrapiFile(projectId:
|
|
7
|
+
listFiles(projectId: string): Promise<import("@localazy/api-client").File[]>;
|
|
8
|
+
getStrapiFile(projectId: string): Promise<import("@localazy/api-client").File>;
|
|
9
9
|
listProjects(addOrganization?: boolean, addLanguages?: boolean): Promise<import("@localazy/api-client").Project[]>;
|
|
10
10
|
getProject(projectId: string, addOrganization?: boolean, addLanguages?: boolean): Promise<import("@localazy/api-client").Project>;
|
|
11
|
-
getWebhooksSecret(projectId:
|
|
11
|
+
getWebhooksSecret(projectId: string): Promise<string>;
|
|
12
12
|
};
|
|
13
13
|
export declare const getLocalazyTransferUploadService: () => {
|
|
14
14
|
upload({ notificationService }: {
|
|
@@ -69,7 +69,6 @@ declare const _default: {
|
|
|
69
69
|
};
|
|
70
70
|
routes: {
|
|
71
71
|
'content-api': {
|
|
72
|
-
type: string;
|
|
73
72
|
routes: {
|
|
74
73
|
method: string;
|
|
75
74
|
path: string;
|
|
@@ -90,6 +89,18 @@ declare const _default: {
|
|
|
90
89
|
};
|
|
91
90
|
}[];
|
|
92
91
|
};
|
|
92
|
+
LocalazyPublicTransferRoutes: {
|
|
93
|
+
routes: {
|
|
94
|
+
method: string;
|
|
95
|
+
path: string;
|
|
96
|
+
handler: string;
|
|
97
|
+
config: {
|
|
98
|
+
policies: any[];
|
|
99
|
+
auth: boolean;
|
|
100
|
+
middlewares: string[];
|
|
101
|
+
};
|
|
102
|
+
}[];
|
|
103
|
+
};
|
|
93
104
|
};
|
|
94
105
|
services: {
|
|
95
106
|
LocalazyUserService: ({ strapi }: {
|
|
@@ -109,11 +120,11 @@ declare const _default: {
|
|
|
109
120
|
LocalazyPubAPIService: ({ strapi }: {
|
|
110
121
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
111
122
|
}) => {
|
|
112
|
-
listFiles(projectId:
|
|
113
|
-
getStrapiFile(projectId:
|
|
123
|
+
listFiles(projectId: string): Promise<import("@localazy/api-client").File[]>;
|
|
124
|
+
getStrapiFile(projectId: string): Promise<import("@localazy/api-client").File>;
|
|
114
125
|
listProjects(addOrganization?: boolean, addLanguages?: boolean): Promise<import("@localazy/api-client").Project[]>;
|
|
115
126
|
getProject(projectId: string, addOrganization?: boolean, addLanguages?: boolean): Promise<import("@localazy/api-client").Project>;
|
|
116
|
-
getWebhooksSecret(projectId:
|
|
127
|
+
getWebhooksSecret(projectId: string): Promise<string>;
|
|
117
128
|
};
|
|
118
129
|
PluginSettingsService: ({ strapi }: {
|
|
119
130
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
@@ -184,6 +195,10 @@ declare const _default: {
|
|
|
184
195
|
};
|
|
185
196
|
contentTypes: {};
|
|
186
197
|
policies: {};
|
|
187
|
-
middlewares: {
|
|
198
|
+
middlewares: {
|
|
199
|
+
verifyWebhook: (config: any, { strapi }: {
|
|
200
|
+
strapi: import("@strapi/types/dist/core").Strapi;
|
|
201
|
+
}) => (ctx: any, next: any) => Promise<void>;
|
|
202
|
+
};
|
|
188
203
|
};
|
|
189
204
|
export default _default;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
'content-api': {
|
|
3
|
-
type: string;
|
|
4
3
|
routes: {
|
|
5
4
|
method: string;
|
|
6
5
|
path: string;
|
|
@@ -21,5 +20,17 @@ declare const _default: {
|
|
|
21
20
|
};
|
|
22
21
|
}[];
|
|
23
22
|
};
|
|
23
|
+
LocalazyPublicTransferRoutes: {
|
|
24
|
+
routes: {
|
|
25
|
+
method: string;
|
|
26
|
+
path: string;
|
|
27
|
+
handler: string;
|
|
28
|
+
config: {
|
|
29
|
+
policies: any[];
|
|
30
|
+
auth: boolean;
|
|
31
|
+
middlewares: string[];
|
|
32
|
+
};
|
|
33
|
+
}[];
|
|
34
|
+
};
|
|
24
35
|
};
|
|
25
36
|
export default _default;
|
|
@@ -16,11 +16,11 @@ declare const _default: {
|
|
|
16
16
|
LocalazyPubAPIService: ({ strapi }: {
|
|
17
17
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
18
18
|
}) => {
|
|
19
|
-
listFiles(projectId:
|
|
20
|
-
getStrapiFile(projectId:
|
|
19
|
+
listFiles(projectId: string): Promise<import("@localazy/api-client").File[]>;
|
|
20
|
+
getStrapiFile(projectId: string): Promise<import("@localazy/api-client").File>;
|
|
21
21
|
listProjects(addOrganization?: boolean, addLanguages?: boolean): Promise<import("@localazy/api-client").Project[]>;
|
|
22
22
|
getProject(projectId: string, addOrganization?: boolean, addLanguages?: boolean): Promise<import("@localazy/api-client").Project>;
|
|
23
|
-
getWebhooksSecret(projectId:
|
|
23
|
+
getWebhooksSecret(projectId: string): Promise<string>;
|
|
24
24
|
};
|
|
25
25
|
PluginSettingsService: ({ strapi }: {
|
|
26
26
|
strapi: import("@strapi/types/dist/core").Strapi;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { Core } from '@strapi/strapi';
|
|
2
|
+
import { Project } from '@localazy/api-client';
|
|
2
3
|
declare const LocalazyPubAPIService: ({ strapi }: {
|
|
3
4
|
strapi: Core.Strapi;
|
|
4
5
|
}) => {
|
|
5
|
-
listFiles(projectId:
|
|
6
|
-
getStrapiFile(projectId:
|
|
7
|
-
listProjects(addOrganization?: boolean, addLanguages?: boolean): Promise<
|
|
8
|
-
getProject(projectId: string, addOrganization?: boolean, addLanguages?: boolean): Promise<
|
|
9
|
-
getWebhooksSecret(projectId:
|
|
6
|
+
listFiles(projectId: string): Promise<import("@localazy/api-client").File[]>;
|
|
7
|
+
getStrapiFile(projectId: string): Promise<import("@localazy/api-client").File>;
|
|
8
|
+
listProjects(addOrganization?: boolean, addLanguages?: boolean): Promise<Project[]>;
|
|
9
|
+
getProject(projectId: string, addOrganization?: boolean, addLanguages?: boolean): Promise<Project | null>;
|
|
10
|
+
getWebhooksSecret(projectId: string): Promise<string>;
|
|
10
11
|
};
|
|
11
12
|
export type LocalazyPubAPIServiceReturnType = ReturnType<typeof LocalazyPubAPIService>;
|
|
12
13
|
export default LocalazyPubAPIService;
|
package/package.json
CHANGED