{"version":3,"file":"assetObject.schema.cjs","sources":["../../../../../../src/schema/published/components/assetObject/assetObject.schema.ts"],"sourcesContent":["import { z } from \"zod\";\n\nimport { bucketSchema, googleSchema } from \"@/schema/public/asset/asset.schema\";\n\n// bucket fields may be absent in partially-populated JSONB asset objects\nconst partialBucketSchema = bucketSchema.partial().nullable();\nconst partialGoogleSchema = googleSchema.partial().nullable();\n\n/**\n * Covers all file format types in the asset_object JSONB column, including\n * text formats (word, opendocument_text) used by supplementary and lesson guide assets.\n *\n * Uses partial+nullable bucket schemas because asset_object JSONB can contain\n * bucket entries with absent fields when content has not been fully populated.\n */\nexport const publishedAssetObjectSchema = z\n  .object({\n    pdf: partialBucketSchema,\n    powerpoint: partialBucketSchema,\n    opendocument_presentation: partialBucketSchema,\n    word: partialBucketSchema,\n    opendocument_text: partialBucketSchema,\n    google_drive: partialGoogleSchema,\n    google_slide: partialGoogleSchema,\n  })\n  .partial();\n\nexport type PublishedAssetObject = z.infer<typeof publishedAssetObjectSchema>;\n"],"names":["partialBucketSchema","bucketSchema","partial","nullable","partialGoogleSchema","googleSchema","publishedAssetObjectSchema","z","object","pdf","powerpoint","opendocument_presentation","word","opendocument_text","google_drive","google_slide"],"mappings":"sFAKA,MAAMA,EAAsBC,EAAAA,aAAaC,UAAUC,WAC7CC,EAAsBC,EAAAA,aAAaH,UAAUC,WAStCG,EAA6BC,EAAAA,EACvCC,OAAO,CACNC,IAAKT,EACLU,WAAYV,EACZW,0BAA2BX,EAC3BY,KAAMZ,EACNa,kBAAmBb,EACnBc,aAAcV,EACdW,aAAcX,IAEfF"}