strapi-plugin-meilisearch-plus 0.0.1

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.
Files changed (70) hide show
  1. package/README.md +266 -0
  2. package/dist/_chunks/CollectionsTable-DhFoYbHi.mjs +376 -0
  3. package/dist/_chunks/CollectionsTable-QsBP3lXJ.js +376 -0
  4. package/dist/_chunks/CredentialsTab-CNnDxmdX.js +223 -0
  5. package/dist/_chunks/CredentialsTab-UuDtCixJ.mjs +223 -0
  6. package/dist/_chunks/HomePage-CwtBGxKu.js +36 -0
  7. package/dist/_chunks/HomePage-VgGeNynA.mjs +36 -0
  8. package/dist/_chunks/IndexSettingsTab-EvPHd16e.js +270 -0
  9. package/dist/_chunks/IndexSettingsTab-P4Oz-QWd.mjs +270 -0
  10. package/dist/_chunks/en-BijiR88Y.js +42 -0
  11. package/dist/_chunks/en-KhozGU-M.mjs +42 -0
  12. package/dist/_chunks/es-B2Fg_gLt.js +42 -0
  13. package/dist/_chunks/es-DAneCWM5.mjs +42 -0
  14. package/dist/_chunks/index-DgpT8G3z.mjs +134 -0
  15. package/dist/_chunks/index-eoiIjp_f.js +133 -0
  16. package/dist/_chunks/useI18n-B9yJCqkO.js +18 -0
  17. package/dist/_chunks/useI18n-RYsv52c9.mjs +19 -0
  18. package/dist/admin/index.js +3 -0
  19. package/dist/admin/index.mjs +4 -0
  20. package/dist/admin/src/components/Icons/DangerIcon.d.ts +7 -0
  21. package/dist/admin/src/components/Icons/RefreshIcon.d.ts +7 -0
  22. package/dist/admin/src/components/Icons/XIcon.d.ts +7 -0
  23. package/dist/admin/src/components/Icons/index.d.ts +3 -0
  24. package/dist/admin/src/components/Initializer.d.ts +10 -0
  25. package/dist/admin/src/components/PluginIcon.d.ts +10 -0
  26. package/dist/admin/src/containers/CollectionsTab.d.ts +6 -0
  27. package/dist/admin/src/containers/CollectionsTable.d.ts +6 -0
  28. package/dist/admin/src/containers/ContentTypesToggle.d.ts +6 -0
  29. package/dist/admin/src/containers/CredentialsTab.d.ts +6 -0
  30. package/dist/admin/src/containers/IndexSettingsTab.d.ts +6 -0
  31. package/dist/admin/src/containers/PluginTabs.d.ts +6 -0
  32. package/dist/admin/src/hooks/index.d.ts +3 -0
  33. package/dist/admin/src/hooks/useCredentials.d.ts +18 -0
  34. package/dist/admin/src/hooks/useI18n.d.ts +7 -0
  35. package/dist/admin/src/hooks/useIndexedContentTypes.d.ts +15 -0
  36. package/dist/admin/src/index.d.ts +14 -0
  37. package/dist/admin/src/pages/App.d.ts +2 -0
  38. package/dist/admin/src/pages/HomePage.d.ts +5 -0
  39. package/dist/admin/src/pages/SettingsPage.d.ts +5 -0
  40. package/dist/admin/src/pluginId.d.ts +1 -0
  41. package/dist/admin/src/utils/getTranslation.d.ts +2 -0
  42. package/dist/admin/src/utils/pluginId.d.ts +1 -0
  43. package/dist/server/index.js +1346 -0
  44. package/dist/server/index.mjs +1347 -0
  45. package/dist/server/src/bootstrap.d.ts +5 -0
  46. package/dist/server/src/config/index.d.ts +5 -0
  47. package/dist/server/src/content-types/index.d.ts +2 -0
  48. package/dist/server/src/controllers/content-types.d.ts +14 -0
  49. package/dist/server/src/controllers/controller.d.ts +7 -0
  50. package/dist/server/src/controllers/credentials.d.ts +12 -0
  51. package/dist/server/src/controllers/index-settings.d.ts +17 -0
  52. package/dist/server/src/controllers/index.d.ts +40 -0
  53. package/dist/server/src/controllers/indexing.d.ts +10 -0
  54. package/dist/server/src/controllers/search.d.ts +10 -0
  55. package/dist/server/src/destroy.d.ts +5 -0
  56. package/dist/server/src/index.d.ts +216 -0
  57. package/dist/server/src/middlewares/index.d.ts +2 -0
  58. package/dist/server/src/policies/index.d.ts +2 -0
  59. package/dist/server/src/register.d.ts +5 -0
  60. package/dist/server/src/routes/admin/index.d.ts +21 -0
  61. package/dist/server/src/routes/content-api/index.d.ts +12 -0
  62. package/dist/server/src/routes/index.d.ts +34 -0
  63. package/dist/server/src/services/content-types.d.ts +59 -0
  64. package/dist/server/src/services/index.d.ts +123 -0
  65. package/dist/server/src/services/lifecycle.d.ts +15 -0
  66. package/dist/server/src/services/meilisearch-client.d.ts +18 -0
  67. package/dist/server/src/services/meilisearch.d.ts +42 -0
  68. package/dist/server/src/services/service.d.ts +7 -0
  69. package/dist/server/src/services/store.d.ts +42 -0
  70. package/package.json +78 -0
@@ -0,0 +1,133 @@
1
+ "use strict";
2
+ const react = require("react");
3
+ const jsxRuntime = require("react/jsx-runtime");
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 pluginId = "meilisearch-plus";
21
+ const Initializer = ({ setPlugin }) => {
22
+ const ref = react.useRef(setPlugin);
23
+ react.useEffect(() => {
24
+ ref.current(pluginId);
25
+ }, []);
26
+ return null;
27
+ };
28
+ const PluginIcon = ({ width, height }) => /* @__PURE__ */ jsxRuntime.jsxs(
29
+ "svg",
30
+ {
31
+ xmlns: "http://www.w3.org/2000/svg",
32
+ width: width ?? 32,
33
+ height: height ?? 32,
34
+ viewBox: "0 0 2048 2048",
35
+ children: [
36
+ /* @__PURE__ */ jsxRuntime.jsx(
37
+ "path",
38
+ {
39
+ fill: "#0A0C2F",
40
+ d: "M1197 758c50-3 100 12 138 44a206 206 0 0 1 30 289l28 31c11-2 19-3 27 5l105 111 11 14c3 4 3 10 3 14 0 12-4 23-13 31-31 29-58-11-78-32l-23-25-40-41c-14-17-27-21-21-46-10-9-20-21-29-31a200 200 0 0 1-321-143c-4-56 14-111 50-154 34-39 82-63 133-67zm24 360a156 156 0 1 0-20-313 156 156 0 0 0 20 313z"
41
+ }
42
+ ),
43
+ /* @__PURE__ */ jsxRuntime.jsx(
44
+ "path",
45
+ {
46
+ fill: "#0A0C2F",
47
+ d: "M1204 827c41-3 76 16 104 44-40 4-66 14-91 48-21 28-25 51-27 85l-1 1h-102c-24-86 25-168 117-178zm-354 181 145-1c7 35 15 57 37 85a328 328 0 0 1-89 160 313 313 0 0 1-533-245l54 1h135l2 25a126 126 0 0 0 210 75c30-29 38-60 39-100z"
48
+ }
49
+ ),
50
+ /* @__PURE__ */ jsxRuntime.jsx(
51
+ "path",
52
+ {
53
+ fill: "#0A0C2F",
54
+ d: "M1299 676c105-3 187 29 259 108 52 57 83 145 80 222l-128-1-69 1v-15c-1-14-4-24-6-36a227 227 0 0 0-171-214c-46-12-98-8-143 12l-13 7c0-2 1-3 3-5 34-31 81-58 125-70 21-5 43-7 63-9z"
55
+ }
56
+ )
57
+ ]
58
+ }
59
+ );
60
+ const index = {
61
+ register(app) {
62
+ app.addMenuLink({
63
+ to: `plugins/${pluginId}`,
64
+ icon: PluginIcon,
65
+ intlLabel: {
66
+ id: `${pluginId}.plugin.name`,
67
+ defaultMessage: "MeiliSearch Plus"
68
+ },
69
+ Component: async () => {
70
+ const { default: HomePage } = await Promise.resolve().then(() => require("./HomePage-CwtBGxKu.js"));
71
+ return HomePage;
72
+ }
73
+ });
74
+ app.createSettingSection(
75
+ {
76
+ id: pluginId,
77
+ intlLabel: {
78
+ id: `${pluginId}.settings.title`,
79
+ defaultMessage: "MeiliSearch Plus"
80
+ }
81
+ },
82
+ [
83
+ {
84
+ intlLabel: {
85
+ id: `${pluginId}.settings.credentials`,
86
+ defaultMessage: "Credentials"
87
+ },
88
+ id: "credentials",
89
+ to: `/settings/${pluginId}/credentials`,
90
+ Component: async () => {
91
+ const { default: CredentialsTab } = await Promise.resolve().then(() => require("./CredentialsTab-CNnDxmdX.js"));
92
+ return CredentialsTab;
93
+ },
94
+ permissions: []
95
+ },
96
+ {
97
+ intlLabel: {
98
+ id: `${pluginId}.settings.index`,
99
+ defaultMessage: "Index Settings"
100
+ },
101
+ id: "index-settings",
102
+ to: `/settings/${pluginId}/index-settings`,
103
+ Component: async () => {
104
+ const { default: IndexSettingsTab } = await Promise.resolve().then(() => require("./IndexSettingsTab-EvPHd16e.js"));
105
+ return IndexSettingsTab;
106
+ },
107
+ permissions: []
108
+ }
109
+ ]
110
+ );
111
+ app.registerPlugin({
112
+ id: pluginId,
113
+ initializer: Initializer,
114
+ isReady: false,
115
+ name: pluginId
116
+ });
117
+ },
118
+ async registerTrads({ locales }) {
119
+ return Promise.all(
120
+ locales.map(async (locale) => {
121
+ try {
122
+ const data = await __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-BijiR88Y.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-B2Fg_gLt.js")) }), `./translations/${locale}.json`, 3);
123
+ return { data: data.default, locale };
124
+ } catch (error) {
125
+ return { data: {}, locale };
126
+ }
127
+ })
128
+ );
129
+ }
130
+ };
131
+ exports.PluginIcon = PluginIcon;
132
+ exports.index = index;
133
+ exports.pluginId = pluginId;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ const react = require("react");
3
+ const reactIntl = require("react-intl");
4
+ function useI18n() {
5
+ const intl = reactIntl.useIntl();
6
+ const i18n = react.useCallback(
7
+ (key, defaultMessage) => {
8
+ try {
9
+ return intl.formatMessage({ id: key, defaultMessage });
10
+ } catch (e) {
11
+ return defaultMessage;
12
+ }
13
+ },
14
+ [intl]
15
+ );
16
+ return react.useMemo(() => ({ i18n }), [i18n]);
17
+ }
18
+ exports.useI18n = useI18n;
@@ -0,0 +1,19 @@
1
+ import { useCallback, useMemo } from "react";
2
+ import { useIntl } from "react-intl";
3
+ function useI18n() {
4
+ const intl = useIntl();
5
+ const i18n = useCallback(
6
+ (key, defaultMessage) => {
7
+ try {
8
+ return intl.formatMessage({ id: key, defaultMessage });
9
+ } catch (e) {
10
+ return defaultMessage;
11
+ }
12
+ },
13
+ [intl]
14
+ );
15
+ return useMemo(() => ({ i18n }), [i18n]);
16
+ }
17
+ export {
18
+ useI18n as u
19
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ const index = require("../_chunks/index-eoiIjp_f.js");
3
+ module.exports = index.index;
@@ -0,0 +1,4 @@
1
+ import { i } from "../_chunks/index-DgpT8G3z.mjs";
2
+ export {
3
+ i as default
4
+ };
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface DangerIconProps {
3
+ size?: number;
4
+ color?: string;
5
+ }
6
+ declare const DangerIcon: React.FC<DangerIconProps>;
7
+ export default DangerIcon;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface RefreshIconProps {
3
+ size?: number;
4
+ color?: string;
5
+ }
6
+ declare const RefreshIcon: React.FC<RefreshIconProps>;
7
+ export default RefreshIcon;
@@ -0,0 +1,7 @@
1
+ import React from 'react';
2
+ interface XIconProps {
3
+ size?: number;
4
+ color?: string;
5
+ }
6
+ declare const XIcon: React.FC<XIconProps>;
7
+ export default XIcon;
@@ -0,0 +1,3 @@
1
+ export { default as RefreshIcon } from './RefreshIcon';
2
+ export { default as XIcon } from './XIcon';
3
+ export { default as DangerIcon } from './DangerIcon';
@@ -0,0 +1,10 @@
1
+ /// <reference types="react" />
2
+ interface InitializerProps {
3
+ setPlugin: (id: string) => void;
4
+ }
5
+ /**
6
+ * Plugin initializer component
7
+ * Registers the plugin with Strapi on initialization
8
+ */
9
+ declare const Initializer: React.FC<InitializerProps>;
10
+ export { Initializer };
@@ -0,0 +1,10 @@
1
+ /**
2
+ *
3
+ * PluginIcon
4
+ *
5
+ */
6
+ declare const PluginIcon: ({ width, height }: {
7
+ width?: number;
8
+ height?: number;
9
+ }) => import("react/jsx-runtime").JSX.Element;
10
+ export default PluginIcon;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ /**
3
+ * Collections view showing indexed content types with legend and features
4
+ */
5
+ declare const CollectionsTab: React.MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
6
+ export default CollectionsTab;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ /**
3
+ * Collections table - shows all configured content types with indexing controls
4
+ */
5
+ declare const CollectionsTable: React.MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
6
+ export default CollectionsTable;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ /**
3
+ * Content types toggle - shows all configured types with checkboxes to enable/disable indexing
4
+ */
5
+ declare const ContentTypesToggle: React.MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
6
+ export default ContentTypesToggle;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ /**
3
+ * Settings page - Credentials management
4
+ */
5
+ declare const CredentialsTab: React.MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
6
+ export default CredentialsTab;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ /**
3
+ * Index Settings Tab - Configure filterable/sortable attributes and pagination
4
+ */
5
+ declare const IndexSettingsTab: React.MemoExoticComponent<() => import("react/jsx-runtime").JSX.Element>;
6
+ export default IndexSettingsTab;
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ /**
3
+ * Tabbed interface for plugin main container
4
+ */
5
+ declare const PluginTabs: React.FC;
6
+ export default PluginTabs;
@@ -0,0 +1,3 @@
1
+ export { useI18n } from './useI18n';
2
+ export { useCredentials } from './useCredentials';
3
+ export { useIndexedContentTypes } from './useIndexedContentTypes';
@@ -0,0 +1,18 @@
1
+ interface CredentialsType {
2
+ host: string;
3
+ apiKey: string;
4
+ indexName: string;
5
+ }
6
+ /**
7
+ * Hook for managing MeiliSearch credentials
8
+ * Provides credential management with caching and persistence
9
+ */
10
+ export declare function useCredentials(): {
11
+ credentials: CredentialsType;
12
+ isLoading: boolean;
13
+ isSaving: boolean;
14
+ updateCredentials: (newCredentials: CredentialsType) => Promise<void>;
15
+ testConnection: () => Promise<boolean>;
16
+ refetch: () => void;
17
+ };
18
+ export {};
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Hook for internationalization
3
+ * Provides i18n function to translate messages
4
+ */
5
+ export declare function useI18n(): {
6
+ i18n: (key: string, defaultMessage: string) => string;
7
+ };
@@ -0,0 +1,15 @@
1
+ interface IndexedContentType {
2
+ name: string;
3
+ uid: string;
4
+ }
5
+ /**
6
+ * Hook for managing indexed content types
7
+ */
8
+ export declare function useIndexedContentTypes(): {
9
+ contentTypes: IndexedContentType[];
10
+ isLoading: boolean;
11
+ addContentType: (contentType: string) => Promise<void>;
12
+ removeContentType: (contentType: string) => Promise<void>;
13
+ refetch: () => void;
14
+ };
15
+ export {};
@@ -0,0 +1,14 @@
1
+ /**
2
+ * MeiliSearch Plus Admin Plugin
3
+ * Provides UI for managing MeiliSearch credentials, indexing, and search
4
+ */
5
+ declare const _default: {
6
+ register(app: any): void;
7
+ registerTrads({ locales }: {
8
+ locales: string[];
9
+ }): Promise<{
10
+ data: any;
11
+ locale: string;
12
+ }[]>;
13
+ };
14
+ export default _default;
@@ -0,0 +1,2 @@
1
+ declare const App: () => import("react/jsx-runtime").JSX.Element;
2
+ export { App };
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Main home page for the MeiliSearch plugin - Collections view with legend
3
+ */
4
+ declare const HomePage: () => import("react/jsx-runtime").JSX.Element;
5
+ export default HomePage;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Settings page for the MeiliSearch plugin - Credentials and configuration
3
+ */
4
+ declare const SettingsPage: () => import("react/jsx-runtime").JSX.Element;
5
+ export default SettingsPage;
@@ -0,0 +1 @@
1
+ export declare const pluginId = "meilisearch-plus";
@@ -0,0 +1,2 @@
1
+ declare const getTranslation: (id: string) => string;
2
+ export { getTranslation };
@@ -0,0 +1 @@
1
+ export declare const pluginId = "meilisearch-plus";