strapi-plugin-meilisearch 0.13.0 → 0.13.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/LICENSE +1 -1
- package/README.md +16 -24
- package/dist/_chunks/App-4wYXCpIt.js +1003 -0
- package/dist/_chunks/App-C_AT8Sze.mjs +986 -0
- package/dist/_chunks/en-CByedxRT.js +38 -0
- package/dist/_chunks/en-D4dIehJl.mjs +38 -0
- package/dist/_chunks/es-B-4TrEJr.mjs +38 -0
- package/dist/_chunks/es-DA_jpbS7.js +38 -0
- package/dist/_chunks/index-CnETd4ds.mjs +242 -0
- package/dist/_chunks/index-OgM-GMGo.js +241 -0
- package/dist/admin/index.js +3 -0
- package/dist/admin/index.mjs +4 -0
- package/dist/server/index.js +2005 -0
- package/dist/server/index.mjs +2006 -0
- package/package.json +16 -16
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const en = {
|
|
4
|
+
"plugin.name": "Meilisearch",
|
|
5
|
+
"plugin.description": "Search in your content-types with the Meilisearch plugin",
|
|
6
|
+
"plugin.go-back": "Go back",
|
|
7
|
+
"plugin.table.header.name": "NAME",
|
|
8
|
+
"plugin.table.header.in-meilisearch": "IN MEILISEARCH ?",
|
|
9
|
+
"plugin.table.header.indexing": "INDEXING ?",
|
|
10
|
+
"plugin.table.header.index-name": "INDEX NAME",
|
|
11
|
+
"plugin.table.header.documents": "DOCUMENTS",
|
|
12
|
+
"plugin.table.header.hooks": "HOOKS",
|
|
13
|
+
"plugin.table.td.yes": "Yes",
|
|
14
|
+
"plugin.table.td.no": "No",
|
|
15
|
+
"plugin.table.td.hookingText.reload": "Reload needed",
|
|
16
|
+
"plugin.table.td.hookingText.hooked": "Hooked",
|
|
17
|
+
"plugin.update": "Update",
|
|
18
|
+
"plugin.save": "Save",
|
|
19
|
+
"plugin.reload-server": "Reload server",
|
|
20
|
+
"plugin.tab.collections": "Collections",
|
|
21
|
+
"plugin.tab.settings": "Settings",
|
|
22
|
+
"plugin.tab.settings.input.url.placeholder": "URL",
|
|
23
|
+
"plugin.tab.settings.input.url.label": "Meilisearch URL",
|
|
24
|
+
"plugin.tab.settings.input.url.hint": "The URL on which your Meilisearch is running",
|
|
25
|
+
"plugin.tab.settings.input.apiKey.placeholder": "API key",
|
|
26
|
+
"plugin.tab.settings.input.apiKey.label": "Meilisearch API Key",
|
|
27
|
+
"plugin.tab.settings.input.apiKey.hint": "A valid API key with enough permission to create indexes (or the master key).",
|
|
28
|
+
"plugin.tab.settings.warning.credentials.1": "Do not use this API key on your front-end as it has too much rights. Instead, use the public key available using",
|
|
29
|
+
"plugin.tab.settings.warning.credentials.2": "the key route",
|
|
30
|
+
"plugin.message.success.delete": "Request to delete content-type is successful",
|
|
31
|
+
"plugin.message.success.add": "Request to add a content-type is successful",
|
|
32
|
+
"plugin.message.success.update": "Request to update content-type is successful",
|
|
33
|
+
"plugin.message.success.credentials": "Credentials successfully updated!",
|
|
34
|
+
"plugin.message.something": "Something occurred in Meilisearch",
|
|
35
|
+
"plugin.message.forbidden.title": "Forbidden",
|
|
36
|
+
"plugin.message.forbidden.description": "You do not have permission to do this action"
|
|
37
|
+
};
|
|
38
|
+
exports.default = en;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const en = {
|
|
2
|
+
"plugin.name": "Meilisearch",
|
|
3
|
+
"plugin.description": "Search in your content-types with the Meilisearch plugin",
|
|
4
|
+
"plugin.go-back": "Go back",
|
|
5
|
+
"plugin.table.header.name": "NAME",
|
|
6
|
+
"plugin.table.header.in-meilisearch": "IN MEILISEARCH ?",
|
|
7
|
+
"plugin.table.header.indexing": "INDEXING ?",
|
|
8
|
+
"plugin.table.header.index-name": "INDEX NAME",
|
|
9
|
+
"plugin.table.header.documents": "DOCUMENTS",
|
|
10
|
+
"plugin.table.header.hooks": "HOOKS",
|
|
11
|
+
"plugin.table.td.yes": "Yes",
|
|
12
|
+
"plugin.table.td.no": "No",
|
|
13
|
+
"plugin.table.td.hookingText.reload": "Reload needed",
|
|
14
|
+
"plugin.table.td.hookingText.hooked": "Hooked",
|
|
15
|
+
"plugin.update": "Update",
|
|
16
|
+
"plugin.save": "Save",
|
|
17
|
+
"plugin.reload-server": "Reload server",
|
|
18
|
+
"plugin.tab.collections": "Collections",
|
|
19
|
+
"plugin.tab.settings": "Settings",
|
|
20
|
+
"plugin.tab.settings.input.url.placeholder": "URL",
|
|
21
|
+
"plugin.tab.settings.input.url.label": "Meilisearch URL",
|
|
22
|
+
"plugin.tab.settings.input.url.hint": "The URL on which your Meilisearch is running",
|
|
23
|
+
"plugin.tab.settings.input.apiKey.placeholder": "API key",
|
|
24
|
+
"plugin.tab.settings.input.apiKey.label": "Meilisearch API Key",
|
|
25
|
+
"plugin.tab.settings.input.apiKey.hint": "A valid API key with enough permission to create indexes (or the master key).",
|
|
26
|
+
"plugin.tab.settings.warning.credentials.1": "Do not use this API key on your front-end as it has too much rights. Instead, use the public key available using",
|
|
27
|
+
"plugin.tab.settings.warning.credentials.2": "the key route",
|
|
28
|
+
"plugin.message.success.delete": "Request to delete content-type is successful",
|
|
29
|
+
"plugin.message.success.add": "Request to add a content-type is successful",
|
|
30
|
+
"plugin.message.success.update": "Request to update content-type is successful",
|
|
31
|
+
"plugin.message.success.credentials": "Credentials successfully updated!",
|
|
32
|
+
"plugin.message.something": "Something occurred in Meilisearch",
|
|
33
|
+
"plugin.message.forbidden.title": "Forbidden",
|
|
34
|
+
"plugin.message.forbidden.description": "You do not have permission to do this action"
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
en as default
|
|
38
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
const es = {
|
|
2
|
+
"plugin.name": "Meilisearch",
|
|
3
|
+
"plugin.description": "Busque en su contenido con el plugin de Meilisearch",
|
|
4
|
+
"plugin.go-back": "Volver",
|
|
5
|
+
"plugin.table.header.name": "NOMBRE",
|
|
6
|
+
"plugin.table.header.in-meilisearch": "¿EN MEILISEARCH?",
|
|
7
|
+
"plugin.table.header.indexing": "¿INDEXACIÓN?",
|
|
8
|
+
"plugin.table.header.index-name": "NOMBRE DEL ÍNDICE",
|
|
9
|
+
"plugin.table.header.documents": "DOCUMENTOS",
|
|
10
|
+
"plugin.table.header.hooks": "CONECTADOS",
|
|
11
|
+
"plugin.table.td.yes": "Sí",
|
|
12
|
+
"plugin.table.td.no": "No",
|
|
13
|
+
"plugin.table.td.hookingText.reload": "Es necesario recargar",
|
|
14
|
+
"plugin.table.td.hookingText.hooked": "Conectado",
|
|
15
|
+
"plugin.update": "Actualizar",
|
|
16
|
+
"plugin.save": "Guardar",
|
|
17
|
+
"plugin.reload-server": "Recargar el servidor",
|
|
18
|
+
"plugin.tab.collections": "Colecciones",
|
|
19
|
+
"plugin.tab.settings": "Configuraciones",
|
|
20
|
+
"plugin.tab.settings.input.url.placeholder": "URL",
|
|
21
|
+
"plugin.tab.settings.input.url.label": "URL del Meilisearch",
|
|
22
|
+
"plugin.tab.settings.input.url.hint": "La URL donde se ejecuta su Meilisearch",
|
|
23
|
+
"plugin.tab.settings.input.apiKey.placeholder": "Clave API",
|
|
24
|
+
"plugin.tab.settings.input.apiKey.label": "Clave API de Meilisearch",
|
|
25
|
+
"plugin.tab.settings.input.apiKey.hint": "Una clave API válida con permiso suficiente para crear índices (o la clave maestra).",
|
|
26
|
+
"plugin.tab.settings.warning.credentials.1": "No utilices esta clave API en el front-end ya que tiene demasiados privilegios. En su lugar, utilice la clave pública disponible mediante",
|
|
27
|
+
"plugin.tab.settings.warning.credentials.2": "la ruta /keys",
|
|
28
|
+
"plugin.message.success.delete": "La solicitud de eliminación del contenido se ha realizado correctamente",
|
|
29
|
+
"plugin.message.success.add": "La solicitud para añadir un contenido se ha realizado correctamente",
|
|
30
|
+
"plugin.message.success.update": "La solicitud de actualización del contenido se ha realizado correctamente",
|
|
31
|
+
"plugin.message.success.credentials": "¡Credenciales actualizadas con éxito!",
|
|
32
|
+
"plugin.message.something": "Algo ha ocurrido en Meilisearch",
|
|
33
|
+
"plugin.message.forbidden.title": "Prohibido",
|
|
34
|
+
"plugin.message.forbidden.description": "No tiene permiso para realizar esta acción"
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
es as default
|
|
38
|
+
};
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const es = {
|
|
4
|
+
"plugin.name": "Meilisearch",
|
|
5
|
+
"plugin.description": "Busque en su contenido con el plugin de Meilisearch",
|
|
6
|
+
"plugin.go-back": "Volver",
|
|
7
|
+
"plugin.table.header.name": "NOMBRE",
|
|
8
|
+
"plugin.table.header.in-meilisearch": "¿EN MEILISEARCH?",
|
|
9
|
+
"plugin.table.header.indexing": "¿INDEXACIÓN?",
|
|
10
|
+
"plugin.table.header.index-name": "NOMBRE DEL ÍNDICE",
|
|
11
|
+
"plugin.table.header.documents": "DOCUMENTOS",
|
|
12
|
+
"plugin.table.header.hooks": "CONECTADOS",
|
|
13
|
+
"plugin.table.td.yes": "Sí",
|
|
14
|
+
"plugin.table.td.no": "No",
|
|
15
|
+
"plugin.table.td.hookingText.reload": "Es necesario recargar",
|
|
16
|
+
"plugin.table.td.hookingText.hooked": "Conectado",
|
|
17
|
+
"plugin.update": "Actualizar",
|
|
18
|
+
"plugin.save": "Guardar",
|
|
19
|
+
"plugin.reload-server": "Recargar el servidor",
|
|
20
|
+
"plugin.tab.collections": "Colecciones",
|
|
21
|
+
"plugin.tab.settings": "Configuraciones",
|
|
22
|
+
"plugin.tab.settings.input.url.placeholder": "URL",
|
|
23
|
+
"plugin.tab.settings.input.url.label": "URL del Meilisearch",
|
|
24
|
+
"plugin.tab.settings.input.url.hint": "La URL donde se ejecuta su Meilisearch",
|
|
25
|
+
"plugin.tab.settings.input.apiKey.placeholder": "Clave API",
|
|
26
|
+
"plugin.tab.settings.input.apiKey.label": "Clave API de Meilisearch",
|
|
27
|
+
"plugin.tab.settings.input.apiKey.hint": "Una clave API válida con permiso suficiente para crear índices (o la clave maestra).",
|
|
28
|
+
"plugin.tab.settings.warning.credentials.1": "No utilices esta clave API en el front-end ya que tiene demasiados privilegios. En su lugar, utilice la clave pública disponible mediante",
|
|
29
|
+
"plugin.tab.settings.warning.credentials.2": "la ruta /keys",
|
|
30
|
+
"plugin.message.success.delete": "La solicitud de eliminación del contenido se ha realizado correctamente",
|
|
31
|
+
"plugin.message.success.add": "La solicitud para añadir un contenido se ha realizado correctamente",
|
|
32
|
+
"plugin.message.success.update": "La solicitud de actualización del contenido se ha realizado correctamente",
|
|
33
|
+
"plugin.message.success.credentials": "¡Credenciales actualizadas con éxito!",
|
|
34
|
+
"plugin.message.something": "Algo ha ocurrido en Meilisearch",
|
|
35
|
+
"plugin.message.forbidden.title": "Prohibido",
|
|
36
|
+
"plugin.message.forbidden.description": "No tiene permiso para realizar esta acción"
|
|
37
|
+
};
|
|
38
|
+
exports.default = es;
|
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useRef, useEffect } from "react";
|
|
3
|
+
import { Search } from "@strapi/icons";
|
|
4
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
|
5
|
+
const v = glob[path];
|
|
6
|
+
if (v) {
|
|
7
|
+
return typeof v === "function" ? v() : Promise.resolve(v);
|
|
8
|
+
}
|
|
9
|
+
return new Promise((_, reject) => {
|
|
10
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
|
11
|
+
reject.bind(
|
|
12
|
+
null,
|
|
13
|
+
new Error(
|
|
14
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
|
15
|
+
)
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
});
|
|
19
|
+
};
|
|
20
|
+
const name$1 = "strapi-plugin-meilisearch";
|
|
21
|
+
const version = "0.13.2";
|
|
22
|
+
const description = "Synchronise and search in your Strapi content-types with Meilisearch";
|
|
23
|
+
const scripts = {
|
|
24
|
+
build: "strapi-plugin build",
|
|
25
|
+
verify: "strapi-plugin verify",
|
|
26
|
+
watch: "strapi-plugin watch",
|
|
27
|
+
"watch:link": "strapi-plugin watch:link",
|
|
28
|
+
"playground:dev": "yarn --cwd ./playground && yarn --cwd ./playground dev",
|
|
29
|
+
"playground:build": "yarn --cwd ./playground && yarn --cwd ./playground build",
|
|
30
|
+
"playground:ci": "yarn --cwd ./playground ci",
|
|
31
|
+
style: "eslint --ext .js,.test.js .",
|
|
32
|
+
"style:fix": "eslint --ext .js,.test.js . --fix",
|
|
33
|
+
test: "jest --testPathPattern=tests",
|
|
34
|
+
"test:watch": "jest --watch --testPathPattern=tests --verbose",
|
|
35
|
+
"test:e2e:watch": 'concurrently --kill-others -s first "NODE_ENV=test yarn playground:dev" "cypress open --env env=watch"'
|
|
36
|
+
};
|
|
37
|
+
const strapi = {
|
|
38
|
+
name: "meilisearch",
|
|
39
|
+
icon: "search",
|
|
40
|
+
description: "Search in your content-types with the Meilisearch plugin",
|
|
41
|
+
kind: "plugin"
|
|
42
|
+
};
|
|
43
|
+
const type = "commonjs";
|
|
44
|
+
const exports = {
|
|
45
|
+
"./package.json": "./package.json",
|
|
46
|
+
"./strapi-admin": {
|
|
47
|
+
source: "./admin/src/index.js",
|
|
48
|
+
"import": "./dist/admin/index.mjs",
|
|
49
|
+
require: "./dist/admin/index.js",
|
|
50
|
+
"default": "./dist/admin/index.js"
|
|
51
|
+
},
|
|
52
|
+
"./strapi-server": {
|
|
53
|
+
source: "./server/src/index.js",
|
|
54
|
+
"import": "./dist/server/index.mjs",
|
|
55
|
+
require: "./dist/server/index.js",
|
|
56
|
+
"default": "./dist/server/index.js"
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
const files = [
|
|
60
|
+
"dist"
|
|
61
|
+
];
|
|
62
|
+
const dependencies = {
|
|
63
|
+
"@strapi/design-system": "^2.0.0-rc.14",
|
|
64
|
+
"@strapi/icons": "^2.0.0-rc.14",
|
|
65
|
+
meilisearch: "0.48.2"
|
|
66
|
+
};
|
|
67
|
+
const peerDependencies = {
|
|
68
|
+
"@strapi/sdk-plugin": "^5.2.8",
|
|
69
|
+
"@strapi/strapi": "^5.6.0",
|
|
70
|
+
react: "^18.3.1",
|
|
71
|
+
"react-dom": "^18.3.1",
|
|
72
|
+
"react-router-dom": "^6.29.0",
|
|
73
|
+
"styled-components": "^6.1.14"
|
|
74
|
+
};
|
|
75
|
+
const devDependencies = {
|
|
76
|
+
"@babel/core": "^7.26.7",
|
|
77
|
+
"@babel/preset-env": "^7.26.7",
|
|
78
|
+
"@strapi/sdk-plugin": "^5.2.8",
|
|
79
|
+
"@strapi/strapi": "^5.6.0",
|
|
80
|
+
"@types/jest": "^29.5.12",
|
|
81
|
+
"babel-jest": "^29.7.0",
|
|
82
|
+
concurrently: "^8.2.2",
|
|
83
|
+
cypress: "^14.0.1",
|
|
84
|
+
eslint: "^8.2.0",
|
|
85
|
+
"eslint-config-prettier": "^9.1.0",
|
|
86
|
+
"eslint-plugin-cypress": "^2.12.1",
|
|
87
|
+
"eslint-plugin-import": "^2.25.3",
|
|
88
|
+
"eslint-plugin-node": "^11.1.0",
|
|
89
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
90
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
91
|
+
"eslint-plugin-react": "^7.27.0",
|
|
92
|
+
jest: "^29.7.0",
|
|
93
|
+
prettier: "3.2.5",
|
|
94
|
+
react: "^18.3.1",
|
|
95
|
+
"react-dom": "^18.3.1",
|
|
96
|
+
"react-router-dom": "^6.29.0",
|
|
97
|
+
"styled-components": "^6.1.14"
|
|
98
|
+
};
|
|
99
|
+
const author = {
|
|
100
|
+
name: "Charlotte Vermandel <charlotte@meilisearch.com>"
|
|
101
|
+
};
|
|
102
|
+
const maintainers = [
|
|
103
|
+
{
|
|
104
|
+
name: "Charlotte Vermandel <charlotte@meilisearch.com>"
|
|
105
|
+
}
|
|
106
|
+
];
|
|
107
|
+
const engines = {
|
|
108
|
+
npm: ">=6.0.0",
|
|
109
|
+
node: ">=18"
|
|
110
|
+
};
|
|
111
|
+
const bugs = {
|
|
112
|
+
url: "https://github.com/meilisearch/strapi-plugin-meilisearch/issues"
|
|
113
|
+
};
|
|
114
|
+
const keywords = [
|
|
115
|
+
"strapi",
|
|
116
|
+
"plugin",
|
|
117
|
+
"meilisearch",
|
|
118
|
+
"search"
|
|
119
|
+
];
|
|
120
|
+
const license = "MIT";
|
|
121
|
+
const repository = {
|
|
122
|
+
type: "git",
|
|
123
|
+
url: "git+https://github.com/meilisearch/strapi-plugin-meilisearch.git"
|
|
124
|
+
};
|
|
125
|
+
const homepage = "https://github.com/meilisearch/strapi-plugin-meilisearch#readme";
|
|
126
|
+
const pluginPkg = {
|
|
127
|
+
name: name$1,
|
|
128
|
+
version,
|
|
129
|
+
description,
|
|
130
|
+
scripts,
|
|
131
|
+
strapi,
|
|
132
|
+
type,
|
|
133
|
+
exports,
|
|
134
|
+
files,
|
|
135
|
+
dependencies,
|
|
136
|
+
peerDependencies,
|
|
137
|
+
devDependencies,
|
|
138
|
+
author,
|
|
139
|
+
maintainers,
|
|
140
|
+
engines,
|
|
141
|
+
bugs,
|
|
142
|
+
keywords,
|
|
143
|
+
license,
|
|
144
|
+
repository,
|
|
145
|
+
homepage
|
|
146
|
+
};
|
|
147
|
+
const pluginId = name$1.replace(/^strapi-plugin-/i, "");
|
|
148
|
+
const PluginIcon = () => /* @__PURE__ */ jsx(Search, {});
|
|
149
|
+
const Initializer = ({ setPlugin }) => {
|
|
150
|
+
const ref = useRef(setPlugin);
|
|
151
|
+
useEffect(() => {
|
|
152
|
+
ref.current(pluginId);
|
|
153
|
+
}, []);
|
|
154
|
+
return null;
|
|
155
|
+
};
|
|
156
|
+
const PERMISSIONS = {
|
|
157
|
+
// This permission regards the main component (App) and is used to tell
|
|
158
|
+
// If the plugin link should be displayed in the menu
|
|
159
|
+
// And also if the plugin is accessible. This use case is found when a user types the url of the
|
|
160
|
+
// plugin directly in the browser
|
|
161
|
+
main: [
|
|
162
|
+
{ action: "plugin::meilisearch.read", subject: null },
|
|
163
|
+
{ action: "plugin::meilisearch.collections.create", subject: null },
|
|
164
|
+
{ action: "plugin::meilisearch.collections.update", subject: null },
|
|
165
|
+
{ action: "plugin::meilisearch.collections.delete", subject: null },
|
|
166
|
+
{ action: "plugin::meilisearch.settings.edit", subject: null }
|
|
167
|
+
],
|
|
168
|
+
collections: [
|
|
169
|
+
{ action: "plugin::meilisearch.read", subject: null },
|
|
170
|
+
{ action: "plugin::meilisearch.collections.create", subject: null },
|
|
171
|
+
{ action: "plugin::meilisearch.collections.update", subject: null },
|
|
172
|
+
{ action: "plugin::meilisearch.collections.delete", subject: null }
|
|
173
|
+
],
|
|
174
|
+
settings: [
|
|
175
|
+
{ action: "plugin::meilisearch.read", subject: null },
|
|
176
|
+
{ action: "plugin::meilisearch.settings.edit", subject: null }
|
|
177
|
+
],
|
|
178
|
+
read: [{ action: "plugin::meilisearch.read", subject: null }],
|
|
179
|
+
create: [{ action: "plugin::meilisearch.collections.create", subject: null }],
|
|
180
|
+
update: [{ action: "plugin::meilisearch.collections.update", subject: null }],
|
|
181
|
+
delete: [{ action: "plugin::meilisearch.collections.delete", subject: null }],
|
|
182
|
+
settingsEdit: [
|
|
183
|
+
{ action: "plugin::meilisearch.settings.edit", subject: null }
|
|
184
|
+
],
|
|
185
|
+
createAndDelete: [
|
|
186
|
+
{ action: "plugin::meilisearch.collections.create", subject: null },
|
|
187
|
+
{ action: "plugin::meilisearch.collections.delete", subject: null }
|
|
188
|
+
]
|
|
189
|
+
};
|
|
190
|
+
const getTranslation = (translations) => {
|
|
191
|
+
return Object.keys(translations).reduce((acc, current) => {
|
|
192
|
+
acc[`${pluginId}.${current}`] = translations[current];
|
|
193
|
+
return acc;
|
|
194
|
+
}, {});
|
|
195
|
+
};
|
|
196
|
+
const name = pluginPkg.strapi.name;
|
|
197
|
+
const index = {
|
|
198
|
+
register(app) {
|
|
199
|
+
app.registerPlugin({
|
|
200
|
+
id: pluginId,
|
|
201
|
+
initializer: Initializer,
|
|
202
|
+
isReady: true,
|
|
203
|
+
name
|
|
204
|
+
});
|
|
205
|
+
app.addMenuLink({
|
|
206
|
+
to: `/plugins/${pluginId}`,
|
|
207
|
+
icon: PluginIcon,
|
|
208
|
+
intlLabel: {
|
|
209
|
+
id: `${pluginId}.plugin.name`,
|
|
210
|
+
defaultMessage: name
|
|
211
|
+
},
|
|
212
|
+
Component: async () => {
|
|
213
|
+
const { App } = await import("./App-C_AT8Sze.mjs");
|
|
214
|
+
return App;
|
|
215
|
+
},
|
|
216
|
+
permissions: PERMISSIONS.main
|
|
217
|
+
});
|
|
218
|
+
},
|
|
219
|
+
async registerTrads({ locales }) {
|
|
220
|
+
const importedTranslations = await Promise.all(
|
|
221
|
+
locales.map((locale) => {
|
|
222
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => import("./en-D4dIehJl.mjs"), "./translations/es.json": () => import("./es-B-4TrEJr.mjs") }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
|
|
223
|
+
return {
|
|
224
|
+
data: getTranslation(data),
|
|
225
|
+
locale
|
|
226
|
+
};
|
|
227
|
+
}).catch(() => {
|
|
228
|
+
return {
|
|
229
|
+
data: {},
|
|
230
|
+
locale
|
|
231
|
+
};
|
|
232
|
+
});
|
|
233
|
+
})
|
|
234
|
+
);
|
|
235
|
+
return Promise.resolve(importedTranslations);
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
export {
|
|
239
|
+
PERMISSIONS as P,
|
|
240
|
+
index as i,
|
|
241
|
+
pluginId as p
|
|
242
|
+
};
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const jsxRuntime = require("react/jsx-runtime");
|
|
3
|
+
const React = require("react");
|
|
4
|
+
const icons = require("@strapi/icons");
|
|
5
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
|
6
|
+
const v = glob[path];
|
|
7
|
+
if (v) {
|
|
8
|
+
return typeof v === "function" ? v() : Promise.resolve(v);
|
|
9
|
+
}
|
|
10
|
+
return new Promise((_, reject) => {
|
|
11
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
|
12
|
+
reject.bind(
|
|
13
|
+
null,
|
|
14
|
+
new Error(
|
|
15
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
|
16
|
+
)
|
|
17
|
+
)
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
};
|
|
21
|
+
const name$1 = "strapi-plugin-meilisearch";
|
|
22
|
+
const version = "0.13.2";
|
|
23
|
+
const description = "Synchronise and search in your Strapi content-types with Meilisearch";
|
|
24
|
+
const scripts = {
|
|
25
|
+
build: "strapi-plugin build",
|
|
26
|
+
verify: "strapi-plugin verify",
|
|
27
|
+
watch: "strapi-plugin watch",
|
|
28
|
+
"watch:link": "strapi-plugin watch:link",
|
|
29
|
+
"playground:dev": "yarn --cwd ./playground && yarn --cwd ./playground dev",
|
|
30
|
+
"playground:build": "yarn --cwd ./playground && yarn --cwd ./playground build",
|
|
31
|
+
"playground:ci": "yarn --cwd ./playground ci",
|
|
32
|
+
style: "eslint --ext .js,.test.js .",
|
|
33
|
+
"style:fix": "eslint --ext .js,.test.js . --fix",
|
|
34
|
+
test: "jest --testPathPattern=tests",
|
|
35
|
+
"test:watch": "jest --watch --testPathPattern=tests --verbose",
|
|
36
|
+
"test:e2e:watch": 'concurrently --kill-others -s first "NODE_ENV=test yarn playground:dev" "cypress open --env env=watch"'
|
|
37
|
+
};
|
|
38
|
+
const strapi = {
|
|
39
|
+
name: "meilisearch",
|
|
40
|
+
icon: "search",
|
|
41
|
+
description: "Search in your content-types with the Meilisearch plugin",
|
|
42
|
+
kind: "plugin"
|
|
43
|
+
};
|
|
44
|
+
const type = "commonjs";
|
|
45
|
+
const exports$1 = {
|
|
46
|
+
"./package.json": "./package.json",
|
|
47
|
+
"./strapi-admin": {
|
|
48
|
+
source: "./admin/src/index.js",
|
|
49
|
+
"import": "./dist/admin/index.mjs",
|
|
50
|
+
require: "./dist/admin/index.js",
|
|
51
|
+
"default": "./dist/admin/index.js"
|
|
52
|
+
},
|
|
53
|
+
"./strapi-server": {
|
|
54
|
+
source: "./server/src/index.js",
|
|
55
|
+
"import": "./dist/server/index.mjs",
|
|
56
|
+
require: "./dist/server/index.js",
|
|
57
|
+
"default": "./dist/server/index.js"
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
const files = [
|
|
61
|
+
"dist"
|
|
62
|
+
];
|
|
63
|
+
const dependencies = {
|
|
64
|
+
"@strapi/design-system": "^2.0.0-rc.14",
|
|
65
|
+
"@strapi/icons": "^2.0.0-rc.14",
|
|
66
|
+
meilisearch: "0.48.2"
|
|
67
|
+
};
|
|
68
|
+
const peerDependencies = {
|
|
69
|
+
"@strapi/sdk-plugin": "^5.2.8",
|
|
70
|
+
"@strapi/strapi": "^5.6.0",
|
|
71
|
+
react: "^18.3.1",
|
|
72
|
+
"react-dom": "^18.3.1",
|
|
73
|
+
"react-router-dom": "^6.29.0",
|
|
74
|
+
"styled-components": "^6.1.14"
|
|
75
|
+
};
|
|
76
|
+
const devDependencies = {
|
|
77
|
+
"@babel/core": "^7.26.7",
|
|
78
|
+
"@babel/preset-env": "^7.26.7",
|
|
79
|
+
"@strapi/sdk-plugin": "^5.2.8",
|
|
80
|
+
"@strapi/strapi": "^5.6.0",
|
|
81
|
+
"@types/jest": "^29.5.12",
|
|
82
|
+
"babel-jest": "^29.7.0",
|
|
83
|
+
concurrently: "^8.2.2",
|
|
84
|
+
cypress: "^14.0.1",
|
|
85
|
+
eslint: "^8.2.0",
|
|
86
|
+
"eslint-config-prettier": "^9.1.0",
|
|
87
|
+
"eslint-plugin-cypress": "^2.12.1",
|
|
88
|
+
"eslint-plugin-import": "^2.25.3",
|
|
89
|
+
"eslint-plugin-node": "^11.1.0",
|
|
90
|
+
"eslint-plugin-prettier": "^5.1.3",
|
|
91
|
+
"eslint-plugin-promise": "^6.1.1",
|
|
92
|
+
"eslint-plugin-react": "^7.27.0",
|
|
93
|
+
jest: "^29.7.0",
|
|
94
|
+
prettier: "3.2.5",
|
|
95
|
+
react: "^18.3.1",
|
|
96
|
+
"react-dom": "^18.3.1",
|
|
97
|
+
"react-router-dom": "^6.29.0",
|
|
98
|
+
"styled-components": "^6.1.14"
|
|
99
|
+
};
|
|
100
|
+
const author = {
|
|
101
|
+
name: "Charlotte Vermandel <charlotte@meilisearch.com>"
|
|
102
|
+
};
|
|
103
|
+
const maintainers = [
|
|
104
|
+
{
|
|
105
|
+
name: "Charlotte Vermandel <charlotte@meilisearch.com>"
|
|
106
|
+
}
|
|
107
|
+
];
|
|
108
|
+
const engines = {
|
|
109
|
+
npm: ">=6.0.0",
|
|
110
|
+
node: ">=18"
|
|
111
|
+
};
|
|
112
|
+
const bugs = {
|
|
113
|
+
url: "https://github.com/meilisearch/strapi-plugin-meilisearch/issues"
|
|
114
|
+
};
|
|
115
|
+
const keywords = [
|
|
116
|
+
"strapi",
|
|
117
|
+
"plugin",
|
|
118
|
+
"meilisearch",
|
|
119
|
+
"search"
|
|
120
|
+
];
|
|
121
|
+
const license = "MIT";
|
|
122
|
+
const repository = {
|
|
123
|
+
type: "git",
|
|
124
|
+
url: "git+https://github.com/meilisearch/strapi-plugin-meilisearch.git"
|
|
125
|
+
};
|
|
126
|
+
const homepage = "https://github.com/meilisearch/strapi-plugin-meilisearch#readme";
|
|
127
|
+
const pluginPkg = {
|
|
128
|
+
name: name$1,
|
|
129
|
+
version,
|
|
130
|
+
description,
|
|
131
|
+
scripts,
|
|
132
|
+
strapi,
|
|
133
|
+
type,
|
|
134
|
+
exports: exports$1,
|
|
135
|
+
files,
|
|
136
|
+
dependencies,
|
|
137
|
+
peerDependencies,
|
|
138
|
+
devDependencies,
|
|
139
|
+
author,
|
|
140
|
+
maintainers,
|
|
141
|
+
engines,
|
|
142
|
+
bugs,
|
|
143
|
+
keywords,
|
|
144
|
+
license,
|
|
145
|
+
repository,
|
|
146
|
+
homepage
|
|
147
|
+
};
|
|
148
|
+
const pluginId = name$1.replace(/^strapi-plugin-/i, "");
|
|
149
|
+
const PluginIcon = () => /* @__PURE__ */ jsxRuntime.jsx(icons.Search, {});
|
|
150
|
+
const Initializer = ({ setPlugin }) => {
|
|
151
|
+
const ref = React.useRef(setPlugin);
|
|
152
|
+
React.useEffect(() => {
|
|
153
|
+
ref.current(pluginId);
|
|
154
|
+
}, []);
|
|
155
|
+
return null;
|
|
156
|
+
};
|
|
157
|
+
const PERMISSIONS = {
|
|
158
|
+
// This permission regards the main component (App) and is used to tell
|
|
159
|
+
// If the plugin link should be displayed in the menu
|
|
160
|
+
// And also if the plugin is accessible. This use case is found when a user types the url of the
|
|
161
|
+
// plugin directly in the browser
|
|
162
|
+
main: [
|
|
163
|
+
{ action: "plugin::meilisearch.read", subject: null },
|
|
164
|
+
{ action: "plugin::meilisearch.collections.create", subject: null },
|
|
165
|
+
{ action: "plugin::meilisearch.collections.update", subject: null },
|
|
166
|
+
{ action: "plugin::meilisearch.collections.delete", subject: null },
|
|
167
|
+
{ action: "plugin::meilisearch.settings.edit", subject: null }
|
|
168
|
+
],
|
|
169
|
+
collections: [
|
|
170
|
+
{ action: "plugin::meilisearch.read", subject: null },
|
|
171
|
+
{ action: "plugin::meilisearch.collections.create", subject: null },
|
|
172
|
+
{ action: "plugin::meilisearch.collections.update", subject: null },
|
|
173
|
+
{ action: "plugin::meilisearch.collections.delete", subject: null }
|
|
174
|
+
],
|
|
175
|
+
settings: [
|
|
176
|
+
{ action: "plugin::meilisearch.read", subject: null },
|
|
177
|
+
{ action: "plugin::meilisearch.settings.edit", subject: null }
|
|
178
|
+
],
|
|
179
|
+
read: [{ action: "plugin::meilisearch.read", subject: null }],
|
|
180
|
+
create: [{ action: "plugin::meilisearch.collections.create", subject: null }],
|
|
181
|
+
update: [{ action: "plugin::meilisearch.collections.update", subject: null }],
|
|
182
|
+
delete: [{ action: "plugin::meilisearch.collections.delete", subject: null }],
|
|
183
|
+
settingsEdit: [
|
|
184
|
+
{ action: "plugin::meilisearch.settings.edit", subject: null }
|
|
185
|
+
],
|
|
186
|
+
createAndDelete: [
|
|
187
|
+
{ action: "plugin::meilisearch.collections.create", subject: null },
|
|
188
|
+
{ action: "plugin::meilisearch.collections.delete", subject: null }
|
|
189
|
+
]
|
|
190
|
+
};
|
|
191
|
+
const getTranslation = (translations) => {
|
|
192
|
+
return Object.keys(translations).reduce((acc, current) => {
|
|
193
|
+
acc[`${pluginId}.${current}`] = translations[current];
|
|
194
|
+
return acc;
|
|
195
|
+
}, {});
|
|
196
|
+
};
|
|
197
|
+
const name = pluginPkg.strapi.name;
|
|
198
|
+
const index = {
|
|
199
|
+
register(app) {
|
|
200
|
+
app.registerPlugin({
|
|
201
|
+
id: pluginId,
|
|
202
|
+
initializer: Initializer,
|
|
203
|
+
isReady: true,
|
|
204
|
+
name
|
|
205
|
+
});
|
|
206
|
+
app.addMenuLink({
|
|
207
|
+
to: `/plugins/${pluginId}`,
|
|
208
|
+
icon: PluginIcon,
|
|
209
|
+
intlLabel: {
|
|
210
|
+
id: `${pluginId}.plugin.name`,
|
|
211
|
+
defaultMessage: name
|
|
212
|
+
},
|
|
213
|
+
Component: async () => {
|
|
214
|
+
const { App } = await Promise.resolve().then(() => require("./App-4wYXCpIt.js"));
|
|
215
|
+
return App;
|
|
216
|
+
},
|
|
217
|
+
permissions: PERMISSIONS.main
|
|
218
|
+
});
|
|
219
|
+
},
|
|
220
|
+
async registerTrads({ locales }) {
|
|
221
|
+
const importedTranslations = await Promise.all(
|
|
222
|
+
locales.map((locale) => {
|
|
223
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-CByedxRT.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-DA_jpbS7.js")) }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
|
|
224
|
+
return {
|
|
225
|
+
data: getTranslation(data),
|
|
226
|
+
locale
|
|
227
|
+
};
|
|
228
|
+
}).catch(() => {
|
|
229
|
+
return {
|
|
230
|
+
data: {},
|
|
231
|
+
locale
|
|
232
|
+
};
|
|
233
|
+
});
|
|
234
|
+
})
|
|
235
|
+
);
|
|
236
|
+
return Promise.resolve(importedTranslations);
|
|
237
|
+
}
|
|
238
|
+
};
|
|
239
|
+
exports.PERMISSIONS = PERMISSIONS;
|
|
240
|
+
exports.index = index;
|
|
241
|
+
exports.pluginId = pluginId;
|