diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c49ab2c7..6f22ea47 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,10 @@ Change Log Unreleased ---------- +Added +~~~~~ +* Added new ``LIBRARY_COLLECTION_CREATED``, ``LIBRARY_COLLECTION_UPDATED`` and ``LIBRARY_COLLECTION_DELETED`` events in content_authoring. + [9.12.0] - 2024-07-31 --------------------- diff --git a/openedx_events/__init__.py b/openedx_events/__init__.py index 434522ad..445806a0 100644 --- a/openedx_events/__init__.py +++ b/openedx_events/__init__.py @@ -5,4 +5,4 @@ more information about the project. """ -__version__ = "9.12.0" +__version__ = "9.13.0" diff --git a/openedx_events/content_authoring/data.py b/openedx_events/content_authoring/data.py index 1483ddbc..c48a0b5a 100644 --- a/openedx_events/content_authoring/data.py +++ b/openedx_events/content_authoring/data.py @@ -194,3 +194,17 @@ class ContentObjectData: """ object_id = attr.ib(type=str) + + +@attr.s(frozen=True) +class LibraryCollectionData: + """ + Data about changed content library Collection. + + Arguments: + library_key (LibraryLocatorV2): a key that represents a Blockstore-based content library. + collection_id (int): an id (pk) that represents a collection associated with the content library. + """ + + library_key = attr.ib(type=LibraryLocatorV2) + collection_id = attr.ib(type=int) diff --git a/openedx_events/content_authoring/signals.py b/openedx_events/content_authoring/signals.py index 495d14d9..2b00ea15 100644 --- a/openedx_events/content_authoring/signals.py +++ b/openedx_events/content_authoring/signals.py @@ -15,6 +15,7 @@ CourseData, DuplicatedXBlockData, LibraryBlockData, + LibraryCollectionData, XBlockData, ) from openedx_events.tooling import OpenEdxPublicSignal @@ -210,3 +211,36 @@ "content_object": ContentObjectData } ) + +# .. event_type: org.openedx.content_authoring.content.library.collection.created.v1 +# .. event_name: LIBRARY_COLLECTION_CREATED +# .. event_description: emitted when a content library collection is created +# .. event_data: LibraryCollectionData +LIBRARY_COLLECTION_CREATED = OpenEdxPublicSignal( + event_type="org.openedx.content_authoring.content.library.collection.created.v1", + data={ + "library_collection": LibraryCollectionData + } +) + +# .. event_type: org.openedx.content_authoring.content.library.collection.updated.v1 +# .. event_name: LIBRARY_COLLECTION_UPDATED +# .. event_description: emitted when when a content library collection is updated +# .. event_data: LibraryCollectionData +LIBRARY_COLLECTION_UPDATED = OpenEdxPublicSignal( + event_type="org.openedx.content_authoring.content.library.collection.updated.v1", + data={ + "library_collection": LibraryCollectionData + } +) + +# .. event_type: org.openedx.content_authoring.content.library.collection.deleted.v1 +# .. event_name: LIBRARY_COLLECTION_DELETED +# .. event_description: emitted when an when a content library collection is deleted +# .. event_data: LibraryCollectionData +LIBRARY_COLLECTION_DELETED = OpenEdxPublicSignal( + event_type="org.openedx.content_authoring.content.library.collection.deleted.v1", + data={ + "library_collection": LibraryCollectionData + } +)