@rxdrag/rxcms-models 0.2.0 → 0.2.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.
@@ -29,4 +29,6 @@ export declare class MediaQueryOptions extends QueryOptions<(Media & MediaAddon)
29
29
  avatarOfUser(options?: UserQueryOptions | (keyof User)[]): this;
30
30
  usedByProducts(options?: ProductQueryOptions | (keyof Product)[]): this;
31
31
  usedByProductsAggregate(aggregate: IAggregate<ProductBoolExp>): this;
32
+ attachmentOf(options?: ProductQueryOptions | (keyof Product)[]): this;
33
+ attachmentOfAggregate(aggregate: IAggregate<ProductBoolExp>): this;
32
34
  }
@@ -22,6 +22,12 @@ export declare class ProductQueryOptions extends QueryOptions<(Product & MediaAd
22
22
  featured(): this;
23
23
  showInNavMenu(): this;
24
24
  seqValue(): this;
25
+ /**
26
+ * 特色
27
+ */
28
+ features(): this;
29
+ content2(): this;
30
+ content3(): this;
25
31
  /**
26
32
  * 发布的内容
27
33
  */
@@ -65,5 +71,7 @@ export declare class ProductQueryOptions extends QueryOptions<(Product & MediaAd
65
71
  tags(options?: TagQueryOptions | (keyof Tag)[]): this;
66
72
  tagsAggregate(aggregate: IAggregate<TagBoolExp>): this;
67
73
  ogImage(options?: MediaQueryOptions | (keyof Media)[]): this;
74
+ attachments(options?: MediaQueryOptions | (keyof Media)[]): this;
75
+ attachmentsAggregate(aggregate: IAggregate<MediaBoolExp>): this;
68
76
  creator(options?: UserQueryOptions | (keyof User)[]): this;
69
77
  }
@@ -18,5 +18,7 @@ export declare enum MediaAssciations {
18
18
  folder = "folder",
19
19
  avatarOfUser = "avatarOfUser",
20
20
  usedByProducts = "usedByProducts",
21
- usedByProductsAggregate = "usedByProductsAggregate"
21
+ usedByProductsAggregate = "usedByProductsAggregate",
22
+ attachmentOf = "attachmentOf",
23
+ attachmentOfAggregate = "attachmentOfAggregate"
22
24
  }
@@ -5,6 +5,12 @@ export declare enum ProductFields {
5
5
  featured = "featured",
6
6
  showInNavMenu = "showInNavMenu",
7
7
  seqValue = "seqValue",
8
+ /**
9
+ * 特色
10
+ */
11
+ features = "features",
12
+ content2 = "content2",
13
+ content3 = "content3",
8
14
  /**
9
15
  * 发布的内容
10
16
  */
@@ -50,5 +56,7 @@ export declare enum ProductAssciations {
50
56
  tags = "tags",
51
57
  tagsAggregate = "tagsAggregate",
52
58
  ogImage = "ogImage",
59
+ attachments = "attachments",
60
+ attachmentsAggregate = "attachmentsAggregate",
53
61
  creator = "creator"
54
62
  }
package/dist/index.mjs CHANGED
@@ -24,7 +24,8 @@ const aggregateEntities = {
24
24
  usersAggregate: "User"
25
25
  },
26
26
  Media: {
27
- usedByProductsAggregate: "Product"
27
+ usedByProductsAggregate: "Product",
28
+ attachmentOfAggregate: "Product"
28
29
  },
29
30
  Website: {
30
31
  usersAggregate: "User"
@@ -37,7 +38,8 @@ const aggregateEntities = {
37
38
  },
38
39
  Product: {
39
40
  mediasAggregate: "Media",
40
- tagsAggregate: "Tag"
41
+ tagsAggregate: "Tag",
42
+ attachmentsAggregate: "Media"
41
43
  },
42
44
  TemplateCategory: {
43
45
  templatesAggregate: "Template"
@@ -370,8 +372,8 @@ const slugToInput = (entity) => {
370
372
  };
371
373
  };
372
374
  const productToInputCascade = (entity) => {
373
- var _a, _b;
374
- const { mediasAggregate, tagsAggregate, ...rest } = entity;
375
+ var _a, _b, _c;
376
+ const { mediasAggregate, tagsAggregate, attachmentsAggregate, ...rest } = entity;
375
377
  return {
376
378
  ...rest,
377
379
  category: entity.category ? processHasOneClear({ sync: productCategoryToInput(entity.category) }) : void 0,
@@ -379,11 +381,12 @@ const productToInputCascade = (entity) => {
379
381
  slug: entity.slug ? processHasOneClear({ sync: slugToInput(entity.slug) }) : void 0,
380
382
  tags: entity.tags ? processHasManyClear({ sync: (_b = entity.tags) == null ? void 0 : _b.map((ent) => tagToInput(ent)) }) : void 0,
381
383
  ogImage: entity.ogImage ? processHasOneClear({ sync: mediaToInput(entity.ogImage) }) : void 0,
384
+ attachments: entity.attachments ? processHasManyClear({ sync: (_c = entity.attachments) == null ? void 0 : _c.map((ent) => mediaToInput(ent)) }) : void 0,
382
385
  creator: entity.creator ? processHasOneClear({ sync: userToInput(entity.creator) }) : void 0
383
386
  };
384
387
  };
385
388
  const productToInput = (entity) => {
386
- const { mediasAggregate, tagsAggregate, ...rest } = entity;
389
+ const { mediasAggregate, tagsAggregate, attachmentsAggregate, ...rest } = entity;
387
390
  return {
388
391
  ...rest,
389
392
  category: convertHasOneToInput(entity.category),
@@ -391,26 +394,29 @@ const productToInput = (entity) => {
391
394
  slug: convertHasOneToInput(entity.slug),
392
395
  tags: convertHasManyToInput(entity.tags),
393
396
  ogImage: convertHasOneToInput(entity.ogImage),
397
+ attachments: convertHasManyToInput(entity.attachments),
394
398
  creator: convertHasOneToInput(entity.creator)
395
399
  };
396
400
  };
397
401
  const mediaToInputCascade = (entity) => {
398
- var _a;
399
- const { file, usedByProductsAggregate, ...rest } = entity;
402
+ var _a, _b;
403
+ const { file, usedByProductsAggregate, attachmentOfAggregate, ...rest } = entity;
400
404
  return {
401
405
  ...rest,
402
406
  folder: entity.folder ? processHasOneClear({ sync: mediaFolderToInput(entity.folder) }) : void 0,
403
407
  avatarOfUser: entity.avatarOfUser ? processHasOneClear({ sync: userToInput(entity.avatarOfUser) }) : void 0,
404
- usedByProducts: entity.usedByProducts ? processHasManyClear({ sync: (_a = entity.usedByProducts) == null ? void 0 : _a.map((ent) => productToInput(ent)) }) : void 0
408
+ usedByProducts: entity.usedByProducts ? processHasManyClear({ sync: (_a = entity.usedByProducts) == null ? void 0 : _a.map((ent) => productToInput(ent)) }) : void 0,
409
+ attachmentOf: entity.attachmentOf ? processHasManyClear({ sync: (_b = entity.attachmentOf) == null ? void 0 : _b.map((ent) => productToInput(ent)) }) : void 0
405
410
  };
406
411
  };
407
412
  const mediaToInput = (entity) => {
408
- const { file, usedByProductsAggregate, ...rest } = entity;
413
+ const { file, usedByProductsAggregate, attachmentOfAggregate, ...rest } = entity;
409
414
  return {
410
415
  ...rest,
411
416
  folder: convertHasOneToInput(entity.folder),
412
417
  avatarOfUser: convertHasOneToInput(entity.avatarOfUser),
413
- usedByProducts: convertHasManyToInput(entity.usedByProducts)
418
+ usedByProducts: convertHasManyToInput(entity.usedByProducts),
419
+ attachmentOf: convertHasManyToInput(entity.attachmentOf)
414
420
  };
415
421
  };
416
422
  const websiteTypeToInputCascade = (entity) => {
@@ -732,6 +738,9 @@ var ProductDistinctEnum = /* @__PURE__ */ ((ProductDistinctEnum2) => {
732
738
  ProductDistinctEnum2["featured"] = "featured";
733
739
  ProductDistinctEnum2["showInNavMenu"] = "showInNavMenu";
734
740
  ProductDistinctEnum2["seqValue"] = "seqValue";
741
+ ProductDistinctEnum2["features"] = "features";
742
+ ProductDistinctEnum2["content2"] = "content2";
743
+ ProductDistinctEnum2["content3"] = "content3";
735
744
  ProductDistinctEnum2["publishedContent"] = "publishedContent";
736
745
  ProductDistinctEnum2["publishedAt"] = "publishedAt";
737
746
  ProductDistinctEnum2["status"] = "status";
@@ -1744,6 +1753,21 @@ class ProductQueryOptions extends QueryOptions {
1744
1753
  this.addField("seqValue");
1745
1754
  return this;
1746
1755
  }
1756
+ /**
1757
+ * 特色
1758
+ */
1759
+ features() {
1760
+ this.addField("features");
1761
+ return this;
1762
+ }
1763
+ content2() {
1764
+ this.addField("content2");
1765
+ return this;
1766
+ }
1767
+ content3() {
1768
+ this.addField("content3");
1769
+ return this;
1770
+ }
1747
1771
  /**
1748
1772
  * 发布的内容
1749
1773
  */
@@ -1900,6 +1924,18 @@ class ProductQueryOptions extends QueryOptions {
1900
1924
  }
1901
1925
  return this;
1902
1926
  }
1927
+ attachments(options) {
1928
+ if (Array.isArray(options)) {
1929
+ this._associations["attachments"] = new MediaQueryOptions(options);
1930
+ } else {
1931
+ this._associations["attachments"] = options || new MediaQueryOptions(["id"]);
1932
+ }
1933
+ return this;
1934
+ }
1935
+ attachmentsAggregate(aggregate) {
1936
+ this._aggregates["attachmentsAggregate"] = aggregate;
1937
+ return this;
1938
+ }
1903
1939
  creator(options) {
1904
1940
  if (Array.isArray(options)) {
1905
1941
  this._associations["creator"] = new UserQueryOptions(options);
@@ -1988,6 +2024,18 @@ class MediaQueryOptions extends QueryOptions {
1988
2024
  this._aggregates["usedByProductsAggregate"] = aggregate;
1989
2025
  return this;
1990
2026
  }
2027
+ attachmentOf(options) {
2028
+ if (Array.isArray(options)) {
2029
+ this._associations["attachmentOf"] = new ProductQueryOptions(options);
2030
+ } else {
2031
+ this._associations["attachmentOf"] = options || new ProductQueryOptions(["id"]);
2032
+ }
2033
+ return this;
2034
+ }
2035
+ attachmentOfAggregate(aggregate) {
2036
+ this._aggregates["attachmentOfAggregate"] = aggregate;
2037
+ return this;
2038
+ }
1991
2039
  }
1992
2040
  class WebsiteTypeQueryOptions extends QueryOptions {
1993
2041
  constructor(fields, queryArgs) {
@@ -3087,6 +3135,8 @@ var MediaAssciations = /* @__PURE__ */ ((MediaAssciations2) => {
3087
3135
  MediaAssciations2["avatarOfUser"] = "avatarOfUser";
3088
3136
  MediaAssciations2["usedByProducts"] = "usedByProducts";
3089
3137
  MediaAssciations2["usedByProductsAggregate"] = "usedByProductsAggregate";
3138
+ MediaAssciations2["attachmentOf"] = "attachmentOf";
3139
+ MediaAssciations2["attachmentOfAggregate"] = "attachmentOfAggregate";
3090
3140
  return MediaAssciations2;
3091
3141
  })(MediaAssciations || {});
3092
3142
  var WebsiteFields = /* @__PURE__ */ ((WebsiteFields2) => {
@@ -3221,6 +3271,9 @@ var ProductFields = /* @__PURE__ */ ((ProductFields2) => {
3221
3271
  ProductFields2["featured"] = "featured";
3222
3272
  ProductFields2["showInNavMenu"] = "showInNavMenu";
3223
3273
  ProductFields2["seqValue"] = "seqValue";
3274
+ ProductFields2["features"] = "features";
3275
+ ProductFields2["content2"] = "content2";
3276
+ ProductFields2["content3"] = "content3";
3224
3277
  ProductFields2["publishedContent"] = "publishedContent";
3225
3278
  ProductFields2["publishedAt"] = "publishedAt";
3226
3279
  ProductFields2["status"] = "status";
@@ -3255,6 +3308,8 @@ var ProductAssciations = /* @__PURE__ */ ((ProductAssciations2) => {
3255
3308
  ProductAssciations2["tags"] = "tags";
3256
3309
  ProductAssciations2["tagsAggregate"] = "tagsAggregate";
3257
3310
  ProductAssciations2["ogImage"] = "ogImage";
3311
+ ProductAssciations2["attachments"] = "attachments";
3312
+ ProductAssciations2["attachmentsAggregate"] = "attachmentsAggregate";
3258
3313
  ProductAssciations2["creator"] = "creator";
3259
3314
  return ProductAssciations2;
3260
3315
  })(ProductAssciations || {});