-
Notifications
You must be signed in to change notification settings - Fork 23
/
Copy pathsignals.py
291 lines (265 loc) · 11.1 KB
/
signals.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
"""
Standardized signals definitions for events within the architecture subdomain ``content_authoring``.
All signals defined in this module must follow the name and versioning
conventions specified in OEP-41.
They also must comply with the payload definition specified in
docs/decisions/0003-events-payload.rst
"""
from openedx_events.content_authoring.data import (
CertificateConfigData,
ContentLibraryData,
ContentObjectChangedData,
ContentObjectData,
CourseCatalogData,
CourseData,
DuplicatedXBlockData,
LibraryBlockData,
LibraryCollectionData,
XBlockData,
)
from openedx_events.tooling import OpenEdxPublicSignal
# .. event_type: org.openedx.content_authoring.course.catalog_info.changed.v1
# .. event_name: COURSE_CATALOG_INFO_CHANGED
# .. event_key_field: catalog_info.course_key
# .. event_description: Fired when a course changes in Studio in a way that is relevant for catalog consumers.
# .. event_data: CourseCatalogData
# .. event_trigger_repository: openedx/edx-platform
COURSE_CATALOG_INFO_CHANGED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.course.catalog_info.changed.v1",
data={
"catalog_info": CourseCatalogData,
}
)
# .. event_type: org.openedx.content_authoring.xblock.created.v1
# .. event_name: XBLOCK_CREATED
# .. event_key_field: xblock_info.usage_key
# .. event_description: Fired when an XBlock is created.
# .. event_data: XBlockData
# .. event_trigger_repository: openedx/edx-platform
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_key_field: xblock_info.usage_key
# .. event_description: Fired when an XBlock is updated.
# .. event_data: XBlockData
# .. event_trigger_repository: openedx/edx-platform
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
# .. event_key_field: xblock_info.usage_key
# .. event_description: Fired when an XBlock is published. If a parent block
# with changes in one or more child blocks is published, only a single
# XBLOCK_PUBLISHED event is fired with parent block details.
# For example: If a section is published with changes in multiple units,
# only a single event is fired with section details like :
# `XBlockData(usage_key="section-usage-key", block_type="chapter")`
# .. event_data: XBlockData
# .. event_trigger_repository: openedx/edx-platform
XBLOCK_PUBLISHED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.xblock.published.v1",
data={
"xblock_info": XBlockData,
}
)
# .. event_type: org.openedx.content_authoring.xblock.deleted.v1
# .. event_name: XBLOCK_DELETED
# .. event_key_field: xblock_info.usage_key
# .. event_description: Fired when an XBlock is deleted.
# .. event_data: XBlockData
# .. event_trigger_repository: openedx/edx-platform
XBLOCK_DELETED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.xblock.deleted.v1",
data={
"xblock_info": XBlockData,
}
)
# .. event_type: org.openedx.content_authoring.xblock.duplicated.v1
# .. event_name: XBLOCK_DUPLICATED
# .. event_key_field: xblock_info.usage_key
# .. event_description: Fired when an XBlock is duplicated in Studio.
# .. event_data: DuplicatedXBlockData
# .. event_trigger_repository: openedx/edx-platform
XBLOCK_DUPLICATED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.xblock.duplicated.v1",
data={
"xblock_info": DuplicatedXBlockData,
}
)
# .. event_type: org.openedx.content_authoring.course.certificate_config.changed.v1
# .. event_name: COURSE_CERTIFICATE_CONFIG_CHANGED
# .. event_description: Fired when a course certificate configuration changes in Studio.
# .. event_data: CertificateConfigData
# .. event_warning: This event is not being currently used in any of the Open edX services. Review
# https://github.com/openedx/openedx-events/issues/445 for more information about the future of this event.
COURSE_CERTIFICATE_CONFIG_CHANGED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.course.certificate_config.changed.v1",
data={
"certificate_config": CertificateConfigData,
}
)
# .. event_type: org.openedx.content_authoring.course.certificate_config.deleted.v1
# .. event_name: COURSE_CERTIFICATE_CONFIG_DELETED
# .. event_description: Fired when a course certificate configuration deletes in Studio.
# .. event_data: CertificateConfigData
# .. event_warning: This event is not being currently used in any of the Open edX services. Review
# https://github.com/openedx/openedx-events/issues/445 for more information about the future of this event.
COURSE_CERTIFICATE_CONFIG_DELETED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.course.certificate_config.deleted.v1",
data={
"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
# .. event_trigger_repository: openedx/edx-platform
COURSE_CREATED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.course.created.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: ContentLibraryData
# .. event_trigger_repository: openedx/edx-platform
CONTENT_LIBRARY_CREATED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.content_library.created.v1",
data={
"content_library": ContentLibraryData,
}
)
# .. 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: ContentLibraryData
# .. event_trigger_repository: openedx/edx-platform
CONTENT_LIBRARY_UPDATED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.content_library.updated.v1",
data={
"content_library": ContentLibraryData,
}
)
# .. 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: ContentLibraryData
# .. event_trigger_repository: openedx/edx-platform
CONTENT_LIBRARY_DELETED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.content_library.deleted.v1",
data={
"content_library": ContentLibraryData,
}
)
# .. 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: LibraryBlockData
# .. event_trigger_repository: openedx/edx-platform
LIBRARY_BLOCK_CREATED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.library_block.created.v1",
data={
"library_block": LibraryBlockData,
}
)
# .. 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: LibraryBlockData
# .. event_trigger_repository: openedx/edx-platform
LIBRARY_BLOCK_UPDATED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.library_block.updated.v1",
data={
"library_block": LibraryBlockData,
}
)
# .. 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: LibraryBlockData
# .. event_trigger_repository: openedx/edx-platform
LIBRARY_BLOCK_DELETED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.library_block.deleted.v1",
data={
"library_block": LibraryBlockData,
}
)
# .. event_type: org.openedx.content_authoring.content.object.associations.changed.v1
# .. event_name: CONTENT_OBJECT_ASSOCIATIONS_CHANGED
# .. event_description: Emitted when an object's associations are changed, e.g tags, collections
# .. event_data: ContentObjectChangedData
# .. event_trigger_repository: openedx/edx-platform
CONTENT_OBJECT_ASSOCIATIONS_CHANGED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.content.object.associations.changed.v1",
data={
"content_object": ContentObjectChangedData
}
)
# .. event_type: org.openedx.content_authoring.content.object.tags.changed.v1
# .. event_name: CONTENT_OBJECT_TAGS_CHANGED
# .. event_description: Emitted when an object's tags are changed.
# .. event_data: ContentObjectData
# .. event_warning: **DEPRECATED** please use CONTENT_OBJECT_ASSOCIATIONS_CHANGED instead.
CONTENT_OBJECT_TAGS_CHANGED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.content.object.tags.changed.v1",
data={
"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
# .. event_trigger_repository: openedx/edx-platform
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
# .. event_trigger_repository: openedx/edx-platform
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
# .. event_trigger_repository: openedx/edx-platform
LIBRARY_COLLECTION_DELETED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.content_library.collection.deleted.v1",
data={
"library_collection": LibraryCollectionData
}
)
# .. event_type: org.openedx.content_authoring.course.import.completed.v1
# .. event_name: COURSE_IMPORT_COMPLETED
# .. event_key_field: catalog_info.course_key
# .. event_description: Fired after a course is imported
# .. event_data: CourseData
# .. event_trigger_repository: openedx/edx-platform
COURSE_IMPORT_COMPLETED = OpenEdxPublicSignal(
event_type="org.openedx.content_authoring.course.import.completed.v1",
data={
"course": CourseData,
}
)