diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 8a3c963d..2a9a84a9 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -14,6 +14,15 @@ Change Log Unreleased ---------- +[8.3.0] - 2023-07-04 +-------------------- +Changed +~~~~~~~ +* Added new XBLOCK_CREATED and XBLOCK_UPDATED events in content_authoring. +* Added new COURSE_CREATED and COURSE_UPDATED events in content_authoring. +* Added new CONTENT_LIBRARY_CREATED, CONTENT_LIBRARY_UPDATED and CONTENT_LIBRARY_DELETED events in content_authoring. +* Added new LIBRARY_BLOCK_CREATED, LIBRARY_BLOCK_UPDATED and LIBRARY_BLOCK_DELETED events in content_authoring. + [8.2.0] - 2023-06-08 -------------------- Changed diff --git a/openedx_events/__init__.py b/openedx_events/__init__.py index a6dcc808..5dbea635 100644 --- a/openedx_events/__init__.py +++ b/openedx_events/__init__.py @@ -5,4 +5,4 @@ more information about the project. """ -__version__ = "8.2.0" +__version__ = "8.3.0" diff --git a/openedx_events/content_authoring/data.py b/openedx_events/content_authoring/data.py index f9dcc872..05b1f24c 100644 --- a/openedx_events/content_authoring/data.py +++ b/openedx_events/content_authoring/data.py @@ -14,6 +14,18 @@ from opaque_keys.edx.keys import CourseKey, UsageKey +@attr.s(frozen=True) +class CourseData: + """ + Attributes defined for Open edX Course object. + + Arguments: + course_key (str): identifier of the Course object. + """ + + course_key = attr.ib(type=CourseKey) + + @attr.s(frozen=True) class CourseScheduleData: """ diff --git a/openedx_events/content_authoring/signals.py b/openedx_events/content_authoring/signals.py index 8421cb8b..7dad4f33 100644 --- a/openedx_events/content_authoring/signals.py +++ b/openedx_events/content_authoring/signals.py @@ -7,6 +7,7 @@ They also must comply with the payload definition specified in docs/decisions/0003-events-payload.rst """ +from opaque_keys.edx.locator import LibraryLocatorV2, LibraryUsageLocatorV2 from openedx_events.content_authoring.data import ( CertificateConfigData, @@ -14,6 +15,7 @@ DuplicatedXBlockData, XBlockData, ) +from openedx_events.content_authoring.data import CourseData from openedx_events.tooling import OpenEdxPublicSignal # .. event_type: org.openedx.content_authoring.course.catalog_info.changed.v1 @@ -27,6 +29,27 @@ } ) +# .. event_type: org.openedx.content_authoring.xblock.created.v1 +# .. event_name: XBLOCK_CREATED +# .. event_description: Fired when an XBlock is created. +# .. event_data: XBlockData +XBLOCK_CREATED = OpenEdxPublicSignal( + event_type="org.openedx.content_authoring.xblock.created.v1", + data={ + "xblock_info": XBlockData, + } +) + +# .. event_type: org.openedx.content_authoring.xblock.updated.v1 +# .. event_name: XBLOCK_UPDATED +# .. event_description: Fired when an XBlock is updated. +# .. event_data: XBlockData +XBLOCK_UPDATED = OpenEdxPublicSignal( + event_type="org.openedx.content_authoring.xblock.updated.v1", + data={ + "xblock_info": XBlockData, + } +) # .. event_type: org.openedx.content_authoring.xblock.published.v1 # .. event_name: XBLOCK_PUBLISHED @@ -92,3 +115,95 @@ "certificate_config": CertificateConfigData, } ) + +# .. event_type: org.openedx.content_authoring.course.created.v1 +# .. event_name: COURSE_CREATED +# .. event_description: emitted when a course is created +# .. event_data: CourseData +COURSE_CREATED = OpenEdxPublicSignal( + event_type="org.openedx.content_authoring.course.created.v1", + data={ + "course": CourseData, + } +) + +# .. event_type: org.openedx.content_authoring.course.updated.v1 +# .. event_name: COURSE_UPDATED +# .. event_description: emitted when a course is created +# .. event_data: CourseData +COURSE_UPDATED = OpenEdxPublicSignal( + event_type="org.openedx.content_authoring.course.updated.v1", + data={ + "course": CourseData, + } +) + +# .. event_type: org.openedx.content_authoring.content_library.created.v1 +# .. event_name: CONTENT_LIBRARY_CREATED +# .. event_description: emitted when a content library is created +# .. event_data: +CONTENT_LIBRARY_CREATED = OpenEdxPublicSignal( + event_type="org.openedx.content_authoring.content_library.created.v1", + data={ + "library_key": LibraryLocatorV2, + } +) + +# .. event_type: org.openedx.content_authoring.content_library.updated.v1 +# .. event_name: CONTENT_LIBRARY_UPDATED +# .. event_description: emitted when a content library is updated +# .. event_data: +CONTENT_LIBRARY_UPDATED = OpenEdxPublicSignal( + event_type="org.openedx.content_authoring.content_library.updated.v1", + data={ + "library_key": LibraryLocatorV2, + "update_blocks": bool + } +) + +# .. event_type: org.openedx.content_authoring.content_library.deleted.v1 +# .. event_name: CONTENT_LIBRARY_DELETED +# .. event_description: emitted when a content library is deleted +# .. event_data: +CONTENT_LIBRARY_DELETED = OpenEdxPublicSignal( + event_type="org.openedx.content_authoring.content_library.deleted.v1", + data={ + "library_key": LibraryLocatorV2, + } +) + +# .. event_type: org.openedx.content_authoring.library_block.created.v1 +# .. event_name: LIBRARY_BLOCK_CREATED +# .. event_description: emitted when a library block is created +# .. event_data: +LIBRARY_BLOCK_CREATED = OpenEdxPublicSignal( + event_type="org.openedx.content_authoring.library_block.created.v1", + data={ + "library_key": LibraryLocatorV2, + "usage_key": LibraryUsageLocatorV2, + } +) + +# .. event_type: org.openedx.content_authoring.library_block.updated.v1 +# .. event_name: LIBRARY_BLOCK_UPDATED +# .. event_description: emitted when a library block is updated +# .. event_data: +LIBRARY_BLOCK_UPDATED = OpenEdxPublicSignal( + event_type="org.openedx.content_authoring.library_block.updated.v1", + data={ + "library_key": LibraryLocatorV2, + "usage_key": LibraryUsageLocatorV2, + } +) + +# .. event_type: org.openedx.content_authoring.library_block.deleted.v1 +# .. event_name: LIBRARY_BLOCK_DELETED +# .. event_description: emitted when a library block is deleted +# .. event_data: +LIBRARY_BLOCK_DELETED = OpenEdxPublicSignal( + event_type="org.openedx.content_authoring.library_block.deleted.v1", + data={ + "library_key": LibraryLocatorV2, + "usage_key": LibraryUsageLocatorV2, + } +)