@q2devel/q2-core 1.0.6 → 1.0.7

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.
@@ -1 +1 @@
1
- {"version":3,"file":"getBanners.d.ts","sourceRoot":"","sources":["../../../api/content/getBanners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGzD,KAAK,eAAe,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,KAAK,UAAU,CAAC;CACpD,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,KAAK,WAAW,EAChB,qBAAqB,eAAe,KACnC,OAAO,CAAC,UAAU,EAAE,CAoCtB,CAAC"}
1
+ {"version":3,"file":"getBanners.d.ts","sourceRoot":"","sources":["../../../api/content/getBanners.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAE5C,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAGzD,KAAK,eAAe,GAAG;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,GAAG,KAAK,UAAU,CAAC;CACpD,CAAC;AAEF,eAAO,MAAM,UAAU,GACrB,KAAK,WAAW,EAChB,qBAAqB,eAAe,KACnC,OAAO,CAAC,UAAU,EAAE,CA6CtB,CAAC"}
@@ -2,6 +2,11 @@ import { DrupalJsonApiParams } from 'drupal-jsonapi-params';
2
2
  import mapIncludedResources from '../../utils/mapIncludedResources';
3
3
  export const getBanners = async (ctx, { location, mapFn }) => {
4
4
  const cacheKey = ['banner', ctx.locale, location].join(':');
5
+ if (ctx.getCache) {
6
+ const cached = await ctx.getCache(cacheKey);
7
+ if (cached)
8
+ return cached;
9
+ }
5
10
  const url = ctx.locale === ctx.defaultLocale
6
11
  ? `/jsonapi/media/banners`
7
12
  : `/${ctx.locale}/jsonapi/media/banners`;
@@ -28,5 +33,8 @@ export const getBanners = async (ctx, { location, mapFn }) => {
28
33
  };
29
34
  return mapFn ? mapFn(base, item) : base;
30
35
  });
36
+ if (ctx.setCache) {
37
+ await ctx.setCache(cacheKey, mapped);
38
+ }
31
39
  return mapped;
32
40
  };
@@ -36,8 +36,8 @@ export const getBlog = async (ctx, { blogId, limit, include = ['field_image'], m
36
36
  };
37
37
  return mapFn ? mapFn(base, item) : base;
38
38
  });
39
- // if (ctx.setCache) {
40
- // await ctx.setCache(cacheKey, mapped);
41
- // }
39
+ if (ctx.setCache) {
40
+ await ctx.setCache(cacheKey, mapped);
41
+ }
42
42
  return mapped;
43
43
  };
@@ -1 +1 @@
1
- {"version":3,"file":"getTerms.d.ts","sourceRoot":"","sources":["../../api/getTerms.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAIrC,KAAK,aAAa,GAAG;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD,CAAC;AAEF,eAAO,MAAM,QAAQ,GACnB,KAAK,WAAW,EAChB,gCAA0F,aAAa,KACtG,OAAO,CAAC,IAAI,EAAE,CAsEhB,CAAC"}
1
+ {"version":3,"file":"getTerms.d.ts","sourceRoot":"","sources":["../../api/getTerms.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAEzC,OAAO,EAAE,IAAI,EAAE,MAAM,eAAe,CAAC;AAIrC,KAAK,aAAa,GAAG;IACnB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CACxD,CAAC;AAEF,eAAO,MAAM,QAAQ,GACnB,KAAK,WAAW,EAChB,gCAA0I,aAAa,KACtJ,OAAO,CAAC,IAAI,EAAE,CAsEhB,CAAC"}
@@ -1,10 +1,11 @@
1
1
  // api/getTerms.ts
2
2
  import { DrupalJsonApiParams } from 'drupal-jsonapi-params';
3
3
  import mapIncludedResources from '../utils/mapIncludedResources';
4
- export const getTerms = async (ctx, { categoryId, include = ['parent', 'field_icon', 'field_icon.field_media_image'], mapFn }) => {
4
+ export const getTerms = async (ctx, { categoryId, include = ['parent', 'field_icon', 'field_icon.field_media_image', 'field_image', 'field_image.field_media_image'], mapFn }) => {
5
5
  const cacheKey = ['terms', ctx.locale, ...(categoryId ?? []), ...(include ?? [])].join(':');
6
- // const cached = await ctx.getCache?.<Term[]>(cacheKey);
7
- // if (cached) return cached;
6
+ const cached = await ctx.getCache?.(cacheKey);
7
+ if (cached)
8
+ return cached;
8
9
  const baseUrl = ctx.locale === ctx.defaultLocale
9
10
  ? `/jsonapi/taxonomy_term/produktykategorie`
10
11
  : `/${ctx.locale}/jsonapi/taxonomy_term/produktykategorie`;
@@ -49,9 +50,10 @@ export const getTerms = async (ctx, { categoryId, include = ['parent', 'field_ic
49
50
  description: item.description?.processed ?? '',
50
51
  parent: item.parent?.[0],
51
52
  icon: item?.field_icon?.field_media_image.uri?.url ? ctx.makeAbsoluteUrl(item.field_icon.field_media_image.uri.url) : undefined,
53
+ image: item?.field_image?.field_media_image.uri?.url ? ctx.makeAbsoluteUrl(item.field_image.field_media_image.uri.url) : undefined,
52
54
  };
53
55
  return mapFn ? await mapFn(base, item) : base;
54
56
  }));
55
- // await ctx.setCache?.(cacheKey, mapped);
57
+ await ctx.setCache?.(cacheKey, mapped);
56
58
  return mapped;
57
59
  };
@@ -1 +1 @@
1
- {"version":3,"file":"branch.service.d.ts","sourceRoot":"","sources":["../../../../api/pages/branch/branch.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,KAAK,cAAc,GAAG;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CAC9C,CAAC;AAEF,eAAO,MAAM,SAAS,GACpB,KAAK,WAAW,EAChB,oBAAuC,cAAc,KACpD,OAAO,CAAC,OAAO,GAAG,IAAI,CA8CxB,CAAC"}
1
+ {"version":3,"file":"branch.service.d.ts","sourceRoot":"","sources":["../../../../api/pages/branch/branch.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAEhD,KAAK,cAAc,GAAG;IACpB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,EAAE,GAAG,EAAE,GAAG,KAAK,OAAO,CAAC;CAC9C,CAAC;AAEF,eAAO,MAAM,SAAS,GACpB,KAAK,WAAW,EAChB,oBAAuC,cAAc,KACpD,OAAO,CAAC,OAAO,GAAG,IAAI,CAgDxB,CAAC"}
@@ -2,10 +2,11 @@ import { DrupalJsonApiParams } from 'drupal-jsonapi-params';
2
2
  import mapIncludedResources from '../../../utils/mapIncludedResources';
3
3
  export const getBranch = async (ctx, { include = ['field_branch'], mapFn }) => {
4
4
  const cacheKey = ['branch', ctx.locale].join(':');
5
- // const cached = await ctx.redis.get(cacheKey);
6
- // if (cached) {
7
- // return cached as Contact;
8
- // }
5
+ if (ctx.getCache) {
6
+ const cached = await ctx.getCache(cacheKey);
7
+ if (cached)
8
+ return cached;
9
+ }
9
10
  const url = ctx.locale === ctx.defaultLocale
10
11
  ? `/jsonapi/node/contact_page`
11
12
  : `/${ctx.locale}/jsonapi/node/contact_page`;
@@ -34,6 +35,8 @@ export const getBranch = async (ctx, { include = ['field_branch'], mapFn }) => {
34
35
  })) || [],
35
36
  };
36
37
  const mapped = mapFn ? mapFn(base, contactBranchSection) : base;
37
- // await ctx.redis.set(cacheKey, mapped);
38
+ if (ctx.setCache) {
39
+ await ctx.setCache(cacheKey, mapped);
40
+ }
38
41
  return mapped;
39
42
  };
@@ -1 +1 @@
1
- {"version":3,"file":"faq.service.d.ts","sourceRoot":"","sources":["../../../../api/pages/faq/faq.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,MAAM,GACjB,KAAK,WAAW,EAChB,oBAA0C,WAAW,KACpD,OAAO,CAAC,GAAG,GAAG,IAAI,CAwCpB,CAAC"}
1
+ {"version":3,"file":"faq.service.d.ts","sourceRoot":"","sources":["../../../../api/pages/faq/faq.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAEzC,KAAK,WAAW,GAAG;IACjB,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,KAAK,GAAG,CAAC;CACtC,CAAC;AAEF,eAAO,MAAM,MAAM,GACjB,KAAK,WAAW,EAChB,oBAA0C,WAAW,KACpD,OAAO,CAAC,GAAG,GAAG,IAAI,CA0CpB,CAAC"}
@@ -2,10 +2,11 @@ import { DrupalJsonApiParams } from 'drupal-jsonapi-params';
2
2
  import mapIncludedResources from '../../../utils/mapIncludedResources';
3
3
  export const getFaq = async (ctx, { include = ['field_questions'], mapFn }) => {
4
4
  const cacheKey = ['faq', ctx.locale].join(':');
5
- // const cached = await ctx.redis.get(cacheKey);
6
- // if (cached) {
7
- // return cached as Faq;
8
- // }
5
+ if (ctx.getCache) {
6
+ const cached = await ctx.getCache(cacheKey);
7
+ if (cached)
8
+ return cached;
9
+ }
9
10
  const url = ctx.locale === ctx.defaultLocale
10
11
  ? `/jsonapi/node/faq`
11
12
  : `/${ctx.locale}/jsonapi/node/faq`;
@@ -28,6 +29,8 @@ export const getFaq = async (ctx, { include = ['field_questions'], mapFn }) => {
28
29
  })) || [],
29
30
  };
30
31
  const mapped = mapFn ? mapFn(base, faqItem) : base;
31
- // await ctx.redis.set(cacheKey, mapped);
32
+ if (ctx.setCache) {
33
+ await ctx.setCache(cacheKey, mapped);
34
+ }
32
35
  return mapped;
33
36
  };
@@ -1 +1 @@
1
- {"version":3,"file":"page.service.d.ts","sourceRoot":"","sources":["../../../../api/pages/page/page.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,OAAO,GAClB,KAAK,WAAW,EAChB,4BAA4C,YAAY,KACvD,OAAO,CAAC,IAAI,GAAG,IAAI,CAwCrB,CAAC"}
1
+ {"version":3,"file":"page.service.d.ts","sourceRoot":"","sources":["../../../../api/pages/page/page.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAG/C,OAAO,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAC;AAE3C,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;IACnB,KAAK,CAAC,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;CACxC,CAAC;AAEF,eAAO,MAAM,OAAO,GAClB,KAAK,WAAW,EAChB,4BAA4C,YAAY,KACvD,OAAO,CAAC,IAAI,GAAG,IAAI,CA0CrB,CAAC"}
@@ -2,10 +2,11 @@ import { DrupalJsonApiParams } from 'drupal-jsonapi-params';
2
2
  import mapIncludedResources from '../../../utils/mapIncludedResources';
3
3
  export const getPage = async (ctx, { pageId, include = ['node_type'], mapFn }) => {
4
4
  const cacheKey = ['page', ctx.locale, pageId].join(':');
5
- // const cached = await ctx.redis.get(cacheKey);
6
- // if (cached) {
7
- // return cached as Page;
8
- // }
5
+ if (ctx.getCache) {
6
+ const cached = await ctx.getCache(cacheKey);
7
+ if (cached)
8
+ return cached;
9
+ }
9
10
  const url = ctx.locale === ctx.defaultLocale
10
11
  ? `/jsonapi/node/page`
11
12
  : `/${ctx.locale}/jsonapi/node/page`;
@@ -28,6 +29,8 @@ export const getPage = async (ctx, { pageId, include = ['node_type'], mapFn }) =
28
29
  return mapFn ? mapFn(base, item) : base;
29
30
  });
30
31
  const page = mappedPages[0];
31
- // await ctx.redis.set(cacheKey, page);
32
+ if (ctx.setCache) {
33
+ await ctx.setCache(cacheKey, page);
34
+ }
32
35
  return page;
33
36
  };
@@ -17,12 +17,13 @@ export const getProducts = async (ctx, { categoryId, productId, searchTerm, limi
17
17
  offset ? `offset:${offset}` : '',
18
18
  filters.length ? `filters:${JSON.stringify(filters)}` : '',
19
19
  sort ? `sort:${sort}` : '',
20
- tag ? `tag:${tag}` : '',
20
+ // tag ? `tag:${tag}` : '',
21
21
  ].filter(Boolean).join(':');
22
- // if (cache && ctx.getCache) {
23
- // const cached = await ctx.getCache<Product[]>(cacheKey);
24
- // if (cached) return cached;
25
- // }
22
+ if (cache && ctx.getCache) {
23
+ const cached = await ctx.getCache(cacheKey);
24
+ if (cached)
25
+ return cached;
26
+ }
26
27
  const params = new DrupalJsonApiParams()
27
28
  .addInclude(include)
28
29
  .addFilter('langcode', ctx.locale);
@@ -56,9 +57,9 @@ export const getProducts = async (ctx, { categoryId, productId, searchTerm, limi
56
57
  }
57
58
  return base;
58
59
  }));
59
- // if (cache && ctx.setCache) {
60
- // await ctx.setCache(cacheKey, mappedProducts);
61
- // }
60
+ if (cache && ctx.setCache) {
61
+ await ctx.setCache(cacheKey, mappedProducts);
62
+ }
62
63
  return mappedProducts;
63
64
  };
64
65
  export const getProductCount = async (ctx, { categoryId = [], tag = '', cache = true, }) => {
@@ -0,0 +1 @@
1
+ //# sourceMappingURL=getUserCart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getUserCart.d.ts","sourceRoot":"","sources":["../../../api/user/getUserCart.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ "use strict";
@@ -0,0 +1,8 @@
1
+ export type ResetPasswordResponse = {
2
+ data: {
3
+ id: string;
4
+ email: string;
5
+ };
6
+ status: number;
7
+ };
8
+ //# sourceMappingURL=ResetPassword.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResetPassword.d.ts","sourceRoot":"","sources":["../../types/ResetPassword.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -12,5 +12,6 @@ export type Term = {
12
12
  drupal_internal__tid?: string;
13
13
  } | null;
14
14
  icon?: string;
15
+ image?: string;
15
16
  };
16
17
  //# sourceMappingURL=Term.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Term.d.ts","sourceRoot":"","sources":["../../types/Term.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC;IAClB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,oBAAoB,CAAC,EAAE,MAAM,CAAC;KAC/B,GAAG,IAAI,CAAC;IACT,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC"}
1
+ {"version":3,"file":"Term.d.ts","sourceRoot":"","sources":["../../types/Term.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,IAAI,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,IAAI,EAAE,CAAC;IAClB,MAAM,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,EAAE,EAAE,MAAM,CAAC;QACX,oBAAoB,CAAC,EAAE,MAAM,CAAC;KAC/B,GAAG,IAAI,CAAC;IACT,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -0,0 +1,8 @@
1
+ export type ResetPasswordResponse = {
2
+ data: {
3
+ id: string;
4
+ email: string;
5
+ };
6
+ status: number;
7
+ };
8
+ //# sourceMappingURL=ResetPassword.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ResetPassword.d.ts","sourceRoot":"","sources":["../../../types/content/ResetPassword.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE;QACJ,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@q2devel/q2-core",
3
- "version": "1.0.6",
3
+ "version": "1.0.7",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "exports": {