@rxdrag/website-lib-core 0.0.126 → 0.0.128
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/README.md +1 -1
- package/index.ts +1 -1
- package/package.json +2 -2
- package/src/astro/animation.ts +146 -146
- package/src/astro/background.ts +82 -53
- package/src/astro/base.ts +7 -0
- package/src/astro/business.ts +13 -0
- package/src/astro/grid/consts.ts +80 -80
- package/src/astro/grid/index.ts +2 -2
- package/src/astro/grid/types.ts +35 -35
- package/src/astro/image.ts +239 -239
- package/src/astro/index.ts +12 -9
- package/src/astro/link.ts +20 -0
- package/src/astro/media.ts +123 -123
- package/src/astro/nav.ts +13 -13
- package/src/astro/section/index.ts +7 -12
- package/src/component-logic/index.ts +1 -1
- package/src/component-logic/link-client.ts +32 -32
- package/src/component-logic/link.ts +61 -61
- package/src/design-tokens.ts +160 -160
- package/src/entify/Entify.ts +533 -530
- package/src/entify/IEntify.ts +151 -177
- package/src/entify/index.ts +4 -4
- package/src/entify/lib/collectCategoryIds.ts +20 -20
- package/src/entify/lib/fulltextSearch.ts +63 -62
- package/src/entify/lib/langFields.ts +14 -14
- package/src/entify/lib/listToTree.ts +23 -23
- package/src/entify/lib/newAvatarQueryOptions.ts +4 -4
- package/src/entify/lib/newOgImageQueryOptions.ts +5 -5
- package/src/entify/lib/newQueryPostOptions.ts +42 -45
- package/src/entify/lib/newQueryProductOptions.ts +96 -98
- package/src/entify/lib/newQueryProductsMediaOptions.ts +28 -28
- package/src/entify/lib/queryAllProducts.ts +40 -40
- package/src/entify/lib/queryBulletin.ts +28 -16
- package/src/entify/lib/queryEntityList.ts +41 -41
- package/src/entify/lib/queryFeaturedProducts.ts +69 -68
- package/src/entify/lib/queryLangs.ts +36 -60
- package/src/entify/lib/queryLatestPosts.ts +92 -91
- package/src/entify/lib/queryOneEntity.ts +63 -63
- package/src/entify/lib/queryOneMedia.ts +27 -27
- package/src/entify/lib/queryOnePostById.ts +21 -21
- package/src/entify/lib/queryOnePostBySlug.ts +40 -39
- package/src/entify/lib/queryOnePostCategoryBySlug.ts +35 -35
- package/src/entify/lib/queryOneProductById.ts +20 -20
- package/src/entify/lib/queryOneProductBySlug.ts +53 -52
- package/src/entify/lib/queryOneProductCategoryBySlug.ts +50 -49
- package/src/entify/lib/queryOneTheme.ts +54 -72
- package/src/entify/lib/queryOneUser.ts +38 -38
- package/src/entify/lib/queryPostCategories.ts +67 -67
- package/src/entify/lib/queryPostSlugs.ts +37 -37
- package/src/entify/lib/queryPosts.ts +175 -174
- package/src/entify/lib/queryProductCategories.ts +59 -59
- package/src/entify/lib/queryProducts.ts +145 -144
- package/src/entify/lib/queryProductsInMenu.ts +45 -45
- package/src/entify/lib/queryTagCategories.ts +58 -58
- package/src/entify/lib/queryTags.ts +57 -57
- package/src/entify/lib/queryUserIds.ts +24 -24
- package/src/entify/lib/queryUserPosts.ts +80 -79
- package/src/entify/lib/queryWebSiteSettings.ts +28 -28
- package/src/entify/lib/queryWebsite.ts +43 -43
- package/src/entify/lib/sendEmail.ts +7 -7
- package/src/entify/lib/toQueryOptions.ts +19 -19
- package/src/entify/lib/upsertEntity.ts +8 -8
- package/src/entify/types/index.ts +1 -1
- package/src/entify/types/utils.ts +11 -6
- package/src/entify/types/variables.ts +5 -6
- package/src/entify/view-model/funcs.ts +230 -230
- package/src/entify/view-model/index.ts +1 -1
- package/src/entify/view-model/models.ts +135 -135
- package/src/global.d.ts +7 -7
- package/src/index.ts +8 -8
- package/src/lib/formatDate.ts +15 -15
- package/src/lib/index.ts +3 -3
- package/src/lib/pagination.ts +114 -114
- package/src/lib/utils.ts +135 -135
- package/src/react/components/Analytics/eventHandlers.ts +173 -173
- package/src/react/components/Analytics/index.tsx +21 -21
- package/src/react/components/Analytics/singleton.ts +214 -214
- package/src/react/components/Analytics/tracking.ts +221 -221
- package/src/react/components/Analytics/types.ts +60 -60
- package/src/react/components/Analytics/utils.ts +95 -95
- package/src/react/components/AttachmentIcon/index.tsx +53 -53
- package/src/react/components/BackgroundHlsVideoPlayer.tsx +97 -97
- package/src/react/components/BackgroundVideoPlayer.tsx +32 -32
- package/src/react/components/Bulletin.tsx +30 -30
- package/src/react/components/ContactForm/ContactForm.tsx +289 -289
- package/src/react/components/ContactForm/Input.tsx +48 -48
- package/src/react/components/ContactForm/Input2.tsx +59 -59
- package/src/react/components/ContactForm/Submit.tsx +48 -48
- package/src/react/components/ContactForm/TelInput.tsx +215 -215
- package/src/react/components/ContactForm/Textarea.tsx +48 -48
- package/src/react/components/ContactForm/Textarea2.tsx +89 -89
- package/src/react/components/ContactForm/funcs.ts +64 -64
- package/src/react/components/ContactForm/index.ts +7 -7
- package/src/react/components/ContactForm/types.ts +68 -68
- package/src/react/components/GoogleConsent/CookieItemPanel.tsx +80 -80
- package/src/react/components/GoogleConsent/CumtomizedModal.tsx +148 -148
- package/src/react/components/GoogleConsent/GoogleConsent.tsx +100 -100
- package/src/react/components/GoogleConsent/gtags.ts +67 -67
- package/src/react/components/GoogleConsent/index.ts +2 -2
- package/src/react/components/GoogleConsent/types.ts +18 -18
- package/src/react/components/GoogleConsent//345/217/202/350/200/203.md +4 -4
- package/src/react/components/Icon/index.tsx +19 -19
- package/src/react/components/Medias/MainMedia.tsx +257 -257
- package/src/react/components/Medias/Thumbnail.tsx +62 -62
- package/src/react/components/Medias/VideoPlayer.tsx +114 -114
- package/src/react/components/Medias/index.tsx +271 -271
- package/src/react/components/ProductCard/ProductCard.tsx +24 -24
- package/src/react/components/ProductCard/ProductCta/index.tsx +28 -28
- package/src/react/components/ProductCard/ProductCta/style.css +3 -3
- package/src/react/components/ProductCard/ProductDescription/index.tsx +12 -12
- package/src/react/components/ProductCard/ProductDescription/style.css +5 -5
- package/src/react/components/ProductCard/ProductMedia/index.tsx +35 -35
- package/src/react/components/ProductCard/ProductMedia/style.css +5 -5
- package/src/react/components/ProductCard/ProductTitle/index.tsx +7 -7
- package/src/react/components/ProductCard/ProductTitle/style.css +3 -3
- package/src/react/components/ProductCard/ProductView.tsx +36 -36
- package/src/react/components/ProductCard/index.ts +4 -4
- package/src/react/components/ProductCard/useQueryProduct.ts +32 -32
- package/src/react/components/ReactModalTrigger.tsx +28 -28
- package/src/react/components/ReactVideoPlayer.tsx +29 -52
- package/src/react/components/RichTextOutline/index.tsx +75 -75
- package/src/react/components/RichTextOutline/useAnchorScroll.ts +23 -23
- package/src/react/components/Scroller.tsx +39 -39
- package/src/react/components/SearchInput.tsx +21 -21
- package/src/react/components/Share/index.tsx +86 -86
- package/src/react/components/Share/socials.tsx +79 -77
- package/src/react/components/Share//350/265/204/346/226/231.md +7 -7
- package/src/react/components/ToTop.tsx +72 -72
- package/src/react/components/VideoPlayIcon.tsx +43 -0
- package/src/react/components/all.ts +38 -38
- package/src/react/components/index.ts +16 -16
- package/src/robots.ts +4 -4
- package/src/entify/lib/newPageMetaOptions.ts +0 -18
- package/src/entify/lib/newQueryPageOptions.ts +0 -14
- package/src/entify/lib/queryOneIcon.ts +0 -27
- package/src/entify/lib/queryPageBySlug.ts +0 -43
- package/src/entify/lib/queryPageByType.ts +0 -44
|
@@ -1,39 +1,40 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Post,
|
|
3
|
-
PostBoolExp,
|
|
4
|
-
PostOrderBy,
|
|
5
|
-
PostDistinctExp,
|
|
6
|
-
} from "@rxdrag/rxcms-models";
|
|
7
|
-
import { newQueryOnePostOptions } from "./newQueryPostOptions";
|
|
8
|
-
import { queryOneEntity } from "./queryOneEntity";
|
|
9
|
-
import { EnvVariables } from "../types";
|
|
10
|
-
import { TPost } from "../view-model";
|
|
11
|
-
import { ImageSize } from "@rxdrag/rxcms-models";
|
|
12
|
-
|
|
13
|
-
export async function queryOnePostBySlug(
|
|
14
|
-
slug: string,
|
|
15
|
-
coverSize: ImageSize | undefined,
|
|
16
|
-
envVariables: EnvVariables
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
1
|
+
import {
|
|
2
|
+
Post,
|
|
3
|
+
PostBoolExp,
|
|
4
|
+
PostOrderBy,
|
|
5
|
+
PostDistinctExp,
|
|
6
|
+
} from "@rxdrag/rxcms-models";
|
|
7
|
+
import { newQueryOnePostOptions } from "./newQueryPostOptions";
|
|
8
|
+
import { queryOneEntity } from "./queryOneEntity";
|
|
9
|
+
import { EnvVariables } from "../types";
|
|
10
|
+
import { TPost } from "../view-model";
|
|
11
|
+
import { ImageSize } from "@rxdrag/rxcms-models";
|
|
12
|
+
|
|
13
|
+
export async function queryOnePostBySlug(
|
|
14
|
+
slug: string,
|
|
15
|
+
coverSize: ImageSize | undefined,
|
|
16
|
+
envVariables: EnvVariables,
|
|
17
|
+
langAbbr: string
|
|
18
|
+
) {
|
|
19
|
+
const post = await queryOneEntity<
|
|
20
|
+
Post,
|
|
21
|
+
PostBoolExp,
|
|
22
|
+
PostOrderBy,
|
|
23
|
+
PostDistinctExp
|
|
24
|
+
>(
|
|
25
|
+
newQueryOnePostOptions(coverSize).setQueryArgs({
|
|
26
|
+
where: {
|
|
27
|
+
slug: {
|
|
28
|
+
_eq: slug,
|
|
29
|
+
},
|
|
30
|
+
lang: {
|
|
31
|
+
abbr: {
|
|
32
|
+
_eq: langAbbr,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
envVariables
|
|
38
|
+
);
|
|
39
|
+
return post as TPost | undefined;
|
|
40
|
+
}
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
import { ProductCategoryFields, PostCategory, PostCategoryBoolExp, PostCategoryDistinctExp, PostCategoryOrderBy, PostCategoryQueryOptions } from "@rxdrag/rxcms-models";
|
|
2
|
-
import { queryOneEntity } from "./queryOneEntity";
|
|
3
|
-
import { EnvVariables } from "../types";
|
|
4
|
-
import { TPostCategory } from "../view-model";
|
|
5
|
-
|
|
6
|
-
export async function queryOnePostCategoryBySlug(slug: string, envVariables: EnvVariables) {
|
|
7
|
-
|
|
8
|
-
const postCategory = await queryOneEntity<PostCategory, PostCategoryBoolExp, PostCategoryOrderBy, PostCategoryDistinctExp>(
|
|
9
|
-
new PostCategoryQueryOptions(
|
|
10
|
-
[
|
|
11
|
-
ProductCategoryFields.id,
|
|
12
|
-
ProductCategoryFields.slug,
|
|
13
|
-
ProductCategoryFields.name,
|
|
14
|
-
ProductCategoryFields.seqValue,
|
|
15
|
-
ProductCategoryFields.description,
|
|
16
|
-
ProductCategoryFields.createdAt,
|
|
17
|
-
],
|
|
18
|
-
{
|
|
19
|
-
where: {
|
|
20
|
-
slug: {
|
|
21
|
-
"_eq": slug
|
|
22
|
-
},
|
|
23
|
-
lang: {
|
|
24
|
-
abbr: {
|
|
25
|
-
_eq:
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
},
|
|
29
|
-
}
|
|
30
|
-
),
|
|
31
|
-
envVariables
|
|
32
|
-
);
|
|
33
|
-
|
|
34
|
-
return postCategory as TPostCategory | undefined;
|
|
35
|
-
}
|
|
1
|
+
import { ProductCategoryFields, PostCategory, PostCategoryBoolExp, PostCategoryDistinctExp, PostCategoryOrderBy, PostCategoryQueryOptions } from "@rxdrag/rxcms-models";
|
|
2
|
+
import { queryOneEntity } from "./queryOneEntity";
|
|
3
|
+
import { EnvVariables } from "../types";
|
|
4
|
+
import { TPostCategory } from "../view-model";
|
|
5
|
+
|
|
6
|
+
export async function queryOnePostCategoryBySlug(slug: string, envVariables: EnvVariables, langAbbr: string) {
|
|
7
|
+
|
|
8
|
+
const postCategory = await queryOneEntity<PostCategory, PostCategoryBoolExp, PostCategoryOrderBy, PostCategoryDistinctExp>(
|
|
9
|
+
new PostCategoryQueryOptions(
|
|
10
|
+
[
|
|
11
|
+
ProductCategoryFields.id,
|
|
12
|
+
ProductCategoryFields.slug,
|
|
13
|
+
ProductCategoryFields.name,
|
|
14
|
+
ProductCategoryFields.seqValue,
|
|
15
|
+
ProductCategoryFields.description,
|
|
16
|
+
ProductCategoryFields.createdAt,
|
|
17
|
+
],
|
|
18
|
+
{
|
|
19
|
+
where: {
|
|
20
|
+
slug: {
|
|
21
|
+
"_eq": slug
|
|
22
|
+
},
|
|
23
|
+
lang: {
|
|
24
|
+
abbr: {
|
|
25
|
+
_eq: langAbbr,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
}
|
|
30
|
+
),
|
|
31
|
+
envVariables
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
return postCategory as TPostCategory | undefined;
|
|
35
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { Product, ProductBoolExp, ProductOrderBy, ProductDistinctExp } from "@rxdrag/rxcms-models";
|
|
2
|
-
import { newQueryProductOptions } from "./newQueryProductOptions";
|
|
3
|
-
import { queryOneEntity } from "./queryOneEntity";
|
|
4
|
-
import { EnvVariables } from "../types";
|
|
5
|
-
|
|
6
|
-
export async function queryOneProductById(id: string, envVariables: EnvVariables) {
|
|
7
|
-
|
|
8
|
-
const product = await queryOneEntity<Product, ProductBoolExp, ProductOrderBy, ProductDistinctExp>(
|
|
9
|
-
newQueryProductOptions()
|
|
10
|
-
.setQueryArgs({
|
|
11
|
-
where: {
|
|
12
|
-
id: {
|
|
13
|
-
"_eq": id
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}),
|
|
17
|
-
envVariables
|
|
18
|
-
);
|
|
19
|
-
return product;
|
|
20
|
-
}
|
|
1
|
+
import { Product, ProductBoolExp, ProductOrderBy, ProductDistinctExp } from "@rxdrag/rxcms-models";
|
|
2
|
+
import { newQueryProductOptions } from "./newQueryProductOptions";
|
|
3
|
+
import { queryOneEntity } from "./queryOneEntity";
|
|
4
|
+
import { EnvVariables } from "../types";
|
|
5
|
+
|
|
6
|
+
export async function queryOneProductById(id: string, envVariables: EnvVariables) {
|
|
7
|
+
|
|
8
|
+
const product = await queryOneEntity<Product, ProductBoolExp, ProductOrderBy, ProductDistinctExp>(
|
|
9
|
+
newQueryProductOptions()
|
|
10
|
+
.setQueryArgs({
|
|
11
|
+
where: {
|
|
12
|
+
id: {
|
|
13
|
+
"_eq": id
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}),
|
|
17
|
+
envVariables
|
|
18
|
+
);
|
|
19
|
+
return product;
|
|
20
|
+
}
|
|
@@ -1,52 +1,53 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Product,
|
|
3
|
-
ProductBoolExp,
|
|
4
|
-
ProductOrderBy,
|
|
5
|
-
ProductDistinctExp,
|
|
6
|
-
} from "@rxdrag/rxcms-models";
|
|
7
|
-
import { newQueryProductOptions } from "./newQueryProductOptions";
|
|
8
|
-
import { queryOneEntity } from "./queryOneEntity";
|
|
9
|
-
import { EnvVariables } from "../types";
|
|
10
|
-
import { productToViewModel, TProduct } from "../view-model";
|
|
11
|
-
import { ImageSize } from "@rxdrag/rxcms-models";
|
|
12
|
-
|
|
13
|
-
export async function queryOneProductBySlug(
|
|
14
|
-
slug: string,
|
|
15
|
-
imageSize: ImageSize | undefined,
|
|
16
|
-
envVariables: EnvVariables
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
1
|
+
import {
|
|
2
|
+
Product,
|
|
3
|
+
ProductBoolExp,
|
|
4
|
+
ProductOrderBy,
|
|
5
|
+
ProductDistinctExp,
|
|
6
|
+
} from "@rxdrag/rxcms-models";
|
|
7
|
+
import { newQueryProductOptions } from "./newQueryProductOptions";
|
|
8
|
+
import { queryOneEntity } from "./queryOneEntity";
|
|
9
|
+
import { EnvVariables } from "../types";
|
|
10
|
+
import { productToViewModel, TProduct } from "../view-model";
|
|
11
|
+
import { ImageSize } from "@rxdrag/rxcms-models";
|
|
12
|
+
|
|
13
|
+
export async function queryOneProductBySlug(
|
|
14
|
+
slug: string,
|
|
15
|
+
imageSize: ImageSize | undefined,
|
|
16
|
+
envVariables: EnvVariables,
|
|
17
|
+
langAbbr: string
|
|
18
|
+
) {
|
|
19
|
+
const product = await queryOneEntity<
|
|
20
|
+
Product,
|
|
21
|
+
ProductBoolExp,
|
|
22
|
+
ProductOrderBy,
|
|
23
|
+
ProductDistinctExp
|
|
24
|
+
>(
|
|
25
|
+
newQueryProductOptions(imageSize).setQueryArgs({
|
|
26
|
+
where: {
|
|
27
|
+
slug: {
|
|
28
|
+
_eq: slug,
|
|
29
|
+
},
|
|
30
|
+
lang: {
|
|
31
|
+
abbr: {
|
|
32
|
+
_eq: langAbbr,
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
}),
|
|
37
|
+
envVariables
|
|
38
|
+
);
|
|
39
|
+
|
|
40
|
+
if (!product) {
|
|
41
|
+
return product;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const tProduct = productToViewModel(product)!;
|
|
45
|
+
|
|
46
|
+
if (product?.relatedPivots?.length) {
|
|
47
|
+
//重新排序后赋值
|
|
48
|
+
tProduct.related = product?.relatedPivots.map((pv) =>
|
|
49
|
+
productToViewModel(pv.product)
|
|
50
|
+
) as TProduct[] | undefined;
|
|
51
|
+
}
|
|
52
|
+
return tProduct;
|
|
53
|
+
}
|
|
@@ -1,49 +1,50 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ProductCategory,
|
|
3
|
-
ProductCategoryBoolExp,
|
|
4
|
-
ProductCategoryOrderBy,
|
|
5
|
-
ProductCategoryDistinctExp,
|
|
6
|
-
ProductCategoryQueryOptions,
|
|
7
|
-
ProductCategoryFields,
|
|
8
|
-
} from "@rxdrag/rxcms-models";
|
|
9
|
-
import { queryOneEntity } from "./queryOneEntity";
|
|
10
|
-
import { EnvVariables } from "../types";
|
|
11
|
-
import { TProductCategory } from "../view-model";
|
|
12
|
-
|
|
13
|
-
export async function queryOneProductCategoryBySlug(
|
|
14
|
-
slug: string,
|
|
15
|
-
envVariables: EnvVariables
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
ProductCategoryFields.
|
|
27
|
-
ProductCategoryFields.
|
|
28
|
-
ProductCategoryFields.
|
|
29
|
-
ProductCategoryFields.
|
|
30
|
-
ProductCategoryFields.
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
1
|
+
import {
|
|
2
|
+
ProductCategory,
|
|
3
|
+
ProductCategoryBoolExp,
|
|
4
|
+
ProductCategoryOrderBy,
|
|
5
|
+
ProductCategoryDistinctExp,
|
|
6
|
+
ProductCategoryQueryOptions,
|
|
7
|
+
ProductCategoryFields,
|
|
8
|
+
} from "@rxdrag/rxcms-models";
|
|
9
|
+
import { queryOneEntity } from "./queryOneEntity";
|
|
10
|
+
import { EnvVariables } from "../types";
|
|
11
|
+
import { TProductCategory } from "../view-model";
|
|
12
|
+
|
|
13
|
+
export async function queryOneProductCategoryBySlug(
|
|
14
|
+
slug: string,
|
|
15
|
+
envVariables: EnvVariables,
|
|
16
|
+
langAbbr: string
|
|
17
|
+
) {
|
|
18
|
+
const productCategory = await queryOneEntity<
|
|
19
|
+
ProductCategory,
|
|
20
|
+
ProductCategoryBoolExp,
|
|
21
|
+
ProductCategoryOrderBy,
|
|
22
|
+
ProductCategoryDistinctExp
|
|
23
|
+
>(
|
|
24
|
+
new ProductCategoryQueryOptions(
|
|
25
|
+
[
|
|
26
|
+
ProductCategoryFields.id,
|
|
27
|
+
ProductCategoryFields.slug,
|
|
28
|
+
ProductCategoryFields.name,
|
|
29
|
+
ProductCategoryFields.seqValue,
|
|
30
|
+
ProductCategoryFields.description,
|
|
31
|
+
ProductCategoryFields.createdAt,
|
|
32
|
+
],
|
|
33
|
+
{
|
|
34
|
+
where: {
|
|
35
|
+
slug: {
|
|
36
|
+
_eq: slug,
|
|
37
|
+
},
|
|
38
|
+
lang: {
|
|
39
|
+
abbr: {
|
|
40
|
+
_eq: langAbbr,
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
}
|
|
45
|
+
),
|
|
46
|
+
envVariables
|
|
47
|
+
);
|
|
48
|
+
|
|
49
|
+
return productCategory as TProductCategory | undefined;
|
|
50
|
+
}
|
|
@@ -1,72 +1,54 @@
|
|
|
1
|
-
import {
|
|
2
|
-
ThemeBranch,
|
|
3
|
-
ThemeBranchBoolExp,
|
|
4
|
-
ThemeBranchOrderBy,
|
|
5
|
-
ThemeBranchDistinctExp,
|
|
6
|
-
ThemeBranchQueryOptions,
|
|
7
|
-
ThemeBranchFields,
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
} from "
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
//
|
|
36
|
-
// WebsiteFrameFields.
|
|
37
|
-
// WebsiteFrameFields.
|
|
38
|
-
//
|
|
39
|
-
//
|
|
40
|
-
//
|
|
41
|
-
//
|
|
42
|
-
//
|
|
43
|
-
// FrontComponentFields.
|
|
44
|
-
// FrontComponentFields.
|
|
45
|
-
// FrontComponentFields.
|
|
46
|
-
// FrontComponentFields.
|
|
47
|
-
// FrontComponentFields.
|
|
48
|
-
// FrontComponentFields.
|
|
49
|
-
// FrontComponentFields.
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
new ThemeConfigQueryOptions([
|
|
56
|
-
ThemeConfigFields.id,
|
|
57
|
-
ThemeConfigFields.address,
|
|
58
|
-
ThemeConfigFields.contact,
|
|
59
|
-
ThemeConfigFields.email,
|
|
60
|
-
ThemeConfigFields.fax,
|
|
61
|
-
ThemeConfigFields.mobile,
|
|
62
|
-
ThemeConfigFields.tel,
|
|
63
|
-
ThemeConfigFields.wechat,
|
|
64
|
-
ThemeConfigFields.domain,
|
|
65
|
-
//ThemeConfigFields.websiteName,
|
|
66
|
-
]).contactAvatar(new MediaQueryOptions().file(["thumbnail"]))
|
|
67
|
-
)
|
|
68
|
-
.lang(langFields)
|
|
69
|
-
.setNoQuery(!envVariables.websiteId || !envVariables.language),
|
|
70
|
-
envVariables
|
|
71
|
-
);
|
|
72
|
-
}
|
|
1
|
+
import {
|
|
2
|
+
ThemeBranch,
|
|
3
|
+
ThemeBranchBoolExp,
|
|
4
|
+
ThemeBranchOrderBy,
|
|
5
|
+
ThemeBranchDistinctExp,
|
|
6
|
+
ThemeBranchQueryOptions,
|
|
7
|
+
ThemeBranchFields,
|
|
8
|
+
} from "@rxdrag/rxcms-models";
|
|
9
|
+
import { EnvVariables } from "../types";
|
|
10
|
+
import { langFields } from "./langFields";
|
|
11
|
+
import { queryOneEntity } from "./queryOneEntity";
|
|
12
|
+
|
|
13
|
+
export async function queryOneTheme(envVariables: EnvVariables) {
|
|
14
|
+
return await queryOneEntity<
|
|
15
|
+
ThemeBranch,
|
|
16
|
+
ThemeBranchBoolExp,
|
|
17
|
+
ThemeBranchOrderBy,
|
|
18
|
+
ThemeBranchDistinctExp
|
|
19
|
+
>(
|
|
20
|
+
new ThemeBranchQueryOptions(
|
|
21
|
+
[ThemeBranchFields.id, ThemeBranchFields.name, ThemeBranchFields.settings],
|
|
22
|
+
{
|
|
23
|
+
where: {
|
|
24
|
+
website: {
|
|
25
|
+
id: {
|
|
26
|
+
_eq: envVariables.websiteId,
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
}
|
|
31
|
+
)
|
|
32
|
+
// .frame([
|
|
33
|
+
// WebsiteFrameFields.id,
|
|
34
|
+
// WebsiteFrameFields.content,
|
|
35
|
+
// WebsiteFrameFields.settings,
|
|
36
|
+
// WebsiteFrameFields.updatedAt,
|
|
37
|
+
// WebsiteFrameFields.dataSource,
|
|
38
|
+
// ])
|
|
39
|
+
// .components([
|
|
40
|
+
// FrontComponentFields.id,
|
|
41
|
+
// FrontComponentFields.name,
|
|
42
|
+
// FrontComponentFields.content,
|
|
43
|
+
// FrontComponentFields.droppable,
|
|
44
|
+
// FrontComponentFields.props,
|
|
45
|
+
// FrontComponentFields.seqValue,
|
|
46
|
+
// FrontComponentFields.slots,
|
|
47
|
+
// FrontComponentFields.propsSchema,
|
|
48
|
+
// FrontComponentFields.propsTest,
|
|
49
|
+
// FrontComponentFields.title,
|
|
50
|
+
// ])
|
|
51
|
+
.setNoQuery(!envVariables.websiteId),
|
|
52
|
+
envVariables
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { User, UserFields, UserQueryOptions, UserBoolExp, UserOrderBy, UserDistinctExp } from "@rxdrag/rxcms-models";
|
|
2
|
-
import { queryOneEntity } from "./queryOneEntity";
|
|
3
|
-
import { newAvatarQueryOptions } from "./newAvatarQueryOptions";
|
|
4
|
-
import { EnvVariables } from "../types";
|
|
5
|
-
import { TUser } from "../view-model";
|
|
6
|
-
|
|
7
|
-
export async function queryOneUser(id: string, envVariables: EnvVariables) {
|
|
8
|
-
|
|
9
|
-
const user = await queryOneEntity<User, UserBoolExp, UserOrderBy, UserDistinctExp>(
|
|
10
|
-
new UserQueryOptions(
|
|
11
|
-
[
|
|
12
|
-
UserFields.id,
|
|
13
|
-
UserFields.name,
|
|
14
|
-
UserFields.position,
|
|
15
|
-
UserFields.email,
|
|
16
|
-
UserFields.summary,
|
|
17
|
-
UserFields.linkedIn,
|
|
18
|
-
UserFields.twitter,
|
|
19
|
-
UserFields.facebook,
|
|
20
|
-
UserFields.profile,
|
|
21
|
-
],
|
|
22
|
-
{
|
|
23
|
-
where: {
|
|
24
|
-
id: {
|
|
25
|
-
"_eq": id
|
|
26
|
-
},
|
|
27
|
-
},
|
|
28
|
-
}
|
|
29
|
-
)
|
|
30
|
-
.avatar(
|
|
31
|
-
newAvatarQueryOptions()
|
|
32
|
-
)
|
|
33
|
-
.setNoQuery(!id),
|
|
34
|
-
{ ...envVariables, websiteId: undefined }
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
return user as TUser | undefined;
|
|
38
|
-
}
|
|
1
|
+
import { User, UserFields, UserQueryOptions, UserBoolExp, UserOrderBy, UserDistinctExp } from "@rxdrag/rxcms-models";
|
|
2
|
+
import { queryOneEntity } from "./queryOneEntity";
|
|
3
|
+
import { newAvatarQueryOptions } from "./newAvatarQueryOptions";
|
|
4
|
+
import { EnvVariables } from "../types";
|
|
5
|
+
import { TUser } from "../view-model";
|
|
6
|
+
|
|
7
|
+
export async function queryOneUser(id: string, envVariables: EnvVariables) {
|
|
8
|
+
|
|
9
|
+
const user = await queryOneEntity<User, UserBoolExp, UserOrderBy, UserDistinctExp>(
|
|
10
|
+
new UserQueryOptions(
|
|
11
|
+
[
|
|
12
|
+
UserFields.id,
|
|
13
|
+
UserFields.name,
|
|
14
|
+
UserFields.position,
|
|
15
|
+
UserFields.email,
|
|
16
|
+
UserFields.summary,
|
|
17
|
+
UserFields.linkedIn,
|
|
18
|
+
UserFields.twitter,
|
|
19
|
+
UserFields.facebook,
|
|
20
|
+
UserFields.profile,
|
|
21
|
+
],
|
|
22
|
+
{
|
|
23
|
+
where: {
|
|
24
|
+
id: {
|
|
25
|
+
"_eq": id
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
}
|
|
29
|
+
)
|
|
30
|
+
.avatar(
|
|
31
|
+
newAvatarQueryOptions()
|
|
32
|
+
)
|
|
33
|
+
.setNoQuery(!id),
|
|
34
|
+
{ ...envVariables, websiteId: undefined }
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
return user as TUser | undefined;
|
|
38
|
+
}
|