diff --git a/frontends/api/src/generated/v1/api.ts b/frontends/api/src/generated/v1/api.ts index 0c8107a283..dd6a8fb2dc 100644 --- a/frontends/api/src/generated/v1/api.ts +++ b/frontends/api/src/generated/v1/api.ts @@ -40,7 +40,7 @@ import { } from "./base" /** - * * `resource_type` - resource_type * `certification` - certification * `certification_type` - certification_type * `offered_by` - offered_by * `platform` - platform * `topic` - topic * `department` - department * `level` - level * `course_feature` - course_feature * `professional` - professional * `free` - free * `learning_format` - learning_format + * * `resource_type` - resource_type * `certification` - certification * `certification_type` - certification_type * `offered_by` - offered_by * `platform` - platform * `topic` - topic * `department` - department * `level` - level * `course_feature` - course_feature * `professional` - professional * `free` - free * `learning_format` - learning_format * `is_learning_material` - is_learning_material * @export * @enum {string} */ @@ -58,6 +58,7 @@ export const AggregationsEnumDescriptions = { professional: "professional", free: "free", learning_format: "learning_format", + is_learning_material: "is_learning_material", } as const export const AggregationsEnum = { @@ -109,6 +110,10 @@ export const AggregationsEnum = { * learning_format */ LearningFormat: "learning_format", + /** + * is_learning_material + */ + IsLearningMaterial: "is_learning_material", } as const export type AggregationsEnum = @@ -3352,6 +3357,12 @@ export interface PercolateQuerySubscriptionRequestRequest { * @memberof PercolateQuerySubscriptionRequestRequest */ certification?: boolean | null + /** + * True if the learning resource is a podcast, podcast episode, video, video playlist, or learning path + * @type {boolean} + * @memberof PercolateQuerySubscriptionRequestRequest + */ + is_learning_material?: boolean | null /** * The type of certificate * `micromasters` - Micromasters Credential * `professional` - Professional Certificate * `completion` - Certificate of Completion * `none` - No Certificate * @type {Array} @@ -11350,6 +11361,7 @@ export const LearningResourcesSearchApiAxiosParamCreator = function ( * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource + * @param {boolean | null} [is_learning_material] True if the learning resource is a podcast, podcast episode, video, video playlist, or learning path * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page @@ -11372,6 +11384,7 @@ export const LearningResourcesSearchApiAxiosParamCreator = function ( department?: Array, free?: boolean | null, id?: Array, + is_learning_material?: boolean | null, learning_format?: Array, level?: Array, limit?: number, @@ -11429,6 +11442,10 @@ export const LearningResourcesSearchApiAxiosParamCreator = function ( localVarQueryParameter["id"] = id } + if (is_learning_material !== undefined) { + localVarQueryParameter["is_learning_material"] = is_learning_material + } + if (learning_format) { localVarQueryParameter["learning_format"] = learning_format } @@ -11510,6 +11527,7 @@ export const LearningResourcesSearchApiFp = function ( * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource + * @param {boolean | null} [is_learning_material] True if the learning resource is a podcast, podcast episode, video, video playlist, or learning path * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page @@ -11532,6 +11550,7 @@ export const LearningResourcesSearchApiFp = function ( department?: Array, free?: boolean | null, id?: Array, + is_learning_material?: boolean | null, learning_format?: Array, level?: Array, limit?: number, @@ -11559,6 +11578,7 @@ export const LearningResourcesSearchApiFp = function ( department, free, id, + is_learning_material, learning_format, level, limit, @@ -11619,6 +11639,7 @@ export const LearningResourcesSearchApiFactory = function ( requestParameters.department, requestParameters.free, requestParameters.id, + requestParameters.is_learning_material, requestParameters.learning_format, requestParameters.level, requestParameters.limit, @@ -11645,7 +11666,7 @@ export const LearningResourcesSearchApiFactory = function ( export interface LearningResourcesSearchApiLearningResourcesSearchRetrieveRequest { /** * Show resource counts by category - * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'learning_format'>} + * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'learning_format' | 'is_learning_material'>} * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve */ readonly aggregations?: Array @@ -11692,6 +11713,13 @@ export interface LearningResourcesSearchApiLearningResourcesSearchRetrieveReques */ readonly id?: Array + /** + * True if the learning resource is a podcast, podcast episode, video, video playlist, or learning path + * @type {boolean} + * @memberof LearningResourcesSearchApiLearningResourcesSearchRetrieve + */ + readonly is_learning_material?: boolean | null + /** * The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @type {Array<'online' | 'hybrid' | 'in_person'>} @@ -11798,6 +11826,7 @@ export class LearningResourcesSearchApi extends BaseAPI { requestParameters.department, requestParameters.free, requestParameters.id, + requestParameters.is_learning_material, requestParameters.learning_format, requestParameters.level, requestParameters.limit, @@ -11831,6 +11860,7 @@ export const LearningResourcesSearchRetrieveAggregationsEnum = { Professional: "professional", Free: "free", LearningFormat: "learning_format", + IsLearningMaterial: "is_learning_material", } as const export type LearningResourcesSearchRetrieveAggregationsEnum = (typeof LearningResourcesSearchRetrieveAggregationsEnum)[keyof typeof LearningResourcesSearchRetrieveAggregationsEnum] @@ -12005,6 +12035,7 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource + * @param {boolean | null} [is_learning_material] True if the learning resource is a podcast, podcast episode, video, video playlist, or learning path * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page @@ -12028,6 +12059,7 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( department?: Array, free?: boolean | null, id?: Array, + is_learning_material?: boolean | null, learning_format?: Array, level?: Array, limit?: number, @@ -12086,6 +12118,10 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( localVarQueryParameter["id"] = id } + if (is_learning_material !== undefined) { + localVarQueryParameter["is_learning_material"] = is_learning_material + } + if (learning_format) { localVarQueryParameter["learning_format"] = learning_format } @@ -12158,6 +12194,7 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource + * @param {boolean | null} [is_learning_material] True if the learning resource is a podcast, podcast episode, video, video playlist, or learning path * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page @@ -12180,6 +12217,7 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( department?: Array, free?: boolean | null, id?: Array, + is_learning_material?: boolean | null, learning_format?: Array, level?: Array, limit?: number, @@ -12237,6 +12275,10 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( localVarQueryParameter["id"] = id } + if (is_learning_material !== undefined) { + localVarQueryParameter["is_learning_material"] = is_learning_material + } + if (learning_format) { localVarQueryParameter["learning_format"] = learning_format } @@ -12305,6 +12347,7 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource + * @param {boolean | null} [is_learning_material] True if the learning resource is a podcast, podcast episode, video, video playlist, or learning path * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page @@ -12329,6 +12372,7 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( department?: Array, free?: boolean | null, id?: Array, + is_learning_material?: boolean | null, learning_format?: Array, level?: Array, limit?: number, @@ -12388,6 +12432,10 @@ export const LearningResourcesUserSubscriptionApiAxiosParamCreator = function ( localVarQueryParameter["id"] = id } + if (is_learning_material !== undefined) { + localVarQueryParameter["is_learning_material"] = is_learning_material + } + if (learning_format) { localVarQueryParameter["learning_format"] = learning_format } @@ -12531,6 +12579,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource + * @param {boolean | null} [is_learning_material] True if the learning resource is a podcast, podcast episode, video, video playlist, or learning path * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page @@ -12554,6 +12603,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( department?: Array, free?: boolean | null, id?: Array, + is_learning_material?: boolean | null, learning_format?: Array, level?: Array, limit?: number, @@ -12582,6 +12632,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( department, free, id, + is_learning_material, learning_format, level, limit, @@ -12619,6 +12670,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource + * @param {boolean | null} [is_learning_material] True if the learning resource is a podcast, podcast episode, video, video playlist, or learning path * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page @@ -12641,6 +12693,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( department?: Array, free?: boolean | null, id?: Array, + is_learning_material?: boolean | null, learning_format?: Array, level?: Array, limit?: number, @@ -12668,6 +12721,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( department, free, id, + is_learning_material, learning_format, level, limit, @@ -12704,6 +12758,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( * @param {Array} [department] The department that offers the learning resource * `1` - Civil and Environmental Engineering * `2` - Mechanical Engineering * `3` - Materials Science and Engineering * `4` - Architecture * `5` - Chemistry * `6` - Electrical Engineering and Computer Science * `7` - Biology * `8` - Physics * `9` - Brain and Cognitive Sciences * `10` - Chemical Engineering * `11` - Urban Studies and Planning * `12` - Earth, Atmospheric, and Planetary Sciences * `14` - Economics * `15` - Sloan School of Management * `16` - Aeronautics and Astronautics * `17` - Political Science * `18` - Mathematics * `20` - Biological Engineering * `21A` - Anthropology * `21G` - Global Studies and Languages * `21H` - History * `21L` - Literature * `21M` - Music and Theater Arts * `22` - Nuclear Science and Engineering * `24` - Linguistics and Philosophy * `CC` - Concourse * `CMS-W` - Comparative Media Studies/Writing * `EC` - Edgerton Center * `ES` - Experimental Study Group * `ESD` - Engineering Systems Division * `HST` - Health Sciences and Technology * `IDS` - Institute for Data, Systems, and Society * `MAS` - Media Arts and Sciences * `PE` - Athletics, Physical Education and Recreation * `RES` - Supplemental Resources * `STS` - Science, Technology, and Society * `WGS` - Women\'s and Gender Studies * @param {boolean | null} [free] * @param {Array} [id] The id value for the learning resource + * @param {boolean | null} [is_learning_material] True if the learning resource is a podcast, podcast episode, video, video playlist, or learning path * @param {Array} [learning_format] The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @param {Array} [level] * @param {number} [limit] Number of results to return per page @@ -12728,6 +12783,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( department?: Array, free?: boolean | null, id?: Array, + is_learning_material?: boolean | null, learning_format?: Array, level?: Array, limit?: number, @@ -12754,6 +12810,7 @@ export const LearningResourcesUserSubscriptionApiFp = function ( department, free, id, + is_learning_material, learning_format, level, limit, @@ -12847,6 +12904,7 @@ export const LearningResourcesUserSubscriptionApiFactory = function ( requestParameters.department, requestParameters.free, requestParameters.id, + requestParameters.is_learning_material, requestParameters.learning_format, requestParameters.level, requestParameters.limit, @@ -12883,6 +12941,7 @@ export const LearningResourcesUserSubscriptionApiFactory = function ( requestParameters.department, requestParameters.free, requestParameters.id, + requestParameters.is_learning_material, requestParameters.learning_format, requestParameters.level, requestParameters.limit, @@ -12918,6 +12977,7 @@ export const LearningResourcesUserSubscriptionApiFactory = function ( requestParameters.department, requestParameters.free, requestParameters.id, + requestParameters.is_learning_material, requestParameters.learning_format, requestParameters.level, requestParameters.limit, @@ -12964,7 +13024,7 @@ export const LearningResourcesUserSubscriptionApiFactory = function ( export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckListRequest { /** * Show resource counts by category - * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'learning_format'>} + * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'learning_format' | 'is_learning_material'>} * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList */ readonly aggregations?: Array @@ -13011,6 +13071,13 @@ export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscr */ readonly id?: Array + /** + * True if the learning resource is a podcast, podcast episode, video, video playlist, or learning path + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionCheckList + */ + readonly is_learning_material?: boolean | null + /** * The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @type {Array<'online' | 'hybrid' | 'in_person'>} @@ -13104,7 +13171,7 @@ export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscr export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionListRequest { /** * Show resource counts by category - * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'learning_format'>} + * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'learning_format' | 'is_learning_material'>} * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList */ readonly aggregations?: Array @@ -13151,6 +13218,13 @@ export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscr */ readonly id?: Array + /** + * True if the learning resource is a podcast, podcast episode, video, video playlist, or learning path + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionList + */ + readonly is_learning_material?: boolean | null + /** * The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @type {Array<'online' | 'hybrid' | 'in_person'>} @@ -13237,7 +13311,7 @@ export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscr export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreateRequest { /** * Show resource counts by category - * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'learning_format'>} + * @type {Array<'resource_type' | 'certification' | 'certification_type' | 'offered_by' | 'platform' | 'topic' | 'department' | 'level' | 'course_feature' | 'professional' | 'free' | 'learning_format' | 'is_learning_material'>} * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate */ readonly aggregations?: Array @@ -13284,6 +13358,13 @@ export interface LearningResourcesUserSubscriptionApiLearningResourcesUserSubscr */ readonly id?: Array + /** + * True if the learning resource is a podcast, podcast episode, video, video playlist, or learning path + * @type {boolean} + * @memberof LearningResourcesUserSubscriptionApiLearningResourcesUserSubscriptionSubscribeCreate + */ + readonly is_learning_material?: boolean | null + /** * The format(s) in which the learning resource is offered * `online` - Online * `hybrid` - Hybrid * `in_person` - In person * @type {Array<'online' | 'hybrid' | 'in_person'>} @@ -13418,6 +13499,7 @@ export class LearningResourcesUserSubscriptionApi extends BaseAPI { requestParameters.department, requestParameters.free, requestParameters.id, + requestParameters.is_learning_material, requestParameters.learning_format, requestParameters.level, requestParameters.limit, @@ -13456,6 +13538,7 @@ export class LearningResourcesUserSubscriptionApi extends BaseAPI { requestParameters.department, requestParameters.free, requestParameters.id, + requestParameters.is_learning_material, requestParameters.learning_format, requestParameters.level, requestParameters.limit, @@ -13493,6 +13576,7 @@ export class LearningResourcesUserSubscriptionApi extends BaseAPI { requestParameters.department, requestParameters.free, requestParameters.id, + requestParameters.is_learning_material, requestParameters.learning_format, requestParameters.level, requestParameters.limit, @@ -13548,6 +13632,7 @@ export const LearningResourcesUserSubscriptionCheckListAggregationsEnum = { Professional: "professional", Free: "free", LearningFormat: "learning_format", + IsLearningMaterial: "is_learning_material", } as const export type LearningResourcesUserSubscriptionCheckListAggregationsEnum = (typeof LearningResourcesUserSubscriptionCheckListAggregationsEnum)[keyof typeof LearningResourcesUserSubscriptionCheckListAggregationsEnum] @@ -13728,6 +13813,7 @@ export const LearningResourcesUserSubscriptionListAggregationsEnum = { Professional: "professional", Free: "free", LearningFormat: "learning_format", + IsLearningMaterial: "is_learning_material", } as const export type LearningResourcesUserSubscriptionListAggregationsEnum = (typeof LearningResourcesUserSubscriptionListAggregationsEnum)[keyof typeof LearningResourcesUserSubscriptionListAggregationsEnum] @@ -13900,6 +13986,7 @@ export const LearningResourcesUserSubscriptionSubscribeCreateAggregationsEnum = Professional: "professional", Free: "free", LearningFormat: "learning_format", + IsLearningMaterial: "is_learning_material", } as const export type LearningResourcesUserSubscriptionSubscribeCreateAggregationsEnum = (typeof LearningResourcesUserSubscriptionSubscribeCreateAggregationsEnum)[keyof typeof LearningResourcesUserSubscriptionSubscribeCreateAggregationsEnum] diff --git a/learning_resources_search/api.py b/learning_resources_search/api.py index 8147900ce1..2f7fe833ce 100644 --- a/learning_resources_search/api.py +++ b/learning_resources_search/api.py @@ -38,7 +38,7 @@ LEARN_SUGGEST_FIELDS = ["title.trigram", "description.trigram"] COURSENUM_SORT_FIELD = "course.course_numbers.sort_coursenum" -DEFAULT_SORT = "-created_on" +DEFAULT_SORT = ["is_learning_material", "-created_on"] def gen_content_file_id(content_file_id): @@ -551,7 +551,7 @@ def construct_search(search_params): sort = generate_sort_clause(search_params) search = search.sort(sort) elif not search_params.get("q"): - search = search.sort(DEFAULT_SORT) + search = search.sort(*DEFAULT_SORT) if search_params.get("endpoint") == CONTENT_FILE_TYPE: query_type_query = {"exists": {"field": "content_type"}} @@ -598,7 +598,6 @@ def execute_learn_search(search_params): """ search = construct_search(search_params) - return search.execute().to_dict() diff --git a/learning_resources_search/api_test.py b/learning_resources_search/api_test.py index 5498ab2544..144b4b721d 100644 --- a/learning_resources_search/api_test.py +++ b/learning_resources_search/api_test.py @@ -1428,6 +1428,7 @@ def test_execute_learn_search_for_learning_resource_query(opensearch): "course.course_numbers.sort_coursenum", "course.course_numbers.primary", "resource_relations", + "is_learning_material", ] }, } @@ -1630,6 +1631,7 @@ def test_execute_learn_search_for_content_file_query(opensearch): "course.course_numbers.sort_coursenum", "course.course_numbers.primary", "resource_relations", + "is_learning_material", ] }, } @@ -1760,7 +1762,7 @@ def test_document_percolation(opensearch, mocker): [ ("-views", None, [{"views": {"order": "desc"}}]), ("-views", "text", [{"views": {"order": "desc"}}]), - (None, None, [{"created_on": {"order": "desc"}}]), + (None, None, ["is_learning_material", {"created_on": {"order": "desc"}}]), (None, "text", None), ], ) diff --git a/learning_resources_search/constants.py b/learning_resources_search/constants.py index 79d2f1e4b6..b136ae9b92 100644 --- a/learning_resources_search/constants.py +++ b/learning_resources_search/constants.py @@ -74,6 +74,7 @@ class FilterConfig: "platform": FilterConfig("platform.code"), "offered_by": FilterConfig("offered_by.code"), "learning_format": FilterConfig("learning_format.code"), + "is_learning_material": FilterConfig("is_learning_material"), } SEARCH_NESTED_FILTERS = { @@ -368,4 +369,5 @@ class FilterConfig: "course.course_numbers.sort_coursenum", "course.course_numbers.primary", "resource_relations", + "is_learning_material", ] diff --git a/learning_resources_search/serializers.py b/learning_resources_search/serializers.py index 3c09c2006c..92734b85d0 100644 --- a/learning_resources_search/serializers.py +++ b/learning_resources_search/serializers.py @@ -38,6 +38,8 @@ from learning_resources_search.api import gen_content_file_id from learning_resources_search.constants import ( CONTENT_FILE_TYPE, + COURSE_TYPE, + PROGRAM_TYPE, ) from learning_resources_search.models import PercolateQuery from learning_resources_search.utils import remove_child_queries @@ -79,6 +81,8 @@ def serialize_learning_resource_for_update( return { "resource_relations": {"name": "resource"}, "created_on": learning_resource_obj.created_on, + "is_learning_material": learning_resource_obj.resource_type + not in [COURSE_TYPE, PROGRAM_TYPE], **serialized_data, } @@ -175,6 +179,7 @@ def to_representation(self, obj): "professional", "free", "learning_format", + "is_learning_material", ] CONTENT_FILE_AGGREGATIONS = ["topic", "content_feature_type", "platform", "offered_by"] @@ -261,6 +266,13 @@ class LearningResourcesSearchRequestSerializer(SearchRequestSerializer): default=None, help_text="True if the learning resource offers a certificate", ) + is_learning_material = ArrayWrappedBoolean( + required=False, + allow_null=True, + default=None, + help_text="True if the learning resource is a podcast, podcast episode, video, " + "video playlist, or learning path", + ) certification_choices = CertificationType.as_tuple() certification_type = StringArrayField( required=False, diff --git a/learning_resources_search/serializers_test.py b/learning_resources_search/serializers_test.py index 7411de8710..5817bd19a1 100644 --- a/learning_resources_search/serializers_test.py +++ b/learning_resources_search/serializers_test.py @@ -142,6 +142,7 @@ "url": "http://xpro.mit.edu/courses/course-v1:xPRO+MCPO+R1/", "resource_type": "course", "platform": "globalalumni", + "is_learning_material": False, }, } ], @@ -278,6 +279,7 @@ "url": "http://xpro.mit.edu/courses/course-v1:xPRO+MCPO+R1/", "resource_type": "course", "platform": "globalalumni", + "is_learning_material": False, } ], "metadata": { @@ -344,6 +346,7 @@ "last_modified": None, "runs": [], "course_feature": [], + "is_learning_material": True, "user_list_parents": [], }, } @@ -507,6 +510,7 @@ "last_modified": None, "runs": [], "course_feature": [], + "is_learning_material": True, "user_list_parents": [], } ], @@ -589,6 +593,7 @@ def test_serialize_learning_resource_for_bulk(resource_type, is_professional, no "_id": resource.id, "resource_relations": {"name": "resource"}, "created_on": resource.created_on, + "is_learning_material": resource.resource_type not in ["course", "program"], **free_dict, **LearningResourceSerializer(resource).data, } @@ -635,6 +640,7 @@ def test_serialize_course_numbers_for_bulk( "resource_relations": {"name": "resource"}, "created_on": resource.created_on, "free": False, + "is_learning_material": False, **LearningResourceSerializer(resource).data, } expected_data["course"]["course_numbers"][0] = { @@ -713,6 +719,7 @@ def test_learning_resources_search_request_serializer(): "certification": "false", "certification_type": CertificationType.none.name, "free": True, + "is_learning_material": True, "offered_by": "xpro,ocw", "platform": "xpro,edx,ocw", "topic": "Math", @@ -730,6 +737,7 @@ def test_learning_resources_search_request_serializer(): "sortby": "-start_date", "professional": [True], "certification": [False], + "is_learning_material": [True], "certification_type": [CertificationType.none.name], "free": [True], "offered_by": ["xpro", "ocw"], diff --git a/openapi/specs/v1.yaml b/openapi/specs/v1.yaml index b0ef46d0ce..1fc9a1b160 100644 --- a/openapi/specs/v1.yaml +++ b/openapi/specs/v1.yaml @@ -2093,6 +2093,7 @@ paths: - professional - free - learning_format + - is_learning_material type: string description: |- * `resource_type` - resource_type @@ -2107,6 +2108,7 @@ paths: * `professional` - professional * `free` - free * `learning_format` - learning_format + * `is_learning_material` - is_learning_material description: Show resource counts by category - in: query name: certification @@ -2254,6 +2256,13 @@ paths: items: type: integer description: The id value for the learning resource + - in: query + name: is_learning_material + schema: + type: boolean + nullable: true + description: True if the learning resource is a podcast, podcast episode, + video, video playlist, or learning path - in: query name: learning_format schema: @@ -2494,6 +2503,7 @@ paths: - professional - free - learning_format + - is_learning_material type: string description: |- * `resource_type` - resource_type @@ -2508,6 +2518,7 @@ paths: * `professional` - professional * `free` - free * `learning_format` - learning_format + * `is_learning_material` - is_learning_material description: Show resource counts by category - in: query name: certification @@ -2655,6 +2666,13 @@ paths: items: type: integer description: The id value for the learning resource + - in: query + name: is_learning_material + schema: + type: boolean + nullable: true + description: True if the learning resource is a podcast, podcast episode, + video, video playlist, or learning path - in: query name: learning_format schema: @@ -2920,6 +2938,7 @@ paths: - professional - free - learning_format + - is_learning_material type: string description: |- * `resource_type` - resource_type @@ -2934,6 +2953,7 @@ paths: * `professional` - professional * `free` - free * `learning_format` - learning_format + * `is_learning_material` - is_learning_material description: Show resource counts by category - in: query name: certification @@ -3081,6 +3101,13 @@ paths: items: type: integer description: The id value for the learning resource + - in: query + name: is_learning_material + schema: + type: boolean + nullable: true + description: True if the learning resource is a podcast, podcast episode, + video, video playlist, or learning path - in: query name: learning_format schema: @@ -3337,6 +3364,7 @@ paths: - professional - free - learning_format + - is_learning_material type: string description: |- * `resource_type` - resource_type @@ -3351,6 +3379,7 @@ paths: * `professional` - professional * `free` - free * `learning_format` - learning_format + * `is_learning_material` - is_learning_material description: Show resource counts by category - in: query name: certification @@ -3498,6 +3527,13 @@ paths: items: type: integer description: The id value for the learning resource + - in: query + name: is_learning_material + schema: + type: boolean + nullable: true + description: True if the learning resource is a podcast, podcast episode, + video, video playlist, or learning path - in: query name: learning_format schema: @@ -6873,6 +6909,7 @@ components: - professional - free - learning_format + - is_learning_material type: string description: |- * `resource_type` - resource_type @@ -6887,6 +6924,7 @@ components: * `professional` - professional * `free` - free * `learning_format` - learning_format + * `is_learning_material` - is_learning_material x-enum-descriptions: - resource_type - certification @@ -6900,6 +6938,7 @@ components: - professional - free - learning_format + - is_learning_material Article: type: object description: Serializer for LearningResourceInstructor model @@ -9218,6 +9257,11 @@ components: type: boolean nullable: true description: True if the learning resource offers a certificate + is_learning_material: + type: boolean + nullable: true + description: True if the learning resource is a podcast, podcast episode, + video, video playlist, or learning path certification_type: type: array items: