@strapi/content-releases 5.63.0 → 5.64.0

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":"publishability.mjs","sources":["../../../server/src/utils/publishability.ts"],"sourcesContent":["import { contentTypes, errors } from '@strapi/utils';\n\nimport type { UID, Core, Modules, Schema } from '@strapi/types';\nimport type {\n ReleaseAction,\n ReleaseActionOutcome,\n ReleaseActionReason,\n StageRef,\n} from '../../../shared/contracts/release-actions';\nimport { getEntry } from './entries';\nimport type { EntryPopulate } from './entries';\n\nexport interface EntryValidity {\n isEntryValid: boolean;\n reason: ReleaseActionReason | null;\n}\n\nexport const UNPUBLISH_VALIDITY: EntryValidity = { isEntryValid: true, reason: null };\n\ntype WorkflowWithRequiredStage = { stageRequiredToPublish?: StageRef | null } | null | undefined;\n\ntype DraftEntry = Modules.Documents.AnyDocument & { strapi_stage?: StageRef | null };\n\nexport type PublishabilityOutcome = Extract<\n ReleaseActionOutcome,\n 'skipped_invalid' | 'skipped_not_approved'\n>;\n\nexport type EntryPublishability =\n | { publishable: true; outcome: null; reason: null; error: null }\n | {\n publishable: false;\n outcome: PublishabilityOutcome;\n reason: ReleaseActionReason;\n /** What publishing the entry would throw; a rejected release reports its message */\n error: Error;\n };\n\n// The draft a publish action points at\nexport type DraftRef = Pick<ReleaseAction, 'contentType'> & {\n entryDocumentId?: ReleaseAction['entryDocumentId'];\n locale?: ReleaseAction['locale'];\n};\n\ntype PublishActionRef = DraftRef & Pick<ReleaseAction, 'id' | 'type'>;\n\n// Identifies an entry in one locale (or the only one, for a content type that isn't localized)\nexport const getEntryKey = (\n contentType: string,\n documentId: string | undefined,\n locale?: string | null\n) => JSON.stringify([contentType, documentId, locale ?? null]);\n\n// Thrown by review-workflows when an entry that isn't at the required stage is published\nconst STAGE_ERROR_MESSAGE = 'Entry is not at the required stage to publish';\n\n// A publish review-workflows refused because the entry isn't at the required stage\nexport const isStageError = (error: unknown) =>\n error instanceof errors.ValidationError && error.message === STAGE_ERROR_MESSAGE;\n\nconst toStageReason = (\n entryStage: StageRef | null,\n requiredStage: StageRef\n): NonNullable<ReleaseActionReason['stage']> => ({\n entryStage: entryStage && { id: entryStage.id, name: entryStage.name },\n requiredStage: { id: requiredStage.id, name: requiredStage.name },\n});\n\n// Strapi's type-mismatch message ends with the submitted value (`notType` in `@strapi/utils`'s\n// yup.ts): cut off, the rest still names the field and the expected type\nconst SUBMITTED_VALUE_SUFFIX = /, but the final value was: [\\s\\S]*$/;\n\n// Only the field paths and messages: the details also carry the submitted values\nconst getValidationErrors = (error: Error) => {\n const details: unknown = error instanceof errors.ValidationError ? error.details : null;\n const detailErrors: unknown[] =\n typeof details === 'object' &&\n details !== null &&\n 'errors' in details &&\n Array.isArray(details.errors)\n ? details.errors\n : [];\n\n return detailErrors.map((detail) => {\n const isObject = typeof detail === 'object' && detail !== null;\n const path = isObject && 'path' in detail ? detail.path : undefined;\n const message = isObject && 'message' in detail ? detail.message : undefined;\n\n return {\n path: Array.isArray(path) ? path.map(String) : [],\n message: typeof message === 'string' ? message.replace(SUBMITTED_VALUE_SUFFIX, '') : '',\n };\n });\n};\n\n// Something thrown that isn't an Error, kept as its cause\nexport const toError = (caught: unknown) =>\n caught instanceof Error ? caught : new Error('Non-Error thrown', { cause: caught });\n\n// Only the error's name: its message can carry row contents\nexport const getErrorName = (error: unknown) => (error instanceof Error ? error.name : 'Error');\n\n// A database driver's error code (e.g. node-postgres `23505`, mysql2 `ER_DUP_ENTRY`): it names the\n// failure without any row contents\nconst getErrorCode = (error: unknown) =>\n typeof error === 'object' && error !== null && 'code' in error && typeof error.code === 'string'\n ? error.code\n : undefined;\n\n// A transient conflict with another transaction: a MySQL deadlock or lock wait timeout, a Postgres\n// deadlock or serialization failure. InnoDB rolls back the whole transaction on a deadlock (on a\n// lock wait timeout, only with `innodb_rollback_on_timeout`; else just the statement).\nconst CONFLICT_CODES = new Set(['ER_LOCK_DEADLOCK', 'ER_LOCK_WAIT_TIMEOUT', '40P01', '40001']);\n\n/**\n * Whether an error in a transaction isn't the entry's own failure but the transaction's: a\n * conflict with another transaction, or a savepoint the database couldn't release or roll back to\n * (`SavepointError` from `@strapi/database`, matched by name: the transaction is lost or broken).\n * Nothing done in the transaction can then be recorded as the entry's outcome, so the caller's\n * transaction must fail with it, leaving the release planned for another run.\n */\nexport const isRunConflict = (error: unknown) =>\n (error instanceof Error && error.name === 'SavepointError') ||\n CONFLICT_CODES.has(getErrorCode(error) ?? '');\n\n// The reason shapes an entry that wasn't released stores\nexport const toValidationReason = (error: Error) => ({\n validation: { errors: getValidationErrors(error) },\n});\n\n// Only the error's name, and its driver code: its message can carry row contents. An application\n// error's message is meant for the client (a manual publish sends it as is), so it's kept, without\n// the submitted value a type-mismatch message ends with.\nexport const toErrorReason = (error: unknown): ReleaseActionReason => {\n const code = getErrorCode(error);\n\n return {\n error: {\n name: getErrorName(error),\n ...(error instanceof errors.ApplicationError && {\n message: error.message.replace(SUBMITTED_VALUE_SUFFIX, ''),\n }),\n ...(code && { code }),\n },\n };\n};\n\n// The validity stored for a checked entry. One whose check threw (e.g. its draft can't be read)\n// isn't publishable, with only the error's name (and an application error's message).\nexport const toEntryValidity = (check: EntryPublishability | Error): EntryValidity => {\n if (check instanceof Error) {\n return { isEntryValid: false, reason: toErrorReason(check) };\n }\n\n return check.publishable\n ? { isEntryValid: true, reason: null }\n : { isEntryValid: false, reason: check.reason };\n};\n\n// A check's result, or the error that stopped it. In a transaction, each check reads in its own\n// savepoint: without one, on Postgres a failed read would abort the transaction, and every other\n// check with it.\nconst readCheck = async <TResult>(\n read: () => Promise<TResult>,\n { strapi }: { strapi: Core.Strapi }\n): Promise<TResult | Error> => {\n const inTransaction = strapi.db.inTransaction();\n\n try {\n return await (inTransaction ? strapi.db.savepoint(read) : read());\n } catch (error) {\n // In a transaction, the transaction fails with a conflict: no other check, nor what the caller\n // records, can be kept. Outside one, it only undid this read, so it's a failed check.\n if (inTransaction && isRunConflict(error)) {\n throw error;\n }\n return toError(error);\n }\n};\n\nconst getAssignedWorkflow = async (\n contentTypeUid: UID.ContentType,\n { strapi }: { strapi: Core.Strapi }\n): Promise<WorkflowWithRequiredStage> => {\n // Workflows service may not be available depending on the license\n const workflowsService = strapi.plugin('review-workflows')?.service('workflows');\n\n return workflowsService?.getAssignedWorkflow(contentTypeUid, {\n populate: 'stageRequiredToPublish',\n });\n};\n\n// Whether an entry can be published now: its draft passes publish validation and, if its\n// workflow requires a stage to publish, it is at that stage\nconst computeEntryPublishability = async (\n contentTypeUid: UID.ContentType,\n entry: DraftEntry | null,\n { workflow, strictRelations }: { workflow: WorkflowWithRequiredStage; strictRelations: boolean },\n { strapi }: { strapi: Core.Strapi }\n): Promise<EntryPublishability> => {\n if (!entry) {\n return {\n publishable: false,\n outcome: 'skipped_invalid',\n reason: { validation: { errors: [] } },\n error: new errors.ValidationError('Entry not found'),\n };\n }\n\n // Publishing deletes the published version before validating the draft, so the validator\n // leaves that version out of unique checks\n const publishedVersion = await strapi.documents(contentTypeUid).findOne({\n documentId: entry.documentId,\n locale: entry.locale,\n status: 'published',\n fields: ['documentId'],\n });\n\n let validationError: Error | null = null;\n try {\n // @TODO: When documents service has validateEntityCreation method, use it instead\n await strapi.entityValidator.validateEntityCreation(\n strapi.getModel(contentTypeUid),\n entry,\n { isDraft: false, locale: entry.locale, strictRelations },\n // @ts-expect-error - the validator takes the entry to leave out of unique checks, but its type doesn't declare it for creation\n publishedVersion\n );\n } catch (error) {\n // Anything else isn't the entry's fault: the caller decides what an unchecked entry means\n if (!(error instanceof errors.ValidationError)) {\n throw error;\n }\n validationError = error;\n }\n\n // Checked even when validation failed, so the reason can carry both\n const requiredStage = workflow?.stageRequiredToPublish ?? null;\n const entryStage = entry.strapi_stage ?? null;\n const isAtRequiredStage = requiredStage === null || entryStage?.id === requiredStage.id;\n\n if (isAtRequiredStage) {\n return validationError === null\n ? { publishable: true, outcome: null, reason: null, error: null }\n : {\n publishable: false,\n outcome: 'skipped_invalid',\n reason: toValidationReason(validationError),\n error: validationError,\n };\n }\n\n return {\n publishable: false,\n outcome: validationError ? 'skipped_invalid' : 'skipped_not_approved',\n reason: {\n ...(validationError && toValidationReason(validationError)),\n stage: toStageReason(entryStage, requiredStage),\n },\n // Same precedence as a publish: review-workflows rejects the stage before validation\n error: new errors.ValidationError(STAGE_ERROR_MESSAGE),\n };\n};\n\n// What the run's earlier actions leave each entry with, by entry key: published (a publish) or not\n// (an unpublish)\ntype ReleasedInRun = ReadonlyMap<string, boolean>;\n\ntype RelationTarget = { documentId?: string; locale?: string | null };\n\ninterface TargetFilter {\n isTargetPublished: (\n targetUid: UID.ContentType,\n target: RelationTarget\n ) => boolean | Promise<boolean>;\n strapi: Core.Strapi;\n}\n\n// The target of a required relation publish can drop: one with draft and publish (any other\n// target is always published), on a relation the validation reads\nconst getDroppableTarget = (\n attribute: Schema.Attribute.AnyAttribute,\n { strapi }: Pick<TargetFilter, 'strapi'>\n): UID.ContentType | undefined =>\n attribute.type === 'relation' &&\n attribute.required &&\n 'target' in attribute &&\n contentTypes.hasDraftAndPublish(strapi.getModel(attribute.target))\n ? attribute.target\n : undefined;\n\n// The targets of a relation publish connects: a to-one relation without one is empty\nconst keepPublishedTargets = async (\n targetUid: UID.ContentType,\n value: unknown,\n { isTargetPublished }: TargetFilter\n) => {\n if (!Array.isArray(value)) {\n return (await isTargetPublished(targetUid, value as RelationTarget)) ? value : null;\n }\n\n const kept = [];\n for (const target of value) {\n if (await isTargetPublished(targetUid, target)) {\n kept.push(target);\n }\n }\n return kept;\n};\n\nconst keepInComponent = (componentUid: UID.Component, value: unknown, filter: TargetFilter) =>\n typeof value === 'object' && value !== null\n ? keepPublishedRequiredTargets(componentUid, value as Record<string, unknown>, filter)\n : value;\n\n// An attribute's value as publish validates it: its droppable targets filtered, its components\n// and dynamic zone items walked\nconst keepInAttribute = async (\n attribute: Schema.Attribute.AnyAttribute,\n value: unknown,\n filter: TargetFilter\n): Promise<unknown> => {\n const targetUid = getDroppableTarget(attribute, filter);\n if (targetUid) {\n return keepPublishedTargets(targetUid, value, filter);\n }\n\n if (attribute.type === 'component') {\n return Array.isArray(value)\n ? Promise.all(\n value.map((component) => keepInComponent(attribute.component, component, filter))\n )\n : keepInComponent(attribute.component, value, filter);\n }\n\n if (attribute.type === 'dynamiczone' && Array.isArray(value)) {\n return Promise.all(\n value.map((component: { __component?: UID.Component }) =>\n component.__component\n ? keepInComponent(component.__component, component, filter)\n : component\n )\n );\n }\n\n return value;\n};\n\n/**\n * The draft as the document service's publish validates it under `api.documents.strictRelations`:\n * publish connects each relation to its target's published version and drops the targets without\n * one (`allowMissingId` in its data transform), then enforces required relations. Only required\n * relations to draft and publish targets are filtered: the others are never dropped, or never\n * validated. Components and dynamic zones are walked, as publish does.\n */\nconst keepPublishedRequiredTargets = async (\n modelUid: UID.Schema,\n data: Record<string, unknown>,\n filter: TargetFilter\n): Promise<Record<string, unknown>> => {\n const attributes: Record<string, Schema.Attribute.AnyAttribute> =\n filter.strapi.getModel(modelUid)?.attributes ?? {};\n const result = { ...data };\n\n for (const [name, attribute] of Object.entries(attributes)) {\n const value = data[name];\n if (value !== null && value !== undefined) {\n result[name] = await keepInAttribute(attribute, value, filter);\n }\n }\n\n return result;\n};\n\n// Whether an entry has a published version, read once per entry. A target without a document id\n// can't be connected.\nconst createPublishedVersionLookup = ({ strapi }: { strapi: Core.Strapi }) => {\n const hasPublishedVersionByEntry = new Map<string, Promise<boolean>>();\n\n return (targetUid: UID.ContentType, { documentId, locale }: RelationTarget) => {\n const key = getEntryKey(targetUid, documentId, locale);\n let hasPublished = hasPublishedVersionByEntry.get(key);\n if (!hasPublished) {\n hasPublished = documentId\n ? strapi\n .documents(targetUid)\n .findOne({\n documentId,\n locale: locale ?? undefined,\n status: 'published',\n fields: ['documentId'],\n })\n .then((published) => published !== null)\n : Promise.resolve(false);\n hasPublishedVersionByEntry.set(key, hasPublished);\n }\n\n return hasPublished;\n };\n};\n\n// Checks drafts, looking up the populate and the workflow once per content type and reading\n// each draft once (an entry in several planned releases has one action in each)\nconst createDraftPublishabilityCheck = ({ strapi }: { strapi: Core.Strapi }) => {\n const populateBuilderService = strapi.plugin('content-manager').service('populate-builder');\n // Same strict relations rule as the document service's publish\n const strictRelations = strapi.config.get('api.documents.strictRelations', undefined) === true;\n const lookupsByContentType = new Map<\n UID.ContentType,\n { populate: EntryPopulate; workflow: WorkflowWithRequiredStage }\n >();\n const publishabilityByDraft = new Map<string, Promise<EntryPublishability>>();\n const hasPublishedVersion = createPublishedVersionLookup({ strapi });\n\n const readDraft = async (\n draft: DraftRef,\n releasedInRun: ReleasedInRun | undefined\n ): Promise<EntryPublishability> => {\n let lookups = lookupsByContentType.get(draft.contentType);\n if (!lookups) {\n lookups = {\n // @ts-expect-error - populateBuilderService should be a function but is returning service\n populate: await populateBuilderService(draft.contentType).populateDeep(Infinity).build(),\n workflow: await getAssignedWorkflow(draft.contentType, { strapi }),\n };\n lookupsByContentType.set(draft.contentType, lookups);\n }\n\n const entry = await getEntry(\n {\n contentType: draft.contentType,\n documentId: draft.entryDocumentId,\n locale: draft.locale,\n populate: lookups.populate,\n },\n { strapi }\n );\n\n // A planned release's validity checks the draft as is: which targets the run releases first\n // is only known in the run\n const checkedEntry =\n entry && strictRelations && releasedInRun\n ? ((await keepPublishedRequiredTargets(draft.contentType, entry, {\n isTargetPublished: (targetUid, target) =>\n releasedInRun.get(getEntryKey(targetUid, target.documentId, target.locale)) ??\n hasPublishedVersion(targetUid, target),\n strapi,\n })) as DraftEntry)\n : entry;\n\n return computeEntryPublishability(\n draft.contentType,\n checkedEntry,\n { workflow: lookups.workflow, strictRelations },\n { strapi }\n );\n };\n\n return (draft: DraftRef, releasedInRun?: ReleasedInRun): Promise<EntryPublishability> => {\n const key = getEntryKey(draft.contentType, draft.entryDocumentId, draft.locale);\n let publishability = publishabilityByDraft.get(key);\n if (!publishability) {\n publishability = readDraft(draft, releasedInRun);\n publishabilityByDraft.set(key, publishability);\n }\n\n return publishability;\n };\n};\n\n// With `inRunOrder`, the actions are a run's, in the order it releases them: each check sees what\n// the actions before it release\nconst checkPublishActions = async <TAction extends PublishActionRef, TResult>(\n actions: readonly TAction[],\n toResult: (readPublishability: () => Promise<EntryPublishability>) => Promise<TResult>,\n { strapi, inRunOrder = false }: { strapi: Core.Strapi; inRunOrder?: boolean }\n): Promise<Map<TAction['id'], TResult>> => {\n const check = createDraftPublishabilityCheck({ strapi });\n const results = new Map<TAction['id'], TResult>();\n const releasedInRun = new Map<string, boolean>();\n\n for (const action of actions) {\n if (action.type === 'publish') {\n results.set(\n action.id,\n await toResult(() => check(action, inRunOrder ? releasedInRun : undefined))\n );\n }\n if (inRunOrder) {\n releasedInRun.set(\n getEntryKey(action.contentType, action.entryDocumentId, action.locale),\n action.type === 'publish'\n );\n }\n }\n\n return results;\n};\n\n/**\n * Why review-workflows refused to publish an entry: its stage and the one its workflow requires,\n * read as the check reads them. Null if they can't be read, or no stage is required anymore; in a\n * transaction, a run conflict is rethrown.\n */\nexport const getStageReason = async (\n draft: DraftRef,\n { strapi }: { strapi: Core.Strapi }\n): Promise<ReleaseActionReason | null> => {\n const reason = await readCheck(\n async () => {\n const workflow = await getAssignedWorkflow(draft.contentType, { strapi });\n const requiredStage = workflow?.stageRequiredToPublish ?? null;\n if (!requiredStage) {\n return null;\n }\n\n const entry: DraftEntry | null = await getEntry(\n {\n contentType: draft.contentType,\n documentId: draft.entryDocumentId,\n locale: draft.locale,\n populate: ['strapi_stage'],\n },\n { strapi }\n );\n\n return { stage: toStageReason(entry?.strapi_stage ?? null, requiredStage) };\n },\n { strapi }\n );\n\n return reason instanceof Error ? null : reason;\n};\n\n/**\n * Publishability of each of a run's publish actions from its current draft, by action id, or the\n * error that stopped the check (a draft that can't be read): the run decides what that entry\n * means. The actions come in run order: under `api.documents.strictRelations`, a required\n * relation's target counts as published if it has a published version or an earlier action of the\n * run publishes it (and not if an earlier action unpublishes it).\n */\nexport const getPublishabilityForActions = <TAction extends PublishActionRef>(\n actions: readonly TAction[],\n { strapi }: { strapi: Core.Strapi }\n) =>\n checkPublishActions(actions, (read) => readCheck(read, { strapi }), {\n strapi,\n inRunOrder: true,\n });\n\n/**\n * The validity to store on each publish action, by action id. A draft that can't be read is\n * stored as not publishable and doesn't stop the others, except in a transaction a run conflict\n * (see `isRunConflict`), which is rethrown.\n */\nexport const getValidityForActions = <TAction extends PublishActionRef>(\n actions: readonly TAction[],\n { strapi }: { strapi: Core.Strapi }\n) =>\n checkPublishActions(\n actions,\n async (readPublishability) => toEntryValidity(await readCheck(readPublishability, { strapi })),\n { strapi }\n );\n\n// What an action stores when it's added or changes type\nexport const getActionValidity = async (\n action: DraftRef & Pick<ReleaseAction, 'type'>,\n { strapi }: { strapi: Core.Strapi }\n): Promise<EntryValidity> =>\n action.type === 'publish'\n ? toEntryValidity(\n await readCheck(() => createDraftPublishabilityCheck({ strapi })(action), { strapi })\n )\n : UNPUBLISH_VALIDITY;\n"],"names":["UNPUBLISH_VALIDITY","isEntryValid","reason","getEntryKey","contentType","documentId","locale","JSON","stringify","STAGE_ERROR_MESSAGE","isStageError","error","errors","ValidationError","message","toStageReason","entryStage","requiredStage","id","name","SUBMITTED_VALUE_SUFFIX","getValidationErrors","details","detailErrors","Array","isArray","map","detail","isObject","path","undefined","String","replace","toError","caught","Error","cause","getErrorName","getErrorCode","code","CONFLICT_CODES","Set","isRunConflict","has","toValidationReason","validation","toErrorReason","ApplicationError","toEntryValidity","check","publishable","readCheck","read","strapi","inTransaction","db","savepoint","getAssignedWorkflow","contentTypeUid","workflowsService","plugin","service","populate","computeEntryPublishability","entry","workflow","strictRelations","outcome","publishedVersion","documents","findOne","status","fields","validationError","entityValidator","validateEntityCreation","getModel","isDraft","stageRequiredToPublish","strapi_stage","isAtRequiredStage","stage","getDroppableTarget","attribute","type","required","contentTypes","hasDraftAndPublish","target","keepPublishedTargets","targetUid","value","isTargetPublished","kept","push","keepInComponent","componentUid","filter","keepPublishedRequiredTargets","keepInAttribute","Promise","all","component","__component","modelUid","data","attributes","result","Object","entries","createPublishedVersionLookup","hasPublishedVersionByEntry","Map","key","hasPublished","get","then","published","resolve","set","createDraftPublishabilityCheck","populateBuilderService","config","lookupsByContentType","publishabilityByDraft","hasPublishedVersion","readDraft","draft","releasedInRun","lookups","populateDeep","Infinity","build","getEntry","entryDocumentId","checkedEntry","publishability","checkPublishActions","actions","toResult","inRunOrder","results","action","getStageReason","getPublishabilityForActions","getValidityForActions","readPublishability","getActionValidity"],"mappings":";;;MAiBaA,kBAAAA,GAAoC;IAAEC,YAAAA,EAAc,IAAA;IAAMC,MAAAA,EAAQ;AAAK;AA6BpF;AACO,MAAMC,cAAc,CACzBC,WAAAA,EACAC,YACAC,MAAAA,GACGC,IAAAA,CAAKC,SAAS,CAAC;AAACJ,QAAAA,WAAAA;AAAaC,QAAAA,UAAAA;QAAYC,MAAAA,IAAU;KAAK;AAE7D;AACA,MAAMG,mBAAAA,GAAsB,+CAAA;AAE5B;AACO,MAAMC,YAAAA,GAAe,CAACC,KAAAA,GAC3BA,KAAAA,YAAiBC,MAAAA,CAAOC,eAAe,IAAIF,KAAAA,CAAMG,OAAO,KAAKL;AAE/D,MAAMM,aAAAA,GAAgB,CACpBC,UAAAA,EACAC,aAAAA,IAC+C;AAC/CD,QAAAA,UAAAA,EAAYA,UAAAA,IAAc;AAAEE,YAAAA,EAAAA,EAAIF,WAAWE,EAAE;AAAEC,YAAAA,IAAAA,EAAMH,WAAWG;AAAK,SAAA;QACrEF,aAAAA,EAAe;AAAEC,YAAAA,EAAAA,EAAID,cAAcC,EAAE;AAAEC,YAAAA,IAAAA,EAAMF,cAAcE;AAAK;KAClE,CAAA;AAEA;AACA;AACA,MAAMC,sBAAAA,GAAyB,qCAAA;AAE/B;AACA,MAAMC,sBAAsB,CAACV,KAAAA,GAAAA;AAC3B,IAAA,MAAMW,UAAmBX,KAAAA,YAAiBC,MAAAA,CAAOC,eAAe,GAAGF,KAAAA,CAAMW,OA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AEnCoF,mBAAAA,CACEC,SACA,OAAOQ,kBAAAA,GAAuBlG,eAAAA,CAAgB,MAAMG,UAAU+F,kBAAAA,EAAoB;AAAE7F,YAAAA;SAAO,CAAA,CAAA,EAC3F;AAAEA,QAAAA;KAAO;AAGb;MACa8F,iBAAAA,GAAoB,OAC/BL,MAAAA,EACA,EAAEzF,MAAM,EAA2B,GAEnCyF,MAAAA,CAAO1D,IAAI,KAAK,SAAA,GACZpC,eAAAA,CACE,MAAMG,SAAAA,CAAU,IAAMqE,8BAAAA,CAA+B;AAAEnE,YAAAA;AAAO,SAAA,CAAA,CAAGyF,MAAAA,CAAAA,EAAS;AAAEzF,QAAAA;AAAO,KAAA,CAAA,CAAA,GAErFrD;;;;"}
1
+ {"version":3,"file":"publishability.mjs","sources":["../../../server/src/utils/publishability.ts"],"sourcesContent":["import { contentTypes, errors } from '@strapi/utils';\n\nimport type { UID, Core, Modules, Schema } from '@strapi/types';\nimport type {\n ReleaseAction,\n ReleaseActionOutcome,\n ReleaseActionReason,\n StageRef,\n} from '../../../shared/contracts/release-actions';\nimport { getEntry } from './entries';\nimport type { EntryPopulate } from './entries';\n\nexport interface EntryValidity {\n isEntryValid: boolean;\n reason: ReleaseActionReason | null;\n}\n\nexport const UNPUBLISH_VALIDITY: EntryValidity = { isEntryValid: true, reason: null };\n\ntype WorkflowWithRequiredStage = { stageRequiredToPublish?: StageRef | null } | null | undefined;\n\ntype DraftEntry = Modules.Documents.AnyDocument & { strapi_stage?: StageRef | null };\n\nexport type PublishabilityOutcome = Extract<\n ReleaseActionOutcome,\n 'skipped_invalid' | 'skipped_not_approved'\n>;\n\nexport type EntryPublishability =\n | { publishable: true; outcome: null; reason: null; error: null }\n | {\n publishable: false;\n outcome: PublishabilityOutcome;\n reason: ReleaseActionReason;\n /** What publishing the entry would throw; a rejected release reports its message */\n error: Error;\n };\n\n// The draft a publish action points at\nexport type DraftRef = Pick<ReleaseAction, 'contentType'> & {\n entryDocumentId?: ReleaseAction['entryDocumentId'];\n locale?: ReleaseAction['locale'];\n};\n\ntype PublishActionRef = DraftRef & Pick<ReleaseAction, 'id' | 'type'>;\n\n// Identifies an entry in one locale (or the only one, for a content type that isn't localized)\nexport const getEntryKey = (\n contentType: string,\n documentId: string | undefined,\n locale?: string | null\n) => JSON.stringify([contentType, documentId, locale ?? null]);\n\n// Thrown by review-workflows when an entry that isn't at the required stage is published\nconst STAGE_ERROR_MESSAGE = 'Entry is not at the required stage to publish';\n\n// A publish review-workflows refused because the entry isn't at the required stage\nexport const isStageError = (error: unknown) =>\n error instanceof errors.ValidationError && error.message === STAGE_ERROR_MESSAGE;\n\nconst toStageReason = (\n entryStage: StageRef | null,\n requiredStage: StageRef\n): NonNullable<ReleaseActionReason['stage']> => ({\n entryStage: entryStage && { id: entryStage.id, name: entryStage.name },\n requiredStage: { id: requiredStage.id, name: requiredStage.name },\n});\n\n// Strapi's type-mismatch message ends with the submitted value (`notType` in `@strapi/utils`'s\n// yup.ts): cut off, the rest still names the field and the expected type\nconst SUBMITTED_VALUE_SUFFIX = /, but the final value was: [\\s\\S]*$/;\n\n// Only the field paths and messages: the details also carry the submitted values\nconst getValidationErrors = (error: Error) => {\n const details: unknown = error instanceof errors.ValidationError ? error.details : null;\n const detailErrors: unknown[] =\n typeof details === 'object' &&\n details !== null &&\n 'errors' in details &&\n Array.isArray(details.errors)\n ? details.errors\n : [];\n\n return detailErrors.map((detail) => {\n const isObject = typeof detail === 'object' && detail !== null;\n const path = isObject && 'path' in detail ? detail.path : undefined;\n const message = isObject && 'message' in detail ? detail.message : undefined;\n\n return {\n path: Array.isArray(path) ? path.map(String) : [],\n message: typeof message === 'string' ? message.replace(SUBMITTED_VALUE_SUFFIX, '') : '',\n };\n });\n};\n\n// Something thrown that isn't an Error, kept as its cause\nexport const toError = (caught: unknown) =>\n caught instanceof Error ? caught : new Error('Non-Error thrown', { cause: caught });\n\n// Only the error's name: its message can carry row contents\nexport const getErrorName = (error: unknown) => (error instanceof Error ? error.name : 'Error');\n\n// A database driver's error code (e.g. node-postgres `23505`, mysql2 `ER_DUP_ENTRY`): it names the\n// failure without any row contents\nconst getErrorCode = (error: unknown) =>\n typeof error === 'object' && error !== null && 'code' in error && typeof error.code === 'string'\n ? error.code\n : undefined;\n\n// A transient conflict with another transaction: a MySQL deadlock or lock wait timeout, a Postgres\n// deadlock or serialization failure. InnoDB rolls back the whole transaction on a deadlock (on a\n// lock wait timeout, only with `innodb_rollback_on_timeout`; else just the statement).\nconst CONFLICT_CODES = new Set(['ER_LOCK_DEADLOCK', 'ER_LOCK_WAIT_TIMEOUT', '40P01', '40001']);\n\n/**\n * Whether an error in a transaction isn't the entry's own failure but the transaction's: a\n * conflict with another transaction, or a savepoint the database couldn't release or roll back to\n * (`SavepointError` from `@strapi/database`, matched by name: the transaction is lost or broken).\n * Nothing done in the transaction can then be recorded as the entry's outcome, so the caller's\n * transaction must fail with it, leaving the release planned for another run.\n */\nexport const isRunConflict = (error: unknown) =>\n (error instanceof Error && error.name === 'SavepointError') ||\n CONFLICT_CODES.has(getErrorCode(error) ?? '');\n\n// The reason shapes an entry that wasn't released stores\nexport const toValidationReason = (error: Error) => ({\n validation: { errors: getValidationErrors(error) },\n});\n\n// Only the error's name, and its driver code: its message can carry row contents. An application\n// error's message is meant for the client (a manual publish sends it as is), so it's kept, without\n// the submitted value a type-mismatch message ends with.\nexport const toErrorReason = (error: unknown): ReleaseActionReason => {\n const code = getErrorCode(error);\n\n return {\n error: {\n name: getErrorName(error),\n ...(error instanceof errors.ApplicationError && {\n message: error.message.replace(SUBMITTED_VALUE_SUFFIX, ''),\n }),\n ...(code && { code }),\n },\n };\n};\n\n// The validity stored for a checked entry. One whose check threw (e.g. its draft can't be read)\n// isn't publishable, with only the error's name (and an application error's message).\nexport const toEntryValidity = (check: EntryPublishability | Error): EntryValidity => {\n if (check instanceof Error) {\n return { isEntryValid: false, reason: toErrorReason(check) };\n }\n\n return check.publishable\n ? { isEntryValid: true, reason: null }\n : { isEntryValid: false, reason: check.reason };\n};\n\n// A check's result, or the error that stopped it. In a transaction, each check reads in its own\n// savepoint: without one, on Postgres a failed read would abort the transaction, and every other\n// check with it.\nconst readCheck = async <TResult>(\n read: () => Promise<TResult>,\n { strapi }: { strapi: Core.Strapi }\n): Promise<TResult | Error> => {\n const inTransaction = strapi.db.inTransaction();\n\n try {\n return await (inTransaction ? strapi.db.savepoint(read) : read());\n } catch (error) {\n // In a transaction, the transaction fails with a conflict: no other check, nor what the caller\n // records, can be kept. Outside one, it only undid this read, so it's a failed check.\n if (inTransaction && isRunConflict(error)) {\n throw error;\n }\n return toError(error);\n }\n};\n\nconst getAssignedWorkflow = async (\n contentTypeUid: UID.ContentType,\n { strapi }: { strapi: Core.Strapi }\n): Promise<WorkflowWithRequiredStage> => {\n // Workflows service may not be available depending on the license\n const workflowsService = strapi.plugin('review-workflows')?.service('workflows');\n\n return workflowsService?.getAssignedWorkflow(contentTypeUid, {\n populate: 'stageRequiredToPublish',\n });\n};\n\n// Whether an entry can be published now: its draft passes publish validation and, if its\n// workflow requires a stage to publish, it is at that stage\nconst computeEntryPublishability = async (\n contentTypeUid: UID.ContentType,\n entry: (DraftEntry & { locale?: string | null }) | null,\n { workflow, strictRelations }: { workflow: WorkflowWithRequiredStage; strictRelations: boolean },\n { strapi }: { strapi: Core.Strapi }\n): Promise<EntryPublishability> => {\n if (!entry) {\n return {\n publishable: false,\n outcome: 'skipped_invalid',\n reason: { validation: { errors: [] } },\n error: new errors.ValidationError('Entry not found'),\n };\n }\n\n // Publishing deletes the published version before validating the draft, so the validator\n // leaves that version out of unique checks\n const publishedVersion = await strapi.documents(contentTypeUid).findOne({\n documentId: entry.documentId,\n locale: entry.locale ?? undefined,\n status: 'published',\n fields: ['documentId'],\n });\n\n let validationError: Error | null = null;\n try {\n // @TODO: When documents service has validateEntityCreation method, use it instead\n await strapi.entityValidator.validateEntityCreation(\n strapi.getModel(contentTypeUid),\n entry,\n { isDraft: false, locale: entry.locale, strictRelations },\n // @ts-expect-error - the validator takes the entry to leave out of unique checks, but its type doesn't declare it for creation\n publishedVersion\n );\n } catch (error) {\n // Anything else isn't the entry's fault: the caller decides what an unchecked entry means\n if (!(error instanceof errors.ValidationError)) {\n throw error;\n }\n validationError = error;\n }\n\n // Checked even when validation failed, so the reason can carry both\n const requiredStage = workflow?.stageRequiredToPublish ?? null;\n const entryStage = entry.strapi_stage ?? null;\n const isAtRequiredStage = requiredStage === null || entryStage?.id === requiredStage.id;\n\n if (isAtRequiredStage) {\n return validationError === null\n ? { publishable: true, outcome: null, reason: null, error: null }\n : {\n publishable: false,\n outcome: 'skipped_invalid',\n reason: toValidationReason(validationError),\n error: validationError,\n };\n }\n\n return {\n publishable: false,\n outcome: validationError ? 'skipped_invalid' : 'skipped_not_approved',\n reason: {\n ...(validationError && toValidationReason(validationError)),\n stage: toStageReason(entryStage, requiredStage),\n },\n // Same precedence as a publish: review-workflows rejects the stage before validation\n error: new errors.ValidationError(STAGE_ERROR_MESSAGE),\n };\n};\n\n// What the run's earlier actions leave each entry with, by entry key: published (a publish) or not\n// (an unpublish)\ntype ReleasedInRun = ReadonlyMap<string, boolean>;\n\ntype RelationTarget = { documentId?: string; locale?: string | null };\n\ninterface TargetFilter {\n isTargetPublished: (\n targetUid: UID.ContentType,\n target: RelationTarget\n ) => boolean | Promise<boolean>;\n strapi: Core.Strapi;\n}\n\n// The target of a required relation publish can drop: one with draft and publish (any other\n// target is always published), on a relation the validation reads\nconst getDroppableTarget = (\n attribute: Schema.Attribute.AnyAttribute,\n { strapi }: Pick<TargetFilter, 'strapi'>\n): UID.ContentType | undefined =>\n attribute.type === 'relation' &&\n attribute.required &&\n 'target' in attribute &&\n contentTypes.hasDraftAndPublish(strapi.getModel(attribute.target))\n ? attribute.target\n : undefined;\n\n// The targets of a relation publish connects: a to-one relation without one is empty\nconst keepPublishedTargets = async (\n targetUid: UID.ContentType,\n value: unknown,\n { isTargetPublished }: TargetFilter\n) => {\n if (!Array.isArray(value)) {\n return (await isTargetPublished(targetUid, value as RelationTarget)) ? value : null;\n }\n\n const kept = [];\n for (const target of value) {\n if (await isTargetPublished(targetUid, target)) {\n kept.push(target);\n }\n }\n return kept;\n};\n\nconst keepInComponent = (componentUid: UID.Component, value: unknown, filter: TargetFilter) =>\n typeof value === 'object' && value !== null\n ? keepPublishedRequiredTargets(componentUid, value as Record<string, unknown>, filter)\n : value;\n\n// An attribute's value as publish validates it: its droppable targets filtered, its components\n// and dynamic zone items walked\nconst keepInAttribute = async (\n attribute: Schema.Attribute.AnyAttribute,\n value: unknown,\n filter: TargetFilter\n): Promise<unknown> => {\n const targetUid = getDroppableTarget(attribute, filter);\n if (targetUid) {\n return keepPublishedTargets(targetUid, value, filter);\n }\n\n if (attribute.type === 'component') {\n return Array.isArray(value)\n ? Promise.all(\n value.map((component) => keepInComponent(attribute.component, component, filter))\n )\n : keepInComponent(attribute.component, value, filter);\n }\n\n if (attribute.type === 'dynamiczone' && Array.isArray(value)) {\n return Promise.all(\n value.map((component: { __component?: UID.Component }) =>\n component.__component\n ? keepInComponent(component.__component, component, filter)\n : component\n )\n );\n }\n\n return value;\n};\n\n/**\n * The draft as the document service's publish validates it under `api.documents.strictRelations`:\n * publish connects each relation to its target's published version and drops the targets without\n * one (`allowMissingId` in its data transform), then enforces required relations. Only required\n * relations to draft and publish targets are filtered: the others are never dropped, or never\n * validated. Components and dynamic zones are walked, as publish does.\n */\nconst keepPublishedRequiredTargets = async (\n modelUid: UID.Schema,\n data: Record<string, unknown>,\n filter: TargetFilter\n): Promise<Record<string, unknown>> => {\n const attributes: Record<string, Schema.Attribute.AnyAttribute> =\n filter.strapi.getModel(modelUid)?.attributes ?? {};\n const result = { ...data };\n\n for (const [name, attribute] of Object.entries(attributes)) {\n const value = data[name];\n if (value !== null && value !== undefined) {\n result[name] = await keepInAttribute(attribute, value, filter);\n }\n }\n\n return result;\n};\n\n// Whether an entry has a published version, read once per entry. A target without a document id\n// can't be connected.\nconst createPublishedVersionLookup = ({ strapi }: { strapi: Core.Strapi }) => {\n const hasPublishedVersionByEntry = new Map<string, Promise<boolean>>();\n\n return (targetUid: UID.ContentType, { documentId, locale }: RelationTarget) => {\n const key = getEntryKey(targetUid, documentId, locale);\n let hasPublished = hasPublishedVersionByEntry.get(key);\n if (!hasPublished) {\n hasPublished = documentId\n ? strapi\n .documents(targetUid)\n .findOne({\n documentId,\n locale: locale ?? undefined,\n status: 'published',\n fields: ['documentId'],\n })\n .then((published) => published !== null)\n : Promise.resolve(false);\n hasPublishedVersionByEntry.set(key, hasPublished);\n }\n\n return hasPublished;\n };\n};\n\n// Checks drafts, looking up the populate and the workflow once per content type and reading\n// each draft once (an entry in several planned releases has one action in each)\nconst createDraftPublishabilityCheck = ({ strapi }: { strapi: Core.Strapi }) => {\n const populateBuilderService = strapi.plugin('content-manager').service('populate-builder');\n // Same strict relations rule as the document service's publish\n const strictRelations = strapi.config.get('api.documents.strictRelations', undefined) === true;\n const lookupsByContentType = new Map<\n UID.ContentType,\n { populate: EntryPopulate; workflow: WorkflowWithRequiredStage }\n >();\n const publishabilityByDraft = new Map<string, Promise<EntryPublishability>>();\n const hasPublishedVersion = createPublishedVersionLookup({ strapi });\n\n const readDraft = async (\n draft: DraftRef,\n releasedInRun: ReleasedInRun | undefined\n ): Promise<EntryPublishability> => {\n let lookups = lookupsByContentType.get(draft.contentType);\n if (!lookups) {\n lookups = {\n // @ts-expect-error - populateBuilderService should be a function but is returning service\n populate: await populateBuilderService(draft.contentType).populateDeep(Infinity).build(),\n workflow: await getAssignedWorkflow(draft.contentType, { strapi }),\n };\n lookupsByContentType.set(draft.contentType, lookups);\n }\n\n const entry = await getEntry(\n {\n contentType: draft.contentType,\n documentId: draft.entryDocumentId,\n locale: draft.locale,\n populate: lookups.populate,\n },\n { strapi }\n );\n\n // A planned release's validity checks the draft as is: which targets the run releases first\n // is only known in the run\n const checkedEntry =\n entry && strictRelations && releasedInRun\n ? ((await keepPublishedRequiredTargets(draft.contentType, entry, {\n isTargetPublished: (targetUid, target) =>\n releasedInRun.get(getEntryKey(targetUid, target.documentId, target.locale)) ??\n hasPublishedVersion(targetUid, target),\n strapi,\n })) as DraftEntry)\n : entry;\n\n return computeEntryPublishability(\n draft.contentType,\n checkedEntry,\n { workflow: lookups.workflow, strictRelations },\n { strapi }\n );\n };\n\n return (draft: DraftRef, releasedInRun?: ReleasedInRun): Promise<EntryPublishability> => {\n const key = getEntryKey(draft.contentType, draft.entryDocumentId, draft.locale);\n let publishability = publishabilityByDraft.get(key);\n if (!publishability) {\n publishability = readDraft(draft, releasedInRun);\n publishabilityByDraft.set(key, publishability);\n }\n\n return publishability;\n };\n};\n\n// With `inRunOrder`, the actions are a run's, in the order it releases them: each check sees what\n// the actions before it release\nconst checkPublishActions = async <TAction extends PublishActionRef, TResult>(\n actions: readonly TAction[],\n toResult: (readPublishability: () => Promise<EntryPublishability>) => Promise<TResult>,\n { strapi, inRunOrder = false }: { strapi: Core.Strapi; inRunOrder?: boolean }\n): Promise<Map<TAction['id'], TResult>> => {\n const check = createDraftPublishabilityCheck({ strapi });\n const results = new Map<TAction['id'], TResult>();\n const releasedInRun = new Map<string, boolean>();\n\n for (const action of actions) {\n if (action.type === 'publish') {\n results.set(\n action.id,\n await toResult(() => check(action, inRunOrder ? releasedInRun : undefined))\n );\n }\n if (inRunOrder) {\n releasedInRun.set(\n getEntryKey(action.contentType, action.entryDocumentId, action.locale),\n action.type === 'publish'\n );\n }\n }\n\n return results;\n};\n\n/**\n * Why review-workflows refused to publish an entry: its stage and the one its workflow requires,\n * read as the check reads them. Null if they can't be read, or no stage is required anymore; in a\n * transaction, a run conflict is rethrown.\n */\nexport const getStageReason = async (\n draft: DraftRef,\n { strapi }: { strapi: Core.Strapi }\n): Promise<ReleaseActionReason | null> => {\n const reason = await readCheck(\n async () => {\n const workflow = await getAssignedWorkflow(draft.contentType, { strapi });\n const requiredStage = workflow?.stageRequiredToPublish ?? null;\n if (!requiredStage) {\n return null;\n }\n\n const entry: DraftEntry | null = await getEntry(\n {\n contentType: draft.contentType,\n documentId: draft.entryDocumentId,\n locale: draft.locale,\n populate: ['strapi_stage'],\n },\n { strapi }\n );\n\n return { stage: toStageReason(entry?.strapi_stage ?? null, requiredStage) };\n },\n { strapi }\n );\n\n return reason instanceof Error ? null : reason;\n};\n\n/**\n * Publishability of each of a run's publish actions from its current draft, by action id, or the\n * error that stopped the check (a draft that can't be read): the run decides what that entry\n * means. The actions come in run order: under `api.documents.strictRelations`, a required\n * relation's target counts as published if it has a published version or an earlier action of the\n * run publishes it (and not if an earlier action unpublishes it).\n */\nexport const getPublishabilityForActions = <TAction extends PublishActionRef>(\n actions: readonly TAction[],\n { strapi }: { strapi: Core.Strapi }\n) =>\n checkPublishActions(actions, (read) => readCheck(read, { strapi }), {\n strapi,\n inRunOrder: true,\n });\n\n/**\n * The validity to store on each publish action, by action id. A draft that can't be read is\n * stored as not publishable and doesn't stop the others, except in a transaction a run conflict\n * (see `isRunConflict`), which is rethrown.\n */\nexport const getValidityForActions = <TAction extends PublishActionRef>(\n actions: readonly TAction[],\n { strapi }: { strapi: Core.Strapi }\n) =>\n checkPublishActions(\n actions,\n async (readPublishability) => toEntryValidity(await readCheck(readPublishability, { strapi })),\n { strapi }\n );\n\n// What an action stores when it's added or changes type\nexport const getActionValidity = async (\n action: DraftRef & Pick<ReleaseAction, 'type'>,\n { strapi }: { strapi: Core.Strapi }\n): Promise<EntryValidity> =>\n action.type === 'publish'\n ? toEntryValidity(\n await readCheck(() => createDraftPublishabilityCheck({ strapi })(action), { strapi })\n )\n : UNPUBLISH_VALIDITY;\n"],"names":["UNPUBLISH_VALIDITY","isEntryValid","reason","getEntryKey","contentType","documentId","locale","JSON","stringify","STAGE_ERROR_MESSAGE","isStageError","error","errors","ValidationError","message","toStageReason","entryStage","requiredStage","id","name","SUBMITTED_VALUE_SUFFIX","getValidationErrors","details","detailErrors","Array","isArray","map","detail","isObject","path","undefined","String","replace","toError","caught","Error","cause","getErrorName","getErrorCode","code","CONFLICT_CODES","Set","isRunConflict","has","toValidationReason","validation","toErrorReason","ApplicationError","toEntryValidity","check","publishable","readCheck","read","strapi","inTransaction","db","savepoint","getAssignedWorkflow","contentTypeUid","workflowsService","plugin","service","populate","computeEntryPublishability","entry","workflow","strictRelations","outcome","publishedVersion","documents","findOne","status","fields","validationError","entityValidator","validateEntityCreation","getModel","isDraft","stageRequiredToPublish","strapi_stage","isAtRequiredStage","stage","getDroppableTarget","attribute","type","required","contentTypes","hasDraftAndPublish","target","keepPublishedTargets","targetUid","value","isTargetPublished","kept","push","keepInComponent","componentUid","filter","keepPublishedRequiredTargets","keepInAttribute","Promise","all","component","__component","modelUid","data","attributes","result","Object","entries","createPublishedVersionLookup","hasPublishedVersionByEntry","Map","key","hasPublished","get","then","published","resolve","set","createDraftPublishabilityCheck","populateBuilderService","config","lookupsByContentType","publishabilityByDraft","hasPublishedVersion","readDraft","draft","releasedInRun","lookups","populateDeep","Infinity","build","getEntry","entryDocumentId","checkedEntry","publishability","checkPublishActions","actions","toResult","inRunOrder","results","action","getStageReason","getPublishabilityForActions","getValidityForActions","readPublishability","getActionValidity"],"mappings":";;;MAiBaA,kBAAAA,GAAoC;IAAEC,YAAAA,EAAc,IAAA;IAAMC,MAAAA,EAAQ;AAAK;AA6BpF;AACO,MAAMC,cAAc,CACzBC,WAAAA,EACAC,YACAC,MAAAA,GACGC,IAAAA,CAAKC,SAAS,CAAC;AAACJ,QAAAA,WAAAA;AAAaC,QAAAA,UAAAA;QAAYC,MAAAA,IAAU;KAAK;AAE7D;AACA,MAAMG,mBAAAA,GAAsB,+CAAA;AAE5B;AACO,MAAMC,YAAAA,GAAe,CAACC,KAAAA,GAC3BA,KAAAA,YAAiBC,MAAAA,CAAOC,eAAe,IAAIF,KAAAA,CAAMG,OAAO,KAAKL;AAE/D,MAAMM,aAAAA,GAAgB,CACpBC,UAAAA,EACAC,aAAAA,IAC+C;AAC/CD,QAAAA,UAAAA,EAAYA,UAAAA,IAAc;AAAEE,YAAAA,EAAAA,EAAIF,WAAWE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AAkBiC,QAAQ,IAAA,GAAOjC,MAAAA;AAC1C;AAEA;;;;;;AAMC,IACM,MAAM8I,2BAAAA,GAA8B,CACzCN,SACA,EAAErF,MAAM,EAA2B,GAEnCoF,mBAAAA,CAAoBC,OAAAA,EAAS,CAACtF,IAAAA,GAASD,UAAUC,IAAAA,EAAM;AAAEC,YAAAA;SAAO,CAAA,EAAI;AAClEA,QAAAA,MAAAA;QACAuF,UAAAA,EAAY;KACd;AAEF;;;;AAIC,IACM,MAAMK,qBAAAA,GAAwB,CACnCP,OAAAA,EACA,EAAErF,MAAM,EAA2B,GAEnCoF,mBAAAA,CACEC,SACA,OAAOQ,kBAAAA,GAAuBlG,eAAAA,CAAgB,MAAMG,UAAU+F,kBAAAA,EAAoB;AAAE7F,YAAAA;SAAO,CAAA,CAAA,EAC3F;AAAEA,QAAAA;KAAO;AAGb;MACa8F,iBAAAA,GAAoB,OAC/BL,MAAAA,EACA,EAAEzF,MAAM,EAA2B,GAEnCyF,MAAAA,CAAO1D,IAAI,KAAK,SAAA,GACZpC,eAAAA,CACE,MAAMG,SAAAA,CAAU,IAAMqE,8BAAAA,CAA+B;AAAEnE,YAAAA;AAAO,SAAA,CAAA,CAAGyF,MAAAA,CAAAA,EAAS;AAAEzF,QAAAA;AAAO,KAAA,CAAA,CAAA,GAErFrD;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@strapi/content-releases",
3
- "version": "5.63.0",
3
+ "version": "5.64.0",
4
4
  "description": "Strapi plugin for organizing and releasing content",
5
5
  "homepage": "https://strapi.io",
6
6
  "bugs": {
@@ -63,11 +63,11 @@
63
63
  },
64
64
  "dependencies": {
65
65
  "@reduxjs/toolkit": "1.9.7",
66
- "@strapi/database": "5.63.0",
66
+ "@strapi/database": "5.64.0",
67
67
  "@strapi/design-system": "2.3.1",
68
68
  "@strapi/icons": "2.3.1",
69
- "@strapi/types": "5.63.0",
70
- "@strapi/utils": "5.63.0",
69
+ "@strapi/types": "5.64.0",
70
+ "@strapi/utils": "5.64.0",
71
71
  "date-fns": "2.30.0",
72
72
  "date-fns-tz": "2.0.1",
73
73
  "formik": "2.4.9",
@@ -78,9 +78,9 @@
78
78
  "yup": "0.32.9"
79
79
  },
80
80
  "devDependencies": {
81
- "@strapi/admin": "5.63.0",
82
- "@strapi/admin-test-utils": "5.63.0",
83
- "@strapi/content-manager": "5.63.0",
81
+ "@strapi/admin": "5.64.0",
82
+ "@strapi/admin-test-utils": "5.64.0",
83
+ "@strapi/content-manager": "5.64.0",
84
84
  "@testing-library/dom": "10.4.1",
85
85
  "@testing-library/jest-dom": "6.9.1",
86
86
  "@testing-library/react": "16.3.2",