@learnorama/mozaik-sdk 0.12.4-staging.47.1 → 0.13.0-staging.48.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/api/account.d.ts +1 -1
- package/dist/api/account.js.map +1 -1
- package/dist/api/admin-catalogue.d.ts +1 -1
- package/dist/api/admin-catalogue.js.map +1 -1
- package/dist/api/admin-consumption.d.ts +1 -1
- package/dist/api/admin-consumption.js.map +1 -1
- package/dist/api/admin-contracts.d.ts +1 -1
- package/dist/api/admin-contracts.js.map +1 -1
- package/dist/api/admin-desk.d.ts +1 -1
- package/dist/api/admin-desk.js.map +1 -1
- package/dist/api/admin-licenses.d.ts +1 -1
- package/dist/api/admin-licenses.js.map +1 -1
- package/dist/api/admin-partner-selections.d.ts +1 -1
- package/dist/api/admin-partner-selections.js.map +1 -1
- package/dist/api/admin-patrons.d.ts +1 -1
- package/dist/api/admin-patrons.js.map +1 -1
- package/dist/api/admin-reviews.d.ts +1 -1
- package/dist/api/admin-reviews.js.map +1 -1
- package/dist/api/admin-roles.d.ts +1 -1
- package/dist/api/admin-roles.js.map +1 -1
- package/dist/api/admin-support.d.ts +1 -1
- package/dist/api/admin-support.js.map +1 -1
- package/dist/api/admin-tenants.d.ts +1 -1
- package/dist/api/admin-tenants.js.map +1 -1
- package/dist/api/admin-tutoring.d.ts +1 -1
- package/dist/api/admin-tutoring.js.map +1 -1
- package/dist/api/auth.d.ts +1 -1
- package/dist/api/auth.js.map +1 -1
- package/dist/api/biblio-billing-webhooks.d.ts +18 -0
- package/dist/api/biblio-billing-webhooks.js +62 -0
- package/dist/api/biblio-billing-webhooks.js.map +1 -0
- package/dist/api/biblio-billing.d.ts +192 -0
- package/dist/api/biblio-billing.js +645 -0
- package/dist/api/biblio-billing.js.map +1 -0
- package/dist/api/biblio-catalogue.d.ts +1 -1
- package/dist/api/biblio-catalogue.js.map +1 -1
- package/dist/api/biblio-home.d.ts +1 -1
- package/dist/api/biblio-home.js.map +1 -1
- package/dist/api/biblio-learning-author-profiles.d.ts +108 -0
- package/dist/api/biblio-learning-author-profiles.js +331 -0
- package/dist/api/biblio-learning-author-profiles.js.map +1 -0
- package/dist/api/biblio-learning-authoring.d.ts +168 -0
- package/dist/api/biblio-learning-authoring.js +586 -0
- package/dist/api/biblio-learning-authoring.js.map +1 -0
- package/dist/api/biblio-learning-editorial.d.ts +54 -0
- package/dist/api/biblio-learning-editorial.js +149 -0
- package/dist/api/biblio-learning-editorial.js.map +1 -0
- package/dist/api/biblio-learning-feedback.d.ts +60 -0
- package/dist/api/biblio-learning-feedback.js +180 -0
- package/dist/api/biblio-learning-feedback.js.map +1 -0
- package/dist/api/biblio-learning-finance.d.ts +186 -0
- package/dist/api/biblio-learning-finance.js +622 -0
- package/dist/api/biblio-learning-finance.js.map +1 -0
- package/dist/api/biblio-learning-integrations.d.ts +60 -0
- package/dist/api/biblio-learning-integrations.js +215 -0
- package/dist/api/biblio-learning-integrations.js.map +1 -0
- package/dist/api/biblio-learning-membership.d.ts +24 -0
- package/dist/api/biblio-learning-membership.js +69 -0
- package/dist/api/biblio-learning-membership.js.map +1 -0
- package/dist/api/biblio-learning.d.ts +222 -0
- package/dist/api/biblio-learning.js +697 -0
- package/dist/api/biblio-learning.js.map +1 -0
- package/dist/api/biblio-library.d.ts +1 -1
- package/dist/api/biblio-library.js.map +1 -1
- package/dist/api/biblio-nextory.d.ts +1 -1
- package/dist/api/biblio-nextory.js.map +1 -1
- package/dist/api/biblio-press.d.ts +1 -1
- package/dist/api/biblio-press.js.map +1 -1
- package/dist/api/biblio-search.d.ts +1 -1
- package/dist/api/biblio-search.js.map +1 -1
- package/dist/api/biblio-telemetry.d.ts +1 -1
- package/dist/api/biblio-telemetry.js.map +1 -1
- package/dist/api/consumption.d.ts +1 -1
- package/dist/api/consumption.js.map +1 -1
- package/dist/api/cvs-app.d.ts +1 -1
- package/dist/api/cvs-app.js.map +1 -1
- package/dist/api/cvs-documents.d.ts +1 -1
- package/dist/api/cvs-documents.js.map +1 -1
- package/dist/api/cvs-favorites.d.ts +1 -1
- package/dist/api/cvs-favorites.js.map +1 -1
- package/dist/api/cvs-ils.d.ts +1 -1
- package/dist/api/cvs-ils.js.map +1 -1
- package/dist/api/cvs-loans.d.ts +1 -1
- package/dist/api/cvs-loans.js.map +1 -1
- package/dist/api/cvs-payments.d.ts +1 -1
- package/dist/api/cvs-payments.js.map +1 -1
- package/dist/api/cvs-streaming.d.ts +1 -1
- package/dist/api/cvs-streaming.js.map +1 -1
- package/dist/api/index.d.ts +11 -1
- package/dist/api/index.js +11 -1
- package/dist/api/partner-catalogue.d.ts +1 -1
- package/dist/api/partner-catalogue.js.map +1 -1
- package/dist/api/partner-reader.d.ts +1 -1
- package/dist/api/partner-reader.js.map +1 -1
- package/dist/api/profiles.d.ts +1 -1
- package/dist/api/profiles.js.map +1 -1
- package/dist/api/search.d.ts +1 -1
- package/dist/api/search.js.map +1 -1
- package/dist/api/tutoring-catalogue.d.ts +1 -1
- package/dist/api/tutoring-catalogue.js.map +1 -1
- package/dist/api/tutoring-chat.d.ts +1 -1
- package/dist/api/tutoring-chat.js.map +1 -1
- package/dist/api/tutoring-dispatch.d.ts +1 -1
- package/dist/api/tutoring-dispatch.js.map +1 -1
- package/dist/api/tutoring-practitioner.d.ts +1 -1
- package/dist/api/tutoring-practitioner.js.map +1 -1
- package/dist/api/tutoring-requests.d.ts +1 -1
- package/dist/api/tutoring-requests.js.map +1 -1
- package/dist/chunks/client2.d.ts +1 -1
- package/dist/chunks/connection.d.ts +1 -1
- package/dist/chunks/index.d.ts +10038 -3487
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/models.d.ts +2 -2
- package/dist/models.js +329 -1
- package/dist/models.js.map +1 -1
- package/dist/react/account.d.ts +1 -1
- package/dist/react/account.js +1 -1
- package/dist/react/account.js.map +1 -1
- package/dist/react/admin-catalogue.d.ts +1 -1
- package/dist/react/admin-catalogue.js +1 -1
- package/dist/react/admin-catalogue.js.map +1 -1
- package/dist/react/admin-consumption.d.ts +1 -1
- package/dist/react/admin-consumption.js +1 -1
- package/dist/react/admin-consumption.js.map +1 -1
- package/dist/react/admin-contracts.d.ts +1 -1
- package/dist/react/admin-contracts.js +1 -1
- package/dist/react/admin-contracts.js.map +1 -1
- package/dist/react/admin-desk.d.ts +1 -1
- package/dist/react/admin-desk.js +1 -1
- package/dist/react/admin-desk.js.map +1 -1
- package/dist/react/admin-licenses.d.ts +1 -1
- package/dist/react/admin-licenses.js +1 -1
- package/dist/react/admin-licenses.js.map +1 -1
- package/dist/react/admin-partner-selections.d.ts +1 -1
- package/dist/react/admin-partner-selections.js +1 -1
- package/dist/react/admin-partner-selections.js.map +1 -1
- package/dist/react/admin-patrons.d.ts +1 -1
- package/dist/react/admin-patrons.js +1 -1
- package/dist/react/admin-patrons.js.map +1 -1
- package/dist/react/admin-reviews.d.ts +1 -1
- package/dist/react/admin-reviews.js +1 -1
- package/dist/react/admin-reviews.js.map +1 -1
- package/dist/react/admin-roles.d.ts +1 -1
- package/dist/react/admin-roles.js +1 -1
- package/dist/react/admin-roles.js.map +1 -1
- package/dist/react/admin-support.d.ts +1 -1
- package/dist/react/admin-support.js +1 -1
- package/dist/react/admin-support.js.map +1 -1
- package/dist/react/admin-tenants.d.ts +1 -1
- package/dist/react/admin-tenants.js +1 -1
- package/dist/react/admin-tenants.js.map +1 -1
- package/dist/react/admin-tutoring.d.ts +1 -1
- package/dist/react/admin-tutoring.js +1 -1
- package/dist/react/admin-tutoring.js.map +1 -1
- package/dist/react/auth.d.ts +1 -1
- package/dist/react/auth.js +1 -1
- package/dist/react/auth.js.map +1 -1
- package/dist/react/biblio-billing-webhooks.d.ts +56 -0
- package/dist/react/biblio-billing-webhooks.js +126 -0
- package/dist/react/biblio-billing-webhooks.js.map +1 -0
- package/dist/react/biblio-billing.d.ts +876 -0
- package/dist/react/biblio-billing.js +1491 -0
- package/dist/react/biblio-billing.js.map +1 -0
- package/dist/react/biblio-catalogue.d.ts +1 -1
- package/dist/react/biblio-catalogue.js +1 -1
- package/dist/react/biblio-catalogue.js.map +1 -1
- package/dist/react/biblio-home.d.ts +1 -1
- package/dist/react/biblio-home.js +1 -1
- package/dist/react/biblio-home.js.map +1 -1
- package/dist/react/biblio-learning-author-profiles.d.ts +513 -0
- package/dist/react/biblio-learning-author-profiles.js +795 -0
- package/dist/react/biblio-learning-author-profiles.js.map +1 -0
- package/dist/react/biblio-learning-authoring.d.ts +745 -0
- package/dist/react/biblio-learning-authoring.js +1335 -0
- package/dist/react/biblio-learning-authoring.js.map +1 -0
- package/dist/react/biblio-learning-editorial.d.ts +264 -0
- package/dist/react/biblio-learning-editorial.js +371 -0
- package/dist/react/biblio-learning-editorial.js.map +1 -0
- package/dist/react/biblio-learning-feedback.d.ts +280 -0
- package/dist/react/biblio-learning-feedback.js +433 -0
- package/dist/react/biblio-learning-feedback.js.map +1 -0
- package/dist/react/biblio-learning-finance.d.ts +868 -0
- package/dist/react/biblio-learning-finance.js +1439 -0
- package/dist/react/biblio-learning-finance.js.map +1 -0
- package/dist/react/biblio-learning-integrations.d.ts +237 -0
- package/dist/react/biblio-learning-integrations.js +483 -0
- package/dist/react/biblio-learning-integrations.js.map +1 -0
- package/dist/react/biblio-learning-membership.d.ts +99 -0
- package/dist/react/biblio-learning-membership.js +165 -0
- package/dist/react/biblio-learning-membership.js.map +1 -0
- package/dist/react/biblio-learning.d.ts +1047 -0
- package/dist/react/biblio-learning.js +1667 -0
- package/dist/react/biblio-learning.js.map +1 -0
- package/dist/react/biblio-library.d.ts +1 -1
- package/dist/react/biblio-library.js +1 -1
- package/dist/react/biblio-library.js.map +1 -1
- package/dist/react/biblio-nextory.d.ts +1 -1
- package/dist/react/biblio-nextory.js +1 -1
- package/dist/react/biblio-nextory.js.map +1 -1
- package/dist/react/biblio-press.d.ts +1 -1
- package/dist/react/biblio-press.js +1 -1
- package/dist/react/biblio-press.js.map +1 -1
- package/dist/react/biblio-search.d.ts +1 -1
- package/dist/react/biblio-search.js +1 -1
- package/dist/react/biblio-search.js.map +1 -1
- package/dist/react/biblio-telemetry.d.ts +1 -1
- package/dist/react/biblio-telemetry.js +1 -1
- package/dist/react/biblio-telemetry.js.map +1 -1
- package/dist/react/chat.d.ts +1 -1
- package/dist/react/consumption.d.ts +1 -1
- package/dist/react/consumption.js +1 -1
- package/dist/react/consumption.js.map +1 -1
- package/dist/react/cvs-app.d.ts +1 -1
- package/dist/react/cvs-app.js +1 -1
- package/dist/react/cvs-app.js.map +1 -1
- package/dist/react/cvs-documents.d.ts +1 -1
- package/dist/react/cvs-documents.js +1 -1
- package/dist/react/cvs-documents.js.map +1 -1
- package/dist/react/cvs-favorites.d.ts +1 -1
- package/dist/react/cvs-favorites.js +1 -1
- package/dist/react/cvs-favorites.js.map +1 -1
- package/dist/react/cvs-ils.d.ts +1 -1
- package/dist/react/cvs-ils.js +1 -1
- package/dist/react/cvs-ils.js.map +1 -1
- package/dist/react/cvs-loans.d.ts +1 -1
- package/dist/react/cvs-loans.js +1 -1
- package/dist/react/cvs-loans.js.map +1 -1
- package/dist/react/cvs-payments.d.ts +1 -1
- package/dist/react/cvs-payments.js +1 -1
- package/dist/react/cvs-payments.js.map +1 -1
- package/dist/react/cvs-streaming.d.ts +1 -1
- package/dist/react/cvs-streaming.js +1 -1
- package/dist/react/cvs-streaming.js.map +1 -1
- package/dist/react/index.d.ts +11 -1
- package/dist/react/index.js +11 -1
- package/dist/react/partner-catalogue.d.ts +1 -1
- package/dist/react/partner-catalogue.js +1 -1
- package/dist/react/partner-catalogue.js.map +1 -1
- package/dist/react/partner-reader.d.ts +1 -1
- package/dist/react/partner-reader.js +1 -1
- package/dist/react/partner-reader.js.map +1 -1
- package/dist/react/profiles.d.ts +1 -1
- package/dist/react/profiles.js +1 -1
- package/dist/react/profiles.js.map +1 -1
- package/dist/react/search.d.ts +1 -1
- package/dist/react/search.js +1 -1
- package/dist/react/search.js.map +1 -1
- package/dist/react/tutoring-catalogue.d.ts +1 -1
- package/dist/react/tutoring-catalogue.js +1 -1
- package/dist/react/tutoring-catalogue.js.map +1 -1
- package/dist/react/tutoring-chat.d.ts +1 -1
- package/dist/react/tutoring-chat.js +1 -1
- package/dist/react/tutoring-chat.js.map +1 -1
- package/dist/react/tutoring-dispatch.d.ts +1 -1
- package/dist/react/tutoring-dispatch.js +1 -1
- package/dist/react/tutoring-dispatch.js.map +1 -1
- package/dist/react/tutoring-practitioner.d.ts +1 -1
- package/dist/react/tutoring-practitioner.js +1 -1
- package/dist/react/tutoring-practitioner.js.map +1 -1
- package/dist/react/tutoring-requests.d.ts +1 -1
- package/dist/react/tutoring-requests.js +1 -1
- package/dist/react/tutoring-requests.js.map +1 -1
- package/package.json +7 -7
|
@@ -0,0 +1,586 @@
|
|
|
1
|
+
|
|
2
|
+
import { r as request } from "../chunks/client.js";
|
|
3
|
+
//#region src/api/biblio-learning-authoring/biblio-learning-authoring.ts
|
|
4
|
+
const getLearningListAuthorCataloguesUrl = () => {
|
|
5
|
+
return `/learning/author/catalogues`;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* Requires the effective independent author profile and the relevant catalogue, ownership or global authority. Support impersonation is rejected. Lists active catalogues with creation, review or finance authority. Review permission also enables creation; finance permission alone does not. The collection is ordered by catalogue ID and is not paginated.
|
|
9
|
+
* @summary List my authoring catalogues
|
|
10
|
+
*/
|
|
11
|
+
const learningListAuthorCatalogues = async (options) => {
|
|
12
|
+
return request(getLearningListAuthorCataloguesUrl(), {
|
|
13
|
+
...options,
|
|
14
|
+
method: "GET"
|
|
15
|
+
});
|
|
16
|
+
};
|
|
17
|
+
const getLearningCreateAuthorCatalogueUrl = () => {
|
|
18
|
+
return `/learning/author/catalogues`;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Requires global catalogue write authority and rejects support impersonation. Creates an active authoring catalogue; the returned capability flags describe the operator making this request.
|
|
22
|
+
* @summary Create a learning catalogue
|
|
23
|
+
*/
|
|
24
|
+
const learningCreateAuthorCatalogue = async (learningCatalogueWrite, options) => {
|
|
25
|
+
const getHeaders = (h) => {
|
|
26
|
+
if (!h) return {};
|
|
27
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
28
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
29
|
+
const headers = {};
|
|
30
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
31
|
+
return headers;
|
|
32
|
+
};
|
|
33
|
+
return request(getLearningCreateAuthorCatalogueUrl(), {
|
|
34
|
+
...options,
|
|
35
|
+
method: "POST",
|
|
36
|
+
headers: {
|
|
37
|
+
"Content-Type": "application/json",
|
|
38
|
+
...getHeaders(options?.headers)
|
|
39
|
+
},
|
|
40
|
+
body: JSON.stringify(learningCatalogueWrite)
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
const getLearningSetCatalogueAuthorityUrl = (catalogueId) => {
|
|
44
|
+
return `/learning/author/catalogues/${catalogueId}/authority`;
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* Requires global catalogue write authority. Replaces all three grants for the selected active independent account, including revocation when all flags are false. The reason is recorded for audit. Successful updates return 204 with no response body.
|
|
48
|
+
* @summary Replace an author's catalogue permissions
|
|
49
|
+
*/
|
|
50
|
+
const learningSetCatalogueAuthority = async (catalogueId, learningCatalogueGrantWrite, options) => {
|
|
51
|
+
const getHeaders = (h) => {
|
|
52
|
+
if (!h) return {};
|
|
53
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
54
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
55
|
+
const headers = {};
|
|
56
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
57
|
+
return headers;
|
|
58
|
+
};
|
|
59
|
+
return request(getLearningSetCatalogueAuthorityUrl(catalogueId), {
|
|
60
|
+
...options,
|
|
61
|
+
method: "PUT",
|
|
62
|
+
headers: {
|
|
63
|
+
"Content-Type": "application/json",
|
|
64
|
+
...getHeaders(options?.headers)
|
|
65
|
+
},
|
|
66
|
+
body: JSON.stringify(learningCatalogueGrantWrite)
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
const getLearningListAuthorCoursesUrl = (params) => {
|
|
70
|
+
const normalizedParams = new URLSearchParams();
|
|
71
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
72
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
73
|
+
});
|
|
74
|
+
const stringifiedParams = normalizedParams.toString();
|
|
75
|
+
return stringifiedParams.length > 0 ? `/learning/author/courses?${stringifiedParams}` : `/learning/author/courses`;
|
|
76
|
+
};
|
|
77
|
+
/**
|
|
78
|
+
* Returns courses assigned to the effective author and courses in active catalogues they may review. Global administrators and support readers can see all courses. Dependent profiles and support impersonation are refused. Pagination counts this authorized scope and sorts by course ID ascending; draft courses are included.
|
|
79
|
+
* @summary List courses available to the author
|
|
80
|
+
*/
|
|
81
|
+
const learningListAuthorCourses = async (params, options) => {
|
|
82
|
+
return request(getLearningListAuthorCoursesUrl(params), {
|
|
83
|
+
...options,
|
|
84
|
+
method: "GET"
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
const getLearningCreateCourseUrl = () => {
|
|
88
|
+
return `/learning/author/courses`;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Create an inactive course from a title in an authorized catalogue, then register media and create an edition. Binding an existing catalogue contentId, or creating without catalogueId, requires global administration. Assigning other authors requires curator authority. Publication activates a new course; this request alone does not make it readable.
|
|
92
|
+
* @summary Create a native course shell
|
|
93
|
+
*/
|
|
94
|
+
const learningCreateCourse = async (learningCourseCreateWrite, options) => {
|
|
95
|
+
const getHeaders = (h) => {
|
|
96
|
+
if (!h) return {};
|
|
97
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
98
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
99
|
+
const headers = {};
|
|
100
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
101
|
+
return headers;
|
|
102
|
+
};
|
|
103
|
+
return request(getLearningCreateCourseUrl(), {
|
|
104
|
+
...options,
|
|
105
|
+
method: "POST",
|
|
106
|
+
headers: {
|
|
107
|
+
"Content-Type": "application/json",
|
|
108
|
+
...getHeaders(options?.headers)
|
|
109
|
+
},
|
|
110
|
+
body: JSON.stringify(learningCourseCreateWrite)
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
const getLearningUpdateCourseSettingsUrl = (courseId) => {
|
|
114
|
+
return `/learning/author/courses/${courseId}`;
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* Requires course curator or global administrator authority and an audit reason. Non-null scalar fields replace their current values; null or omitted values leave them unchanged. authorIds replaces the complete author set, including clearing it with an empty list. A course must have a published edition before isActive can be true.
|
|
118
|
+
* @summary Update publication and author settings
|
|
119
|
+
*/
|
|
120
|
+
const learningUpdateCourseSettings = async (courseId, learningCourseSettingsWrite, options) => {
|
|
121
|
+
const getHeaders = (h) => {
|
|
122
|
+
if (!h) return {};
|
|
123
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
124
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
125
|
+
const headers = {};
|
|
126
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
127
|
+
return headers;
|
|
128
|
+
};
|
|
129
|
+
return request(getLearningUpdateCourseSettingsUrl(courseId), {
|
|
130
|
+
...options,
|
|
131
|
+
method: "PATCH",
|
|
132
|
+
headers: {
|
|
133
|
+
"Content-Type": "application/json",
|
|
134
|
+
...getHeaders(options?.headers)
|
|
135
|
+
},
|
|
136
|
+
body: JSON.stringify(learningCourseSettingsWrite)
|
|
137
|
+
});
|
|
138
|
+
};
|
|
139
|
+
const getLearningRegisterAssetUrl = (courseId) => {
|
|
140
|
+
return `/learning/author/courses/${courseId}/assets`;
|
|
141
|
+
};
|
|
142
|
+
/**
|
|
143
|
+
* Requires edit authority on the course. Registers an immutable media reference for use in edition definitions. Vimeo requires a numeric video ID; external resources require HTTPS without credentials; HTML is sanitized; storage keys must identify an existing object under this author's learning prefix. The response identifies the asset and does not issue a playback URL. For new file bytes use the upload reservation workflow.
|
|
144
|
+
* @summary Register a course media resource
|
|
145
|
+
*/
|
|
146
|
+
const learningRegisterAsset = async (courseId, learningAssetWrite, options) => {
|
|
147
|
+
const getHeaders = (h) => {
|
|
148
|
+
if (!h) return {};
|
|
149
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
150
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
151
|
+
const headers = {};
|
|
152
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
153
|
+
return headers;
|
|
154
|
+
};
|
|
155
|
+
return request(getLearningRegisterAssetUrl(courseId), {
|
|
156
|
+
...options,
|
|
157
|
+
method: "POST",
|
|
158
|
+
headers: {
|
|
159
|
+
"Content-Type": "application/json",
|
|
160
|
+
...getHeaders(options?.headers)
|
|
161
|
+
},
|
|
162
|
+
body: JSON.stringify(learningAssetWrite)
|
|
163
|
+
});
|
|
164
|
+
};
|
|
165
|
+
const getLearningAttachCaptionsUrl = (courseId, assetId) => {
|
|
166
|
+
return `/learning/author/courses/${courseId}/assets/${assetId}/captions`;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Requires course edit authority. First upload validated UTF-8 WebVTT to the same course, then reference its asset ID here. Returns a new immutable media variant; existing editions keep their original asset. Repeating the original asset, caption asset and language returns the existing variant. Put the returned assetId into a draft edition to publish the captions.
|
|
170
|
+
* @summary Create a captioned variant of course audio or video
|
|
171
|
+
*/
|
|
172
|
+
const learningAttachCaptions = async (courseId, assetId, learningCaptionWrite, options) => {
|
|
173
|
+
const getHeaders = (h) => {
|
|
174
|
+
if (!h) return {};
|
|
175
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
176
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
177
|
+
const headers = {};
|
|
178
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
179
|
+
return headers;
|
|
180
|
+
};
|
|
181
|
+
return request(getLearningAttachCaptionsUrl(courseId, assetId), {
|
|
182
|
+
...options,
|
|
183
|
+
method: "POST",
|
|
184
|
+
headers: {
|
|
185
|
+
"Content-Type": "application/json",
|
|
186
|
+
...getHeaders(options?.headers)
|
|
187
|
+
},
|
|
188
|
+
body: JSON.stringify(learningCaptionWrite)
|
|
189
|
+
});
|
|
190
|
+
};
|
|
191
|
+
const getLearningListRevisionsUrl = (courseId, params) => {
|
|
192
|
+
const normalizedParams = new URLSearchParams();
|
|
193
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
194
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
195
|
+
});
|
|
196
|
+
const stringifiedParams = normalizedParams.toString();
|
|
197
|
+
return stringifiedParams.length > 0 ? `/learning/author/courses/${courseId}/revisions?${stringifiedParams}` : `/learning/author/courses/${courseId}/revisions`;
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Requires read authority on this course. Returns draft, submitted, published, rejected and superseded editions, newest version first. version identifies the course edition; editVersion is the optimistic concurrency counter within a working edition.
|
|
201
|
+
* @summary List the course's edition history
|
|
202
|
+
*/
|
|
203
|
+
const learningListRevisions = async (courseId, params, options) => {
|
|
204
|
+
return request(getLearningListRevisionsUrl(courseId, params), {
|
|
205
|
+
...options,
|
|
206
|
+
method: "GET"
|
|
207
|
+
});
|
|
208
|
+
};
|
|
209
|
+
const getLearningCreateRevisionUrl = (courseId) => {
|
|
210
|
+
return `/learning/author/courses/${courseId}/revisions`;
|
|
211
|
+
};
|
|
212
|
+
/**
|
|
213
|
+
* Requires course edit authority. Creates a complete edition with the next version number; only one draft or submitted edition may exist for a course. Asset and library references must be available to this course. Chapters contain 1–2000 lessons with unique keys across the edition; the serialized authoring definition is limited to 2,000,000 bytes. Published editions and existing enrollments remain pinned to their definitions.
|
|
214
|
+
* @summary Create the next draft edition
|
|
215
|
+
*/
|
|
216
|
+
const learningCreateRevision = async (courseId, courseRevisionWriteInput, options) => {
|
|
217
|
+
const getHeaders = (h) => {
|
|
218
|
+
if (!h) return {};
|
|
219
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
220
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
221
|
+
const headers = {};
|
|
222
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
223
|
+
return headers;
|
|
224
|
+
};
|
|
225
|
+
return request(getLearningCreateRevisionUrl(courseId), {
|
|
226
|
+
...options,
|
|
227
|
+
method: "POST",
|
|
228
|
+
headers: {
|
|
229
|
+
"Content-Type": "application/json",
|
|
230
|
+
...getHeaders(options?.headers)
|
|
231
|
+
},
|
|
232
|
+
body: JSON.stringify(courseRevisionWriteInput)
|
|
233
|
+
});
|
|
234
|
+
};
|
|
235
|
+
const getLearningReadAuthorRevisionUrl = (courseId, revisionId) => {
|
|
236
|
+
return `/learning/author/courses/${courseId}/revisions/${revisionId}`;
|
|
237
|
+
};
|
|
238
|
+
/**
|
|
239
|
+
* Requires authoring read authority and checks that revisionId belongs to courseId. Returns editorial content, lessons, resources, vocabularies and private assessment solutions. Read revision.editVersion before replacing a changed definition. This author-only representation includes grading keys that are deliberately absent from reader questions.
|
|
240
|
+
* @summary Read a complete editable edition definition
|
|
241
|
+
*/
|
|
242
|
+
const learningReadAuthorRevision = async (courseId, revisionId, options) => {
|
|
243
|
+
return request(getLearningReadAuthorRevisionUrl(courseId, revisionId), {
|
|
244
|
+
...options,
|
|
245
|
+
method: "GET"
|
|
246
|
+
});
|
|
247
|
+
};
|
|
248
|
+
const getLearningReplaceRevisionUrl = (courseId, revisionId) => {
|
|
249
|
+
return `/learning/author/courses/${courseId}/revisions/${revisionId}`;
|
|
250
|
+
};
|
|
251
|
+
/**
|
|
252
|
+
* Replaces the entire editorial and lesson graph of a draft or rejected edition. Send the editVersion last read as expectedEditVersion. An identical definition is an idempotent replay; a changed definition requires a matching version and increments editVersion. A changed rejected edition returns to draft and clears its review note and submission date. Published and submitted editions cannot be edited.
|
|
253
|
+
* @summary Replace a draft edition with concurrency protection
|
|
254
|
+
*/
|
|
255
|
+
const learningReplaceRevision = async (courseId, revisionId, courseRevisionWriteInput, options) => {
|
|
256
|
+
const getHeaders = (h) => {
|
|
257
|
+
if (!h) return {};
|
|
258
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
259
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
260
|
+
const headers = {};
|
|
261
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
262
|
+
return headers;
|
|
263
|
+
};
|
|
264
|
+
return request(getLearningReplaceRevisionUrl(courseId, revisionId), {
|
|
265
|
+
...options,
|
|
266
|
+
method: "PUT",
|
|
267
|
+
headers: {
|
|
268
|
+
"Content-Type": "application/json",
|
|
269
|
+
...getHeaders(options?.headers)
|
|
270
|
+
},
|
|
271
|
+
body: JSON.stringify(courseRevisionWriteInput)
|
|
272
|
+
});
|
|
273
|
+
};
|
|
274
|
+
const getLearningReviewRevisionUrl = (courseId, revisionId) => {
|
|
275
|
+
return `/learning/author/courses/${courseId}/revisions/${revisionId}/review`;
|
|
276
|
+
};
|
|
277
|
+
/**
|
|
278
|
+
* Requires course curator or global administrator authority. Approval revalidates materials, publishes this edition, supersedes its published predecessor, updates catalogue editorial fields and activates the course. Existing readers retain their selected edition until they explicitly upgrade. Rejection returns the edition for editing. Every decision requires a review note; repeated decisions return 409 once the edition leaves submitted.
|
|
279
|
+
* @summary Publish or reject a submitted edition
|
|
280
|
+
*/
|
|
281
|
+
const learningReviewRevision = async (courseId, revisionId, courseReviewWrite, options) => {
|
|
282
|
+
const getHeaders = (h) => {
|
|
283
|
+
if (!h) return {};
|
|
284
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
285
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
286
|
+
const headers = {};
|
|
287
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
288
|
+
return headers;
|
|
289
|
+
};
|
|
290
|
+
return request(getLearningReviewRevisionUrl(courseId, revisionId), {
|
|
291
|
+
...options,
|
|
292
|
+
method: "POST",
|
|
293
|
+
headers: {
|
|
294
|
+
"Content-Type": "application/json",
|
|
295
|
+
...getHeaders(options?.headers)
|
|
296
|
+
},
|
|
297
|
+
body: JSON.stringify(courseReviewWrite)
|
|
298
|
+
});
|
|
299
|
+
};
|
|
300
|
+
const getLearningSubmitRevisionUrl = (courseId, revisionId) => {
|
|
301
|
+
return `/learning/author/courses/${courseId}/revisions/${revisionId}/submit`;
|
|
302
|
+
};
|
|
303
|
+
/**
|
|
304
|
+
* Requires course edit authority. Moves draft to submitted and records submittedAt; reviewers can then approve or reject it. Submission locks the definition against editing. This transition is not replay-idempotent: submitting an already submitted edition returns 409.
|
|
305
|
+
* @summary Submit a draft edition for review
|
|
306
|
+
*/
|
|
307
|
+
const learningSubmitRevision = async (courseId, revisionId, options) => {
|
|
308
|
+
return request(getLearningSubmitRevisionUrl(courseId, revisionId), {
|
|
309
|
+
...options,
|
|
310
|
+
method: "POST"
|
|
311
|
+
});
|
|
312
|
+
};
|
|
313
|
+
const getLearningListLibrariesUrl = (params) => {
|
|
314
|
+
const normalizedParams = new URLSearchParams();
|
|
315
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
316
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
317
|
+
});
|
|
318
|
+
const stringifiedParams = normalizedParams.toString();
|
|
319
|
+
return stringifiedParams.length > 0 ? `/learning/author/libraries?${stringifiedParams}` : `/learning/author/libraries`;
|
|
320
|
+
};
|
|
321
|
+
/**
|
|
322
|
+
* Requires the effective independent author profile and the relevant catalogue, ownership or global authority. Support impersonation is rejected. Results are filtered to the caller's scope before pagination; page is one-based and limit is bounded by the shared pagination contract. Lists owned or shared libraries for creators, all libraries in reviewable active catalogues for reviewers, and all libraries for global operators. Ordered by library ID. publishedVersion=0 means no native published version is selected.
|
|
323
|
+
* @summary List reusable teaching libraries
|
|
324
|
+
*/
|
|
325
|
+
const learningListLibraries = async (params, options) => {
|
|
326
|
+
return request(getLearningListLibrariesUrl(params), {
|
|
327
|
+
...options,
|
|
328
|
+
method: "GET"
|
|
329
|
+
});
|
|
330
|
+
};
|
|
331
|
+
const getLearningCreateLibraryUrl = () => {
|
|
332
|
+
return `/learning/author/libraries`;
|
|
333
|
+
};
|
|
334
|
+
/**
|
|
335
|
+
* Requires the effective independent author profile and the relevant catalogue, ownership or global authority. Support impersonation is rejected. Creates an empty assessment or vocabulary container owned by the caller. A null catalogueId requires global authority. shared allows catalogue peers to reuse published material; it does not grant them editing rights. Create a version separately.
|
|
336
|
+
* @summary Create a reusable teaching library
|
|
337
|
+
*/
|
|
338
|
+
const learningCreateLibrary = async (learningLibraryWrite, options) => {
|
|
339
|
+
const getHeaders = (h) => {
|
|
340
|
+
if (!h) return {};
|
|
341
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
342
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
343
|
+
const headers = {};
|
|
344
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
345
|
+
return headers;
|
|
346
|
+
};
|
|
347
|
+
return request(getLearningCreateLibraryUrl(), {
|
|
348
|
+
...options,
|
|
349
|
+
method: "POST",
|
|
350
|
+
headers: {
|
|
351
|
+
"Content-Type": "application/json",
|
|
352
|
+
...getHeaders(options?.headers)
|
|
353
|
+
},
|
|
354
|
+
body: JSON.stringify(learningLibraryWrite)
|
|
355
|
+
});
|
|
356
|
+
};
|
|
357
|
+
const getLearningListLibraryVersionsUrl = (libraryId, params) => {
|
|
358
|
+
const normalizedParams = new URLSearchParams();
|
|
359
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
360
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
361
|
+
});
|
|
362
|
+
const stringifiedParams = normalizedParams.toString();
|
|
363
|
+
return stringifiedParams.length > 0 ? `/learning/author/libraries/${libraryId}/versions?${stringifiedParams}` : `/learning/author/libraries/${libraryId}/versions`;
|
|
364
|
+
};
|
|
365
|
+
/**
|
|
366
|
+
* Requires the effective independent author profile and the relevant catalogue, ownership or global authority. Support impersonation is rejected. Results are filtered to the caller's scope before pagination; page is one-based and limit is bounded by the shared pagination contract. Ordered by version descending. Owners, reviewers and global operators can read drafts; other eligible users see published and superseded versions only. sealed is authoritative for editing: imported or referenced material can be sealed even with a draft status.
|
|
367
|
+
* @summary List versions of a teaching library
|
|
368
|
+
*/
|
|
369
|
+
const learningListLibraryVersions = async (libraryId, params, options) => {
|
|
370
|
+
return request(getLearningListLibraryVersionsUrl(libraryId, params), {
|
|
371
|
+
...options,
|
|
372
|
+
method: "GET"
|
|
373
|
+
});
|
|
374
|
+
};
|
|
375
|
+
const getLearningCreateLibraryVersionUrl = (libraryId) => {
|
|
376
|
+
return `/learning/author/libraries/${libraryId}/versions`;
|
|
377
|
+
};
|
|
378
|
+
/**
|
|
379
|
+
* Requires the effective independent author profile and the relevant catalogue, ownership or global authority. Support impersonation is rejected. Requires library ownership, catalogue review authority or global authority for writes; sharing only permits reuse and reading published versions. Creates the next numbered draft without changing any previous definition. Supply exactly one assessment or vocabulary matching the library kind. There must be no submitted version or unsealed working draft. Sealed source drafts do not block a successor. Referenced questions must be published and accessible; sourceLessonKeys are not accepted for libraries.
|
|
380
|
+
* @summary Create a successor library version
|
|
381
|
+
*/
|
|
382
|
+
const learningCreateLibraryVersion = async (libraryId, learningLibraryVersionWrite, options) => {
|
|
383
|
+
const getHeaders = (h) => {
|
|
384
|
+
if (!h) return {};
|
|
385
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
386
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
387
|
+
const headers = {};
|
|
388
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
389
|
+
return headers;
|
|
390
|
+
};
|
|
391
|
+
return request(getLearningCreateLibraryVersionUrl(libraryId), {
|
|
392
|
+
...options,
|
|
393
|
+
method: "POST",
|
|
394
|
+
headers: {
|
|
395
|
+
"Content-Type": "application/json",
|
|
396
|
+
...getHeaders(options?.headers)
|
|
397
|
+
},
|
|
398
|
+
body: JSON.stringify(learningLibraryVersionWrite)
|
|
399
|
+
});
|
|
400
|
+
};
|
|
401
|
+
const getLearningReadLibraryVersionUrl = (libraryId, version) => {
|
|
402
|
+
return `/learning/author/libraries/${libraryId}/versions/${version}`;
|
|
403
|
+
};
|
|
404
|
+
/**
|
|
405
|
+
* Requires the effective independent author profile and the relevant catalogue, ownership or global authority. Support impersonation is rejected. Returns the full authoring definition and stable question references. version is the library's sequential version number, not materialId. Draft visibility is restricted to owner/reviewer/global operator. Answer keys are part of this private authoring contract. A sealed source snapshot must be copied into a successor to change it.
|
|
406
|
+
* @summary Read a teaching library version
|
|
407
|
+
*/
|
|
408
|
+
const learningReadLibraryVersion = async (libraryId, version, options) => {
|
|
409
|
+
return request(getLearningReadLibraryVersionUrl(libraryId, version), {
|
|
410
|
+
...options,
|
|
411
|
+
method: "GET"
|
|
412
|
+
});
|
|
413
|
+
};
|
|
414
|
+
const getLearningReplaceLibraryVersionUrl = (libraryId, version) => {
|
|
415
|
+
return `/learning/author/libraries/${libraryId}/versions/${version}`;
|
|
416
|
+
};
|
|
417
|
+
/**
|
|
418
|
+
* Requires the effective independent author profile and the relevant catalogue, ownership or global authority. Support impersonation is rejected. Requires library ownership, catalogue review authority or global authority for writes; sharing only permits reuse and reading published versions. Replaces an unsealed draft or rejected version. Supply the current expectedEditVersion when changing the definition; a semantic no-op returns the same version. Submitted, published, superseded, imported and referenced definitions are immutable. Create a successor for sealed material instead. Exactly one matching assessment or vocabulary is required.
|
|
419
|
+
* @summary Replace an editable library definition
|
|
420
|
+
*/
|
|
421
|
+
const learningReplaceLibraryVersion = async (libraryId, version, learningLibraryVersionWrite, options) => {
|
|
422
|
+
const getHeaders = (h) => {
|
|
423
|
+
if (!h) return {};
|
|
424
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
425
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
426
|
+
const headers = {};
|
|
427
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
428
|
+
return headers;
|
|
429
|
+
};
|
|
430
|
+
return request(getLearningReplaceLibraryVersionUrl(libraryId, version), {
|
|
431
|
+
...options,
|
|
432
|
+
method: "PUT",
|
|
433
|
+
headers: {
|
|
434
|
+
"Content-Type": "application/json",
|
|
435
|
+
...getHeaders(options?.headers)
|
|
436
|
+
},
|
|
437
|
+
body: JSON.stringify(learningLibraryVersionWrite)
|
|
438
|
+
});
|
|
439
|
+
};
|
|
440
|
+
const getLearningReviewLibraryVersionUrl = (libraryId, version) => {
|
|
441
|
+
return `/learning/author/libraries/${libraryId}/versions/${version}/review`;
|
|
442
|
+
};
|
|
443
|
+
/**
|
|
444
|
+
* Requires the effective independent author profile and the relevant catalogue, ownership or global authority. Support impersonation is rejected. Requires catalogue review or global authority. Approval revalidates resources, publishes this version and supersedes the previously published version. Rejection records the decision and makes an unpinned definition editable again. The supplied note is audited; it is not a field of the returned version summary.
|
|
445
|
+
* @summary Approve or reject a submitted library version
|
|
446
|
+
*/
|
|
447
|
+
const learningReviewLibraryVersion = async (libraryId, version, courseReviewWrite, options) => {
|
|
448
|
+
const getHeaders = (h) => {
|
|
449
|
+
if (!h) return {};
|
|
450
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
451
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
452
|
+
const headers = {};
|
|
453
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
454
|
+
return headers;
|
|
455
|
+
};
|
|
456
|
+
return request(getLearningReviewLibraryVersionUrl(libraryId, version), {
|
|
457
|
+
...options,
|
|
458
|
+
method: "POST",
|
|
459
|
+
headers: {
|
|
460
|
+
"Content-Type": "application/json",
|
|
461
|
+
...getHeaders(options?.headers)
|
|
462
|
+
},
|
|
463
|
+
body: JSON.stringify(courseReviewWrite)
|
|
464
|
+
});
|
|
465
|
+
};
|
|
466
|
+
const getLearningSubmitLibraryVersionUrl = (libraryId, version) => {
|
|
467
|
+
return `/learning/author/libraries/${libraryId}/versions/${version}/submit`;
|
|
468
|
+
};
|
|
469
|
+
/**
|
|
470
|
+
* Requires the effective independent author profile and the relevant catalogue, ownership or global authority. Support impersonation is rejected. Requires library ownership, catalogue review authority or global authority for writes; sharing only permits reuse and reading published versions. Only an unsealed draft can be submitted. Submission locks its definition pending review; it does not publish the material. Source snapshots and referenced drafts require a successor before submission.
|
|
471
|
+
* @summary Submit a library draft for review
|
|
472
|
+
*/
|
|
473
|
+
const learningSubmitLibraryVersion = async (libraryId, version, options) => {
|
|
474
|
+
return request(getLearningSubmitLibraryVersionUrl(libraryId, version), {
|
|
475
|
+
...options,
|
|
476
|
+
method: "POST"
|
|
477
|
+
});
|
|
478
|
+
};
|
|
479
|
+
const getLearningCreatePathUrl = () => {
|
|
480
|
+
return `/learning/author/paths`;
|
|
481
|
+
};
|
|
482
|
+
/**
|
|
483
|
+
* Requires review authority for the chosen catalogue, or global authority for a null catalogueId. Creates a path with ordered, unique content IDs; these are catalogue content identities, not revision IDs. Creators without review permission cannot curate paths. Active publication requires active content and eligible catalogue resources.
|
|
484
|
+
* @summary Create a curated learning path
|
|
485
|
+
*/
|
|
486
|
+
const learningCreatePath = async (learningPathWrite, options) => {
|
|
487
|
+
const getHeaders = (h) => {
|
|
488
|
+
if (!h) return {};
|
|
489
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
490
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
491
|
+
const headers = {};
|
|
492
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
493
|
+
return headers;
|
|
494
|
+
};
|
|
495
|
+
return request(getLearningCreatePathUrl(), {
|
|
496
|
+
...options,
|
|
497
|
+
method: "POST",
|
|
498
|
+
headers: {
|
|
499
|
+
"Content-Type": "application/json",
|
|
500
|
+
...getHeaders(options?.headers)
|
|
501
|
+
},
|
|
502
|
+
body: JSON.stringify(learningPathWrite)
|
|
503
|
+
});
|
|
504
|
+
};
|
|
505
|
+
const getLearningReadAuthorPathUrl = (pathId) => {
|
|
506
|
+
return `/learning/author/paths/${pathId}`;
|
|
507
|
+
};
|
|
508
|
+
/**
|
|
509
|
+
* Requires review authority for the path's original catalogue or global authority. Returns the complete ordered definition and its current editVersion; use that counter in the next replacement request.
|
|
510
|
+
* @summary Read a path's authoring definition
|
|
511
|
+
*/
|
|
512
|
+
const learningReadAuthorPath = async (pathId, options) => {
|
|
513
|
+
return request(getLearningReadAuthorPathUrl(pathId), {
|
|
514
|
+
...options,
|
|
515
|
+
method: "GET"
|
|
516
|
+
});
|
|
517
|
+
};
|
|
518
|
+
const getLearningUpdatePathUrl = (pathId) => {
|
|
519
|
+
return `/learning/author/paths/${pathId}`;
|
|
520
|
+
};
|
|
521
|
+
/**
|
|
522
|
+
* Requires review authority for the original catalogue or global authority. Replaces the entire definition and step ordering, increments editVersion, and requires expectedEditVersion to match. The catalogue cannot change. Setting isActive=true requires all referenced content to be active; step visibility for readers still follows their existing access grants.
|
|
523
|
+
* @summary Replace and optionally publish a learning path
|
|
524
|
+
*/
|
|
525
|
+
const learningUpdatePath = async (pathId, learningPathWrite, options) => {
|
|
526
|
+
const getHeaders = (h) => {
|
|
527
|
+
if (!h) return {};
|
|
528
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
529
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
530
|
+
const headers = {};
|
|
531
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
532
|
+
return headers;
|
|
533
|
+
};
|
|
534
|
+
return request(getLearningUpdatePathUrl(pathId), {
|
|
535
|
+
...options,
|
|
536
|
+
method: "PUT",
|
|
537
|
+
headers: {
|
|
538
|
+
"Content-Type": "application/json",
|
|
539
|
+
...getHeaders(options?.headers)
|
|
540
|
+
},
|
|
541
|
+
body: JSON.stringify(learningPathWrite)
|
|
542
|
+
});
|
|
543
|
+
};
|
|
544
|
+
const getLearningCreatePathAssessmentUrl = (pathId) => {
|
|
545
|
+
return `/learning/author/paths/${pathId}/assessments`;
|
|
546
|
+
};
|
|
547
|
+
/**
|
|
548
|
+
* Requires path catalogue review authority or global authority. Creates a new assessment with kind=final and explicit questions or published questionRefs; sourceLessonKeys are not accepted. References must come from courses in this path. Existing assessments are immutable; withdraw one and create another when replacing it.
|
|
549
|
+
* @summary Add a final assessment to a learning path
|
|
550
|
+
*/
|
|
551
|
+
const learningCreatePathAssessment = async (pathId, learningAssessmentWriteInput, options) => {
|
|
552
|
+
const getHeaders = (h) => {
|
|
553
|
+
if (!h) return {};
|
|
554
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
555
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
556
|
+
const headers = {};
|
|
557
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
558
|
+
return headers;
|
|
559
|
+
};
|
|
560
|
+
return request(getLearningCreatePathAssessmentUrl(pathId), {
|
|
561
|
+
...options,
|
|
562
|
+
method: "POST",
|
|
563
|
+
headers: {
|
|
564
|
+
"Content-Type": "application/json",
|
|
565
|
+
...getHeaders(options?.headers)
|
|
566
|
+
},
|
|
567
|
+
body: JSON.stringify(learningAssessmentWriteInput)
|
|
568
|
+
});
|
|
569
|
+
};
|
|
570
|
+
const getLearningWithdrawPathAssessmentUrl = (pathId, assessmentId) => {
|
|
571
|
+
return `/learning/author/paths/${pathId}/assessments/${assessmentId}`;
|
|
572
|
+
};
|
|
573
|
+
/**
|
|
574
|
+
* Requires path catalogue review authority or global authority. Marks the selected assessment inactive while retaining its identity and recorded evidence. assessmentId must belong to pathId. Repeating withdrawal leaves it inactive. Success returns 204 with no response body.
|
|
575
|
+
* @summary Withdraw a path assessment
|
|
576
|
+
*/
|
|
577
|
+
const learningWithdrawPathAssessment = async (pathId, assessmentId, options) => {
|
|
578
|
+
return request(getLearningWithdrawPathAssessmentUrl(pathId, assessmentId), {
|
|
579
|
+
...options,
|
|
580
|
+
method: "DELETE"
|
|
581
|
+
});
|
|
582
|
+
};
|
|
583
|
+
//#endregion
|
|
584
|
+
export { getLearningAttachCaptionsUrl, getLearningCreateAuthorCatalogueUrl, getLearningCreateCourseUrl, getLearningCreateLibraryUrl, getLearningCreateLibraryVersionUrl, getLearningCreatePathAssessmentUrl, getLearningCreatePathUrl, getLearningCreateRevisionUrl, getLearningListAuthorCataloguesUrl, getLearningListAuthorCoursesUrl, getLearningListLibrariesUrl, getLearningListLibraryVersionsUrl, getLearningListRevisionsUrl, getLearningReadAuthorPathUrl, getLearningReadAuthorRevisionUrl, getLearningReadLibraryVersionUrl, getLearningRegisterAssetUrl, getLearningReplaceLibraryVersionUrl, getLearningReplaceRevisionUrl, getLearningReviewLibraryVersionUrl, getLearningReviewRevisionUrl, getLearningSetCatalogueAuthorityUrl, getLearningSubmitLibraryVersionUrl, getLearningSubmitRevisionUrl, getLearningUpdateCourseSettingsUrl, getLearningUpdatePathUrl, getLearningWithdrawPathAssessmentUrl, learningAttachCaptions, learningCreateAuthorCatalogue, learningCreateCourse, learningCreateLibrary, learningCreateLibraryVersion, learningCreatePath, learningCreatePathAssessment, learningCreateRevision, learningListAuthorCatalogues, learningListAuthorCourses, learningListLibraries, learningListLibraryVersions, learningListRevisions, learningReadAuthorPath, learningReadAuthorRevision, learningReadLibraryVersion, learningRegisterAsset, learningReplaceLibraryVersion, learningReplaceRevision, learningReviewLibraryVersion, learningReviewRevision, learningSetCatalogueAuthority, learningSubmitLibraryVersion, learningSubmitRevision, learningUpdateCourseSettings, learningUpdatePath, learningWithdrawPathAssessment };
|
|
585
|
+
|
|
586
|
+
//# sourceMappingURL=biblio-learning-authoring.js.map
|