@timardex/cluemart-shared 1.3.12 → 1.3.14

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/dist/index.d.mts CHANGED
@@ -961,6 +961,7 @@ type PostContentType = Omit<PostContentFormData, "contentData"> & {
961
961
  };
962
962
  type PostType = Omit<PostFormData, "content"> & {
963
963
  _id: string;
964
+ active: boolean;
964
965
  content: PostContentType;
965
966
  createdAt: Date;
966
967
  deletedAt: Date | null;
package/dist/index.d.ts CHANGED
@@ -961,6 +961,7 @@ type PostContentType = Omit<PostContentFormData, "contentData"> & {
961
961
  };
962
962
  type PostType = Omit<PostFormData, "content"> & {
963
963
  _id: string;
964
+ active: boolean;
964
965
  content: PostContentType;
965
966
  createdAt: Date;
966
967
  deletedAt: Date | null;
package/dist/index.mjs CHANGED
@@ -5082,6 +5082,7 @@ var POST_CONTENT_FIELDS_FRAGMENT = gql31`
5082
5082
  var POST_FIELDS_FRAGMENT = gql31`
5083
5083
  fragment PostFields on PostType {
5084
5084
  _id
5085
+ active
5085
5086
  content {
5086
5087
  ...PostContentFields
5087
5088
  }
@@ -5889,23 +5890,31 @@ var listContentSchema = yup9.object({
5889
5890
  title: yup9.string().optional()
5890
5891
  }).required()
5891
5892
  });
5892
- var contentDataSchema = yup9.lazy((_, options) => {
5893
- const contentType = options.parent?.contentType;
5894
- switch (contentType) {
5895
- case "cover" /* COVER */:
5896
- return coverContentSchema;
5897
- case "textarea" /* TEXTAREA */:
5898
- return textareaContentSchema;
5899
- case "image" /* IMAGE */:
5900
- return imagesContentSchema;
5901
- case "video" /* VIDEO */:
5902
- return videoContentSchema;
5903
- case "list" /* LIST */:
5904
- return listContentSchema;
5905
- default:
5906
- return yup9.mixed().required();
5893
+ var contentDataSchema = yup9.mixed().required("Content data is required").test(
5894
+ "contentData-by-type",
5895
+ "Invalid content data for content type",
5896
+ function(value) {
5897
+ const { contentType } = this.parent;
5898
+ const schema = (() => {
5899
+ switch (contentType) {
5900
+ case "cover" /* COVER */:
5901
+ return coverContentSchema;
5902
+ case "textarea" /* TEXTAREA */:
5903
+ return textareaContentSchema;
5904
+ case "image" /* IMAGE */:
5905
+ return imagesContentSchema;
5906
+ case "video" /* VIDEO */:
5907
+ return videoContentSchema;
5908
+ case "list" /* LIST */:
5909
+ return listContentSchema;
5910
+ default:
5911
+ return null;
5912
+ }
5913
+ })();
5914
+ if (!schema) return false;
5915
+ return schema.isValidSync(value);
5907
5916
  }
5908
- });
5917
+ );
5909
5918
  var postContentSchema = yup9.object().shape({
5910
5919
  contentData: contentDataSchema,
5911
5920
  contentOrder: yup9.number().min(0).required(),