@opengis/cms 0.0.48 → 0.0.49

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opengis/cms",
3
- "version": "0.0.48",
3
+ "version": "0.0.49",
4
4
  "description": "cms",
5
5
  "type": "module",
6
6
  "author": "Softpro",
@@ -40,7 +40,7 @@
40
40
  "devDependencies": {
41
41
  "@fastify/compress": "^8.1.0",
42
42
  "@opengis/core": "^0.0.30",
43
- "@opengis/fastify-table": "^2.0.136",
43
+ "@opengis/fastify-table": "^2.0.137",
44
44
  "@opengis/filter": "^0.1.31",
45
45
  "@opengis/form": "^0.0.109",
46
46
  "@opengis/richtext": "0.0.38",
@@ -19,7 +19,7 @@ const mockReply = {
19
19
  },
20
20
  };
21
21
 
22
- export default async function getContentBySlug(slug, { filter, tags, state, locale, contextQuery, collection = 'pages', ttl = 3600, fields, limit = 12, page = 1 } = {}) {
22
+ export default async function getContentBySlug({ slug, filter, tags, state, locale, contextQuery, collection = 'pages', ttl = 3600, fields, limit = 12, page = 1 } = {}) {
23
23
  if (!slug) {
24
24
  // return { error: 'not enough params: slug', code: 400 };
25
25
  }
@@ -19,7 +19,7 @@ const mockReply = {
19
19
  },
20
20
  };
21
21
 
22
- export default async function getSearchData({ page = 1, limit = 12, ttl = 3600, locale, tags, filter, contentType, asc } = {}) {
22
+ export default async function getSearchData({ page = 1, limit = 12, ttl = 3600, search, locale, tags, filter, contentType, asc } = {}) {
23
23
  // check if any crud operations performed, if not - return cached response
24
24
  const crudInc = await rclient.get(`pg:site.contents:crud`) || 0;
25
25
 
@@ -31,7 +31,7 @@ export default async function getSearchData({ page = 1, limit = 12, ttl = 3600,
31
31
  return { cache: true, ...cacheData };
32
32
  }
33
33
 
34
- const result = await searchContent({ pg, query: { locale, page, limit, tags, filter, contentType } }, mockReply);
34
+ const result = await searchContent({ pg, query: { search, locale, page, limit, tags, filter, contentType } }, mockReply);
35
35
 
36
36
  if (ttl) {
37
37
  await rclient.set(cacheKey, JSON.stringify(result), 'EX', ttl);
@@ -35,6 +35,7 @@ export default async function searchContent({
35
35
 
36
36
  const {
37
37
  locale, // to do?
38
+ search,
38
39
  filter,
39
40
  contentType,
40
41
  asc,
@@ -58,6 +59,7 @@ export default async function searchContent({
58
59
  pg,
59
60
  table: 'site.contents',
60
61
  filter,
62
+ search,
61
63
  query: `status='published'`,
62
64
  filterList,
63
65
  }) : { q: `status='published'` };
package/utils.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  interface ContentParam {
2
+ slug?: string;
2
3
  locale?: string;
3
4
  ttl?: number;
4
5
  page?: number;
@@ -35,6 +36,7 @@ interface Setting {
35
36
  interface SearchParam {
36
37
  contentType?: string;
37
38
  filter?: string;
39
+ search?: string;
38
40
  locale?: string;
39
41
  tags?: string;
40
42
  page?: number;
@@ -43,7 +45,7 @@ interface SearchParam {
43
45
  ttl?: number;
44
46
  }
45
47
 
46
- export function getContent(slug?: string, param?: ContentParam): any;
48
+ export function getContent(param?: ContentParam): any;
47
49
  export function getMenu(slug: string, param?: MenuParam): any;
48
50
  export function getSettings(param?: SettingParam): any;
49
51
  export function getUser(cookies: string | Record<string, any>): any;
@@ -1,4 +0,0 @@
1
- import { MenuAddPage as e } from "./index.js";
2
- export {
3
- e as default
4
- };
@@ -1,4 +0,0 @@
1
- import { MenuItemPage as e } from "./index.js";
2
- export {
3
- e as default
4
- };
@@ -1,4 +0,0 @@
1
- import { MenuPage as e } from "./index.js";
2
- export {
3
- e as default
4
- };