@littlebox/strapi-suite 1.0.28

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 (146) hide show
  1. package/README.md +3 -0
  2. package/dist/_chunks/App-5t0oXrfw.mjs +5284 -0
  3. package/dist/_chunks/App-DUrW4zBW.js +5287 -0
  4. package/dist/_chunks/SlugInput-C221apIK.mjs +280 -0
  5. package/dist/_chunks/SlugInput-CxxShxb6.js +300 -0
  6. package/dist/_chunks/convertToSlug-B5DOR_Nr.js +83 -0
  7. package/dist/_chunks/convertToSlug-CmCb9ke3.mjs +84 -0
  8. package/dist/_chunks/en-Bz6GsXYT.js +170 -0
  9. package/dist/_chunks/en-RUOaam8y.mjs +170 -0
  10. package/dist/_chunks/index-B-VDYXwv.mjs +3408 -0
  11. package/dist/_chunks/index-BW7xqYof.js +3409 -0
  12. package/dist/admin/index.js +3 -0
  13. package/dist/admin/index.mjs +4 -0
  14. package/dist/admin/src/components/BoxGrid.d.ts +3 -0
  15. package/dist/admin/src/components/Card.d.ts +2 -0
  16. package/dist/admin/src/components/ConfirmModal.d.ts +2 -0
  17. package/dist/admin/src/components/DangerModal.d.ts +2 -0
  18. package/dist/admin/src/components/HeaderLayout.d.ts +2 -0
  19. package/dist/admin/src/components/Initializer.d.ts +5 -0
  20. package/dist/admin/src/components/Logo.d.ts +2 -0
  21. package/dist/admin/src/components/MenuCreateModal.d.ts +2 -0
  22. package/dist/admin/src/components/MenuDuplicateModal.d.ts +2 -0
  23. package/dist/admin/src/components/PageAttributesBox.d.ts +5 -0
  24. package/dist/admin/src/components/ParameterHandleDataModal.d.ts +9 -0
  25. package/dist/admin/src/components/PluginIcon.d.ts +2 -0
  26. package/dist/admin/src/components/ProductIcon.d.ts +2 -0
  27. package/dist/admin/src/components/SlugInput.d.ts +10 -0
  28. package/dist/admin/src/components/SlugSettingsModal.d.ts +2 -0
  29. package/dist/admin/src/components/Tab.d.ts +28 -0
  30. package/dist/admin/src/components/TemplateHandleDataModal.d.ts +9 -0
  31. package/dist/admin/src/components/TranslationHandleDataModal.d.ts +15 -0
  32. package/dist/admin/src/components/menu/MenuDragDrop.d.ts +7 -0
  33. package/dist/admin/src/components/menu/MenuEditItem.d.ts +8 -0
  34. package/dist/admin/src/components/menu/MenuItem.d.ts +11 -0
  35. package/dist/admin/src/components/menu/MenuList.d.ts +11 -0
  36. package/dist/admin/src/components/menu/types.d.ts +27 -0
  37. package/dist/admin/src/contexts/settings.d.ts +11 -0
  38. package/dist/admin/src/core/config.d.ts +14 -0
  39. package/dist/admin/src/core/di/registry.d.ts +8 -0
  40. package/dist/admin/src/core/events/appSettingsUpdated.d.ts +12 -0
  41. package/dist/admin/src/core/events/documentCustomFieldStarted.d.ts +10 -0
  42. package/dist/admin/src/core/events/event.d.ts +4 -0
  43. package/dist/admin/src/core/events/pageAttributeUpdated.d.ts +10 -0
  44. package/dist/admin/src/core/gateways/attributeGateway.d.ts +29 -0
  45. package/dist/admin/src/core/gateways/localeGateway.d.ts +20 -0
  46. package/dist/admin/src/core/gateways/menuGateway.d.ts +82 -0
  47. package/dist/admin/src/core/gateways/parameterGateway.d.ts +42 -0
  48. package/dist/admin/src/core/gateways/settingGateway.d.ts +21 -0
  49. package/dist/admin/src/core/gateways/slugGateway.d.ts +26 -0
  50. package/dist/admin/src/core/gateways/templateGateway.d.ts +37 -0
  51. package/dist/admin/src/core/gateways/translationGateway.d.ts +42 -0
  52. package/dist/admin/src/core/http/httpClient.d.ts +18 -0
  53. package/dist/admin/src/core/mediator/mediator.d.ts +11 -0
  54. package/dist/admin/src/core/usecases/createMenu.d.ts +10 -0
  55. package/dist/admin/src/core/usecases/createParameter.d.ts +10 -0
  56. package/dist/admin/src/core/usecases/createTemplate.d.ts +9 -0
  57. package/dist/admin/src/core/usecases/createTranslations.d.ts +10 -0
  58. package/dist/admin/src/core/usecases/deleteAttributes.d.ts +6 -0
  59. package/dist/admin/src/core/usecases/deleteMenus.d.ts +6 -0
  60. package/dist/admin/src/core/usecases/deleteParameters.d.ts +6 -0
  61. package/dist/admin/src/core/usecases/deleteSlugs.d.ts +6 -0
  62. package/dist/admin/src/core/usecases/deleteTemplates.d.ts +6 -0
  63. package/dist/admin/src/core/usecases/deleteTranslations.d.ts +6 -0
  64. package/dist/admin/src/core/usecases/duplicateMenu.d.ts +6 -0
  65. package/dist/admin/src/core/usecases/editMenu.d.ts +21 -0
  66. package/dist/admin/src/core/usecases/editParameter.d.ts +10 -0
  67. package/dist/admin/src/core/usecases/editTemplate.d.ts +9 -0
  68. package/dist/admin/src/core/usecases/editTranslations.d.ts +10 -0
  69. package/dist/admin/src/core/usecases/fetchAttributes.d.ts +19 -0
  70. package/dist/admin/src/core/usecases/fetchDocumentAttributes.d.ts +17 -0
  71. package/dist/admin/src/core/usecases/fetchLocales.d.ts +12 -0
  72. package/dist/admin/src/core/usecases/fetchMenu.d.ts +25 -0
  73. package/dist/admin/src/core/usecases/fetchMenus.d.ts +13 -0
  74. package/dist/admin/src/core/usecases/fetchModuleSettings.d.ts +4 -0
  75. package/dist/admin/src/core/usecases/fetchParameters.d.ts +13 -0
  76. package/dist/admin/src/core/usecases/fetchSettings.d.ts +10 -0
  77. package/dist/admin/src/core/usecases/fetchSlugs.d.ts +16 -0
  78. package/dist/admin/src/core/usecases/fetchTemplates.d.ts +12 -0
  79. package/dist/admin/src/core/usecases/fetchTranslations.d.ts +13 -0
  80. package/dist/admin/src/core/usecases/updateSetting.d.ts +14 -0
  81. package/dist/admin/src/core/utils/arrayToTree.d.ts +2 -0
  82. package/dist/admin/src/core/utils/convertToSlug.d.ts +2 -0
  83. package/dist/admin/src/core/utils/getTranslation.d.ts +2 -0
  84. package/dist/admin/src/core/utils/isEmpty.d.ts +3 -0
  85. package/dist/admin/src/core/utils/objectToQueryString.d.ts +2 -0
  86. package/dist/admin/src/index.d.ts +11 -0
  87. package/dist/admin/src/pages/App.d.ts +2 -0
  88. package/dist/admin/src/pages/AttributeSettingsPage.d.ts +2 -0
  89. package/dist/admin/src/pages/ErrorPage.d.ts +2 -0
  90. package/dist/admin/src/pages/HomePage.d.ts +2 -0
  91. package/dist/admin/src/pages/MenuSettingsEditPage.d.ts +2 -0
  92. package/dist/admin/src/pages/MenuSettingsPage.d.ts +2 -0
  93. package/dist/admin/src/pages/ParameterSettingsPage.d.ts +2 -0
  94. package/dist/admin/src/pages/SlugSettingsPage.d.ts +2 -0
  95. package/dist/admin/src/pages/TemplateSettingsPage.d.ts +2 -0
  96. package/dist/admin/src/pages/TranslationSettingsPage.d.ts +2 -0
  97. package/dist/admin/src/pluginId.d.ts +1 -0
  98. package/dist/server/index.js +2229 -0
  99. package/dist/server/index.mjs +2230 -0
  100. package/dist/server/src/bootstrap.d.ts +5 -0
  101. package/dist/server/src/config/index.d.ts +50 -0
  102. package/dist/server/src/content-types/app/settings/index.d.ts +51 -0
  103. package/dist/server/src/content-types/index.d.ts +447 -0
  104. package/dist/server/src/content-types/modules/attributes/index.d.ts +75 -0
  105. package/dist/server/src/content-types/modules/menus/children/index.d.ts +71 -0
  106. package/dist/server/src/content-types/modules/menus/index.d.ts +47 -0
  107. package/dist/server/src/content-types/modules/parameters/index.d.ts +47 -0
  108. package/dist/server/src/content-types/modules/slugs/index.d.ts +67 -0
  109. package/dist/server/src/content-types/modules/templates/index.d.ts +43 -0
  110. package/dist/server/src/content-types/modules/translations/index.d.ts +51 -0
  111. package/dist/server/src/controllers/app/setting.d.ts +9 -0
  112. package/dist/server/src/controllers/index.d.ts +61 -0
  113. package/dist/server/src/controllers/modules/attribute.d.ts +9 -0
  114. package/dist/server/src/controllers/modules/menu.d.ts +13 -0
  115. package/dist/server/src/controllers/modules/parameter.d.ts +11 -0
  116. package/dist/server/src/controllers/modules/slug.d.ts +9 -0
  117. package/dist/server/src/controllers/modules/template.d.ts +10 -0
  118. package/dist/server/src/controllers/modules/translation.d.ts +11 -0
  119. package/dist/server/src/destroy.d.ts +5 -0
  120. package/dist/server/src/index.d.ts +653 -0
  121. package/dist/server/src/lifecycles/index.d.ts +9 -0
  122. package/dist/server/src/lifecycles/modules/slug/after-create.d.ts +1 -0
  123. package/dist/server/src/lifecycles/modules/slug/after-delete.d.ts +1 -0
  124. package/dist/server/src/lifecycles/modules/slug/after-findmany.d.ts +1 -0
  125. package/dist/server/src/lifecycles/modules/slug/after-findone.d.ts +1 -0
  126. package/dist/server/src/lifecycles/modules/slug/after-unpublish.d.ts +1 -0
  127. package/dist/server/src/lifecycles/modules/slug/after-update.d.ts +1 -0
  128. package/dist/server/src/lifecycles/modules/slug/before-create.d.ts +1 -0
  129. package/dist/server/src/lifecycles/modules/slug/before-update.d.ts +1 -0
  130. package/dist/server/src/middlewares/index.d.ts +2 -0
  131. package/dist/server/src/policies/index.d.ts +2 -0
  132. package/dist/server/src/register.d.ts +5 -0
  133. package/dist/server/src/routes/admin-api.d.ts +9 -0
  134. package/dist/server/src/routes/content-api.d.ts +10 -0
  135. package/dist/server/src/routes/index.d.ts +26 -0
  136. package/dist/server/src/services/app/setting.d.ts +9 -0
  137. package/dist/server/src/services/index.d.ts +70 -0
  138. package/dist/server/src/services/modules/attribute.d.ts +9 -0
  139. package/dist/server/src/services/modules/menu.d.ts +13 -0
  140. package/dist/server/src/services/modules/parameter.d.ts +11 -0
  141. package/dist/server/src/services/modules/slug.d.ts +18 -0
  142. package/dist/server/src/services/modules/template.d.ts +10 -0
  143. package/dist/server/src/services/modules/translation.d.ts +16 -0
  144. package/dist/server/src/utils/arrayToTree.d.ts +2 -0
  145. package/dist/server/src/utils/getSlugByDocumentId.d.ts +7 -0
  146. package/package.json +112 -0
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ const index = require("../_chunks/index-BW7xqYof.js");
3
+ module.exports = index.index;
@@ -0,0 +1,4 @@
1
+ import { i } from "../_chunks/index-B-VDYXwv.mjs";
2
+ export {
3
+ i as default
4
+ };
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const BoxGrid: import("styled-components/dist/types").IStyledComponentBase<"web", import("styled-components").FastOmit<any, never>> & string & (import("styled-components/dist/types").BaseObject | Omit<any, keyof import("react").Component<any, {}, any>>);
3
+ export default BoxGrid;
@@ -0,0 +1,2 @@
1
+ declare const Card: ({ title, subtitle, badge, active, children }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default Card;
@@ -0,0 +1,2 @@
1
+ declare const ConfirmModal: ({ open, title, text, confirm, cancel }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default ConfirmModal;
@@ -0,0 +1,2 @@
1
+ declare const DangerModal: ({ open, title, text, button }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default DangerModal;
@@ -0,0 +1,2 @@
1
+ declare const HeaderLayout: ({ children, breadcrumbs, description }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default HeaderLayout;
@@ -0,0 +1,5 @@
1
+ type InitializerProps = {
2
+ setPlugin: (id: string) => void;
3
+ };
4
+ declare const Initializer: ({ setPlugin }: InitializerProps) => null;
5
+ export { Initializer };
@@ -0,0 +1,2 @@
1
+ declare const Logo: ({ size }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default Logo;
@@ -0,0 +1,2 @@
1
+ declare const MenuCreateModal: ({ open, close, locale, currentRecords }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default MenuCreateModal;
@@ -0,0 +1,2 @@
1
+ declare const MenuDuplicateModal: ({ open, close, documentId, locales }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default MenuDuplicateModal;
@@ -0,0 +1,5 @@
1
+ declare const PageAttributesBox: ({ document }: any) => {
2
+ title: string;
3
+ content: import("react/jsx-runtime").JSX.Element;
4
+ } | null;
5
+ export default PageAttributesBox;
@@ -0,0 +1,9 @@
1
+ import { Output as OutputFetchParameters } from '../core/usecases/fetchParameters';
2
+ type Props = {
3
+ open: boolean;
4
+ close: (refresh: boolean) => void;
5
+ data: OutputFetchParameters;
6
+ currentRecords: OutputFetchParameters[];
7
+ };
8
+ declare const ParameterHandleDataModal: ({ open, close, data, currentRecords }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export default ParameterHandleDataModal;
@@ -0,0 +1,2 @@
1
+ declare const PluginIcon: () => import("react/jsx-runtime").JSX.Element;
2
+ export { PluginIcon };
@@ -0,0 +1,2 @@
1
+ declare const ProductIcon: ({ product }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default ProductIcon;
@@ -0,0 +1,10 @@
1
+ import * as React from 'react';
2
+ import { FieldValue, InputProps } from '@strapi/strapi/admin';
3
+ type Props = InputProps & FieldValue & {
4
+ labelAction?: React.ReactNode;
5
+ attribute?: {
6
+ targetField: string;
7
+ };
8
+ };
9
+ declare const Input: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLButtonElement>>;
10
+ export default Input;
@@ -0,0 +1,2 @@
1
+ declare const SlugSettingsModal: ({ open, close }: any) => import("react/jsx-runtime").JSX.Element;
2
+ export default SlugSettingsModal;
@@ -0,0 +1,28 @@
1
+ import { ReactNode } from 'react';
2
+ import { Item } from 'src/components/menu/types';
3
+ interface TabComposition {
4
+ Header: React.FC<TabHeaderProps>;
5
+ Item: React.FC<TabItemProps>;
6
+ Body: React.FC<TabBodyProps>;
7
+ }
8
+ interface TabProps {
9
+ data?: Item;
10
+ onChangeEvent?: (data: Item) => void;
11
+ onCheckEvent?: (isValid: boolean) => void;
12
+ children: ReactNode;
13
+ defaultTab?: string;
14
+ }
15
+ interface TabItemProps {
16
+ value: string;
17
+ children: ReactNode;
18
+ onClick?: () => void;
19
+ }
20
+ interface TabHeaderProps {
21
+ children: ReactNode;
22
+ }
23
+ interface TabBodyProps {
24
+ value: string;
25
+ children: ReactNode;
26
+ }
27
+ export declare const Tab: React.FC<TabProps> & TabComposition;
28
+ export {};
@@ -0,0 +1,9 @@
1
+ import { Output as OutputFetchTemplates } from '../core/usecases/fetchTemplates';
2
+ type Props = {
3
+ open: boolean;
4
+ close: (refresh: boolean) => void;
5
+ data: OutputFetchTemplates;
6
+ currentRecords: OutputFetchTemplates[];
7
+ };
8
+ declare const TemplateHandleDataModal: ({ open, close, data, currentRecords }: Props) => import("react/jsx-runtime").JSX.Element;
9
+ export default TemplateHandleDataModal;
@@ -0,0 +1,15 @@
1
+ import { Output as OutputFetchLocales } from '../core/usecases/fetchLocales';
2
+ interface TranslationItem {
3
+ id: number;
4
+ uid: string;
5
+ translations: Record<string, string>;
6
+ }
7
+ type Props = {
8
+ open: boolean;
9
+ close: (refresh: boolean) => void;
10
+ currentRecords: TranslationItem[];
11
+ selectedRecord: TranslationItem | undefined;
12
+ locales: OutputFetchLocales[];
13
+ };
14
+ declare const TranslationHandleDataModal: ({ open, close, locales, selectedRecord, currentRecords, }: Props) => import("react/jsx-runtime").JSX.Element;
15
+ export default TranslationHandleDataModal;
@@ -0,0 +1,7 @@
1
+ import { Output as OutputFetchMenu } from '../../core/usecases/fetchMenu';
2
+ import { RequestEditInput } from './types';
3
+ declare function MenuDragDrop(props: {
4
+ data: OutputFetchMenu;
5
+ onSaveEvent: (data: RequestEditInput | null) => void;
6
+ }): import("react/jsx-runtime").JSX.Element;
7
+ export default MenuDragDrop;
@@ -0,0 +1,8 @@
1
+ import { Item } from './types';
2
+ declare function MenuEditItem(props: {
3
+ data: Item;
4
+ locale: string;
5
+ onChangeEvent: (data: Item) => void;
6
+ onCheckEvent: (isValid: boolean) => void;
7
+ }): import("react/jsx-runtime").JSX.Element;
8
+ export default MenuEditItem;
@@ -0,0 +1,11 @@
1
+ import { Item } from './types';
2
+ declare function MenuItem(props: {
3
+ data: Item;
4
+ active: boolean;
5
+ level: number;
6
+ onAddEvent: (id: number) => void;
7
+ onRemoveEvent: (id: number) => void;
8
+ onUpdateEvent: (id: number) => void;
9
+ onSortingEvent: (sortedItems: Item[], parentId?: number) => void;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ export default MenuItem;
@@ -0,0 +1,11 @@
1
+ import { Item } from './types';
2
+ declare function MenuList(props: {
3
+ items: Item[];
4
+ level: number;
5
+ parentId?: number;
6
+ onAddEvent: (id: number) => void;
7
+ onRemoveEvent: (id: number) => void;
8
+ onUpdateEvent: (id: number) => void;
9
+ onSortingEvent: (sortedItems: Item[], parentId?: number) => void;
10
+ }): import("react/jsx-runtime").JSX.Element;
11
+ export default MenuList;
@@ -0,0 +1,27 @@
1
+ export type Item = {
2
+ id: number;
3
+ title: string;
4
+ order: number;
5
+ target: string;
6
+ url?: string;
7
+ contentId?: string;
8
+ contentModel?: string;
9
+ metadata?: Record<string, any>;
10
+ children: Item[];
11
+ selected: boolean;
12
+ };
13
+ export type RequestEditInput = {
14
+ uid: string;
15
+ title: string;
16
+ children: RequestEditChildInput[];
17
+ };
18
+ export type RequestEditChildInput = {
19
+ title: string;
20
+ order: number;
21
+ target: string;
22
+ url?: string;
23
+ contentId?: string;
24
+ contentModel?: string;
25
+ metadata?: Record<string, any>;
26
+ children: RequestEditChildInput[];
27
+ };
@@ -0,0 +1,11 @@
1
+ import { ReactNode } from 'react';
2
+ type SettingsProviderProps = {
3
+ children: ReactNode;
4
+ };
5
+ type SettingsContextData = {
6
+ provide(module: string): Record<string, any>;
7
+ };
8
+ export declare function SettingsProvider({ children }: SettingsProviderProps): import("react/jsx-runtime").JSX.Element;
9
+ export declare const SettingsContext: import("react").Context<SettingsContextData>;
10
+ export declare function useSettings(): SettingsContextData;
11
+ export {};
@@ -0,0 +1,14 @@
1
+ declare const _default: {
2
+ pluginId: string;
3
+ uuid: {
4
+ modules: {
5
+ menu: string;
6
+ attribute: string;
7
+ parameter: string;
8
+ slug: string;
9
+ translation: string;
10
+ template: string;
11
+ };
12
+ };
13
+ };
14
+ export default _default;
@@ -0,0 +1,8 @@
1
+ export default class Registry {
2
+ private dependencies;
3
+ private static instance;
4
+ private constructor();
5
+ provide(name: string, dependency: any): void;
6
+ inject(name: string): any;
7
+ static getInstance(): Registry;
8
+ }
@@ -0,0 +1,12 @@
1
+ import Event from './event';
2
+ export default class AppSettingsUpdated implements Event {
3
+ readonly data: AppSettingsUpdatedData;
4
+ id: string;
5
+ static id: string;
6
+ constructor(data: AppSettingsUpdatedData);
7
+ }
8
+ export type AppSettingsUpdatedData = {
9
+ module: string;
10
+ property: string;
11
+ value: any;
12
+ };
@@ -0,0 +1,10 @@
1
+ import Event from './event';
2
+ export default class DocumentCustomFieldStarted implements Event {
3
+ readonly data: DocumentCustomFieldStartedData;
4
+ id: string;
5
+ static id: string;
6
+ constructor(data: DocumentCustomFieldStartedData);
7
+ }
8
+ export type DocumentCustomFieldStartedData = {
9
+ name: string;
10
+ };
@@ -0,0 +1,4 @@
1
+ export default interface Event {
2
+ id: string;
3
+ data: Record<string, any>;
4
+ }
@@ -0,0 +1,10 @@
1
+ import Event from './event';
2
+ export default class PageAttributeUpdated implements Event {
3
+ readonly data: PageAttributeUpdatedData;
4
+ id: string;
5
+ static id: string;
6
+ constructor(data: PageAttributeUpdatedData);
7
+ }
8
+ export type PageAttributeUpdatedData = {
9
+ parentSlug: string;
10
+ };
@@ -0,0 +1,29 @@
1
+ import HttpClient from "../http/httpClient";
2
+ export default interface AttributeGateway {
3
+ fetch(params: Record<string, any>): Promise<FetchOutput[]>;
4
+ fetchByContentId(contentId: string, params: Record<string, any>): Promise<FetchOutput[]>;
5
+ delete(data: string[], params: Record<string, any>): Promise<void>;
6
+ }
7
+ export declare class AttributeGatewayHttp implements AttributeGateway {
8
+ httpClient: HttpClient;
9
+ constructor();
10
+ fetch(params?: Record<string, any>): Promise<FetchOutput[]>;
11
+ fetchByContentId(contentId: string, params?: Record<string, any>): Promise<FetchOutput[]>;
12
+ delete(contentIds: string[], params?: Record<string, any>): Promise<void>;
13
+ }
14
+ type FetchOutput = {
15
+ id: number;
16
+ documentId: string;
17
+ createdAt: string;
18
+ updatedAt: string;
19
+ publishedAt: string;
20
+ contentId: string;
21
+ contentModel: string;
22
+ contentTitle: string;
23
+ parentContentId: string;
24
+ parentContentModel: string;
25
+ templateId: string;
26
+ templateTitle: string;
27
+ locale: string;
28
+ };
29
+ export {};
@@ -0,0 +1,20 @@
1
+ import HttpClient from "../http/httpClient";
2
+ export default interface LocalesGateway {
3
+ fetch(): Promise<FetchOutput[]>;
4
+ }
5
+ export declare class LocaleGatewayHttp implements LocalesGateway {
6
+ httpClient: HttpClient;
7
+ constructor();
8
+ fetch(): Promise<FetchOutput[]>;
9
+ }
10
+ type FetchOutput = {
11
+ id: number;
12
+ documentId: string;
13
+ name: string;
14
+ code: string;
15
+ createdAt: string;
16
+ updatedAt: string;
17
+ publishedAt: string;
18
+ isDefault: boolean;
19
+ };
20
+ export {};
@@ -0,0 +1,82 @@
1
+ import HttpClient from "../http/httpClient";
2
+ export default interface MenuGateway {
3
+ fetch(params: Record<string, any>): Promise<FetchOutput[]>;
4
+ fetchByDocumentId(documentId: string): Promise<FetchWithChildrenOutput>;
5
+ delete(documentIds: string[], params: Record<string, any>): Promise<void>;
6
+ duplicate(documentId: string, locale: string): Promise<void>;
7
+ create(params: {
8
+ uid: string;
9
+ title: string;
10
+ locale: string;
11
+ }): Promise<void>;
12
+ edit(documentId: string, params: {
13
+ uid: string;
14
+ title: string;
15
+ children: ChildrenInput[];
16
+ }): Promise<void>;
17
+ }
18
+ export declare class MenuGatewayHttp implements MenuGateway {
19
+ httpClient: HttpClient;
20
+ constructor();
21
+ fetch(params?: Record<string, any>): Promise<FetchOutput[]>;
22
+ fetchByDocumentId(documentId: string): Promise<FetchWithChildrenOutput>;
23
+ delete(documentIds: string[], params?: Record<string, any>): Promise<void>;
24
+ duplicate(documentId: string, locale: string): Promise<void>;
25
+ create(params: {
26
+ uid: string;
27
+ title: string;
28
+ locale: string;
29
+ }): Promise<void>;
30
+ edit(documentId: string, params: {
31
+ uid: string;
32
+ title: string;
33
+ children: ChildrenInput[];
34
+ }): Promise<void>;
35
+ }
36
+ type FetchOutput = {
37
+ id: number;
38
+ documentId: string;
39
+ createdAt: string;
40
+ updatedAt: string;
41
+ publishedAt: string;
42
+ title: string;
43
+ uid: string;
44
+ locale: string;
45
+ };
46
+ type FetchWithChildrenOutput = {
47
+ id: number;
48
+ documentId: string;
49
+ createdAt: string;
50
+ updatedAt: string;
51
+ publishedAt: string;
52
+ title: string;
53
+ uid: string;
54
+ locale: string;
55
+ children?: {
56
+ id: number;
57
+ documentId: string;
58
+ createdAt: string;
59
+ updatedAt: string;
60
+ publishedAt: string;
61
+ uid: string;
62
+ parentId: string;
63
+ title: string;
64
+ url: string;
65
+ target: string;
66
+ order: number;
67
+ contentId?: string;
68
+ contentModel?: string;
69
+ metadata?: Record<string, any>;
70
+ }[];
71
+ };
72
+ interface ChildrenInput {
73
+ title: string;
74
+ order: number;
75
+ target: string;
76
+ url?: string;
77
+ contentId?: string;
78
+ contentModel?: string;
79
+ metadata?: Record<string, any>;
80
+ children?: ChildrenInput[];
81
+ }
82
+ export {};
@@ -0,0 +1,42 @@
1
+ import HttpClient from "../http/httpClient";
2
+ export default interface ParameterGateway {
3
+ fetch(params: Record<string, any>): Promise<FetchOutput[]>;
4
+ delete(documentIds: string[]): Promise<void>;
5
+ create(params: {
6
+ uid: string;
7
+ value: string;
8
+ private: boolean;
9
+ }): Promise<void>;
10
+ edit(documentId: string, params: {
11
+ uid: string;
12
+ value: string;
13
+ private: boolean;
14
+ }): Promise<void>;
15
+ }
16
+ export declare class ParameterGatewayHttp implements ParameterGateway {
17
+ httpClient: HttpClient;
18
+ constructor();
19
+ fetch(): Promise<FetchOutput[]>;
20
+ delete(documentIds: string[], params?: Record<string, any>): Promise<void>;
21
+ create(params: {
22
+ uid: string;
23
+ value: string;
24
+ private: boolean;
25
+ }): Promise<void>;
26
+ edit(documentId: string, params: {
27
+ uid: string;
28
+ value: string;
29
+ private: boolean;
30
+ }): Promise<void>;
31
+ }
32
+ type FetchOutput = {
33
+ id: number;
34
+ documentId: string;
35
+ createdAt: string;
36
+ updatedAt: string;
37
+ publishedAt: string;
38
+ uid: string;
39
+ value: string;
40
+ private: boolean;
41
+ };
42
+ export {};
@@ -0,0 +1,21 @@
1
+ import HttpClient from "../http/httpClient";
2
+ export default interface SettingGateway {
3
+ fetch(): Promise<FetchOutput[]>;
4
+ update(data: UpdateInput): Promise<void>;
5
+ }
6
+ export declare class SettingGatewayHttp implements SettingGateway {
7
+ httpClient: HttpClient;
8
+ constructor();
9
+ fetch(): Promise<FetchOutput[]>;
10
+ update(data: UpdateInput): Promise<void>;
11
+ }
12
+ type FetchOutput = {
13
+ module: string;
14
+ settings: Record<string, any>;
15
+ };
16
+ type UpdateInput = {
17
+ module: string;
18
+ property: string;
19
+ value: any;
20
+ };
21
+ export {};
@@ -0,0 +1,26 @@
1
+ import HttpClient from "../http/httpClient";
2
+ export default interface SlugGateway {
3
+ fetch(params: Record<string, any>): Promise<FetchOutput[]>;
4
+ delete(data: string[], params: Record<string, any>): Promise<void>;
5
+ }
6
+ export declare class SlugGatewayHttp implements SlugGateway {
7
+ httpClient: HttpClient;
8
+ constructor();
9
+ fetch(params?: Record<string, any>): Promise<FetchOutput[]>;
10
+ delete(contentIds: string[], params?: Record<string, any>): Promise<void>;
11
+ }
12
+ type FetchOutput = {
13
+ id: number;
14
+ documentId: string;
15
+ createdAt: string;
16
+ updatedAt: string;
17
+ publishedAt: string;
18
+ slug: string;
19
+ contentId: string;
20
+ contentTitle: string;
21
+ contentModel: string;
22
+ parentContentId: string;
23
+ parentContentModel: string;
24
+ locale: string;
25
+ };
26
+ export {};
@@ -0,0 +1,37 @@
1
+ import HttpClient from "../http/httpClient";
2
+ export default interface TemplateGateway {
3
+ fetch(): Promise<FetchOutput[]>;
4
+ delete(documentIds: string[]): Promise<void>;
5
+ create(params: {
6
+ uid: string;
7
+ name: string;
8
+ }): Promise<void>;
9
+ edit(documentId: string, params: {
10
+ uid: string;
11
+ name: string;
12
+ }): Promise<void>;
13
+ }
14
+ export declare class TemplateGatewayHttp implements TemplateGateway {
15
+ httpClient: HttpClient;
16
+ constructor();
17
+ fetch(params?: Record<string, any>): Promise<FetchOutput[]>;
18
+ delete(documentIds: string[], params?: Record<string, any>): Promise<void>;
19
+ create(params: {
20
+ uid: string;
21
+ name: string;
22
+ }): Promise<void>;
23
+ edit(documentId: string, params: {
24
+ uid: string;
25
+ name: string;
26
+ }): Promise<void>;
27
+ }
28
+ type FetchOutput = {
29
+ id: number;
30
+ documentId: string;
31
+ createdAt: string;
32
+ updatedAt: string;
33
+ publishedAt: string;
34
+ uid: string;
35
+ name: string;
36
+ };
37
+ export {};
@@ -0,0 +1,42 @@
1
+ import HttpClient from "../http/httpClient";
2
+ export default interface TranslationGateway {
3
+ fetch(): Promise<FetchOutput[]>;
4
+ delete(uids: string[]): Promise<void>;
5
+ create(params: {
6
+ uid: string;
7
+ translation: string;
8
+ locale: string;
9
+ }[]): Promise<void>;
10
+ edit(uids: string, params: {
11
+ uid: string;
12
+ translation: string;
13
+ locale: string;
14
+ }[]): Promise<void>;
15
+ }
16
+ export declare class TranslationGatewayHttp implements TranslationGateway {
17
+ httpClient: HttpClient;
18
+ constructor();
19
+ fetch(): Promise<FetchOutput[]>;
20
+ delete(uids: string[], params?: Record<string, any>): Promise<void>;
21
+ create(params: {
22
+ uid: string;
23
+ translation: string;
24
+ locale: string;
25
+ }[]): Promise<void>;
26
+ edit(uid: string, params: {
27
+ uid: string;
28
+ translation: string;
29
+ locale: string;
30
+ }[]): Promise<void>;
31
+ }
32
+ type FetchOutput = {
33
+ id: number;
34
+ documentId: string;
35
+ createdAt: string;
36
+ updatedAt: string;
37
+ publishedAt: string;
38
+ uid: string;
39
+ translation: string;
40
+ locale: string;
41
+ };
42
+ export {};
@@ -0,0 +1,18 @@
1
+ export default interface HttpClient {
2
+ get(url: string): Promise<any>;
3
+ post(url: string, body: any): Promise<any>;
4
+ put(url: string, body: any): Promise<any>;
5
+ delete(url: string, body?: any): Promise<any>;
6
+ }
7
+ export declare class AxiosAdapter implements HttpClient {
8
+ get(url: string): Promise<any>;
9
+ post(url: string, body: any): Promise<any>;
10
+ put(url: string, body: any): Promise<any>;
11
+ delete(url: string, body?: any): Promise<any>;
12
+ }
13
+ export declare class StrapiAdapter implements HttpClient {
14
+ get(url: string): Promise<any>;
15
+ post(url: string, body: any): Promise<any>;
16
+ put(url: string, body: any): Promise<any>;
17
+ delete(url: string, body: any): Promise<any>;
18
+ }
@@ -0,0 +1,11 @@
1
+ import Event from "../events/event";
2
+ export type Subscription = {
3
+ unsubscribe: () => void;
4
+ };
5
+ export default class Mediator {
6
+ private handlers;
7
+ constructor();
8
+ subscribe(event: string, callback: Function): Subscription;
9
+ unsubscribe(event: string, callback: Function): void;
10
+ notify(event: Event): Promise<void>;
11
+ }
@@ -0,0 +1,10 @@
1
+ import MenuGateway from '../gateways/menuGateway';
2
+ export default class CreateMenu {
3
+ menuGateway: MenuGateway;
4
+ constructor();
5
+ execute(params: {
6
+ uid: string;
7
+ title: string;
8
+ locale: string;
9
+ }): Promise<void>;
10
+ }