@brightspace-hmc/siren-sdk
Advanced tools
Comparing version 3.5.0 to 3.6.0
{ | ||
"name": "@brightspace-hmc/siren-sdk", | ||
"version": "3.5.0", | ||
"version": "3.6.0", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "description": "", |
@@ -1,5 +0,7 @@ | ||
import { Actions, Rels } from '../../hypermedia-constants.js'; | ||
import { Actions, Classes, Rels } from '../../hypermedia-constants.js'; | ||
import ContentHelperFunctions from './ContentHelperFunctions.js'; | ||
import { Entity } from '../../es6/Entity.js'; | ||
import { performSirenAction } from '../../es6/SirenAction.js'; | ||
const HUMAN_GENERATED = 0; | ||
const AI_INSPIRED = 3; | ||
@@ -44,2 +46,6 @@ /** | ||
isAiInspired() { | ||
return this._entity && this._entity.hasClass(Classes.content.aiInspired); | ||
} | ||
/** | ||
@@ -67,2 +73,13 @@ * @returns {string|undefined} Title of the content-module item | ||
/** | ||
* @summary Set AiInspired property if summary has been ai inspired | ||
* @param {object} summary the summary that's being modified | ||
*/ | ||
async setIsAiInspired(isAiInspired) { | ||
const action = this._entity.getActionByName(Actions.content.updateDescription); | ||
if (!this._entity || !action || isAiInspired !== this.isAiInspired()) return; | ||
const fields = [{ name: 'aiHumanOrigin', value: isAiInspired ? AI_INSPIRED : HUMAN_GENERATED }]; | ||
await performSirenAction(this._token, action, fields); | ||
} | ||
/** | ||
* @returns {string} The orgUnitId of the content-module (read-only) | ||
@@ -69,0 +86,0 @@ */ |
@@ -387,3 +387,4 @@ export const Rels = { | ||
rawDescription: 'raw-description', | ||
lastModified: 'lastModified' | ||
lastModified: 'lastModified', | ||
aiInspired: 'ai-inspired', | ||
}, | ||
@@ -390,0 +391,0 @@ contentStyler: { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
411004
11372