@composable-os/pack-courses 0.0.0-stage → 0.1.0-beta.11
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/LICENSE +109 -0
- package/dist/automations.d.ts +12 -0
- package/dist/automations.js +84 -0
- package/dist/blocks/courses-builder/course-builder.d.ts +5 -0
- package/dist/blocks/courses-builder/course-builder.js +69 -0
- package/dist/blocks/courses-catalogue/catalogue.d.ts +6 -0
- package/dist/blocks/courses-catalogue/catalogue.js +21 -0
- package/dist/blocks/courses-course/course-page.d.ts +10 -0
- package/dist/blocks/courses-course/course-page.js +51 -0
- package/dist/blocks/courses-my-courses/my-courses.d.ts +5 -0
- package/dist/blocks/courses-my-courses/my-courses.js +20 -0
- package/dist/blocks/courses-native-catalogue/catalogue-screen.d.ts +6 -0
- package/dist/blocks/courses-native-catalogue/catalogue-screen.js +15 -0
- package/dist/blocks/courses-native-course/course-screen.d.ts +7 -0
- package/dist/blocks/courses-native-course/course-screen.js +18 -0
- package/dist/blocks/courses-native-my-courses/my-courses-screen.d.ts +5 -0
- package/dist/blocks/courses-native-my-courses/my-courses-screen.js +9 -0
- package/dist/blocks/courses-native-player/lesson-screen.d.ts +19 -0
- package/dist/blocks/courses-native-player/lesson-screen.js +11 -0
- package/dist/blocks/courses-native-subscription/subscription-screen.d.ts +4 -0
- package/dist/blocks/courses-native-subscription/subscription-screen.js +17 -0
- package/dist/blocks/courses-player/player.d.ts +12 -0
- package/dist/blocks/courses-player/player.js +51 -0
- package/dist/blocks/courses-subscribe/subscribe.d.ts +28 -0
- package/dist/blocks/courses-subscribe/subscribe.js +146 -0
- package/dist/blocks/courses-subscription/my-subscription.d.ts +6 -0
- package/dist/blocks/courses-subscription/my-subscription.js +50 -0
- package/dist/client/index.d.ts +1319 -0
- package/dist/client/index.js +414 -0
- package/dist/dashboards.d.ts +5 -0
- package/dist/dashboards.js +119 -0
- package/dist/index.d.ts +809 -0
- package/dist/index.js +427 -0
- package/dist/outline.d.ts +85 -0
- package/dist/outline.js +188 -0
- package/dist/tools.d.ts +255 -0
- package/dist/tools.js +826 -0
- package/package.json +36 -4
- package/README.md +0 -3
package/dist/outline.js
ADDED
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
// A course's outline (stage 42, step 4; ADR 0478): one document of sections of lessons, versioned
|
|
2
|
+
// and copied whole when the course is published, as a program's layout is (ADR 0448).
|
|
3
|
+
//
|
|
4
|
+
// outline → sections (a key, a title) → lessons, each one kind:
|
|
5
|
+
// video a ready video from the media library, and notes in rich text
|
|
6
|
+
// text a page of rich text
|
|
7
|
+
// session a published Programs program and one session of its layout (week, position),
|
|
8
|
+
// with an optional video to follow along to
|
|
9
|
+
// download a file from the media library (a PDF) and a note
|
|
10
|
+
//
|
|
11
|
+
// Every lesson has a key that names it for good (progress is kept by it), a title, a duration in
|
|
12
|
+
// minutes, whether it is a free preview, and the id it had on the old platform (for the import).
|
|
13
|
+
// The title, kind, duration and preview flag are for everyone who may read the course; the rest is
|
|
14
|
+
// for holders only (`holders`, ADR 0477), unless the lesson is a free preview. The host removes
|
|
15
|
+
// those parts for everyone else and plays their videos only to a holder: nothing here decides it.
|
|
16
|
+
import { FILE_NODE, RICH_TEXT_SCHEMA, VIDEO_NODE, } from "@composable-os/sdk";
|
|
17
|
+
/** The kinds of lesson, in the order the builder offers them. */
|
|
18
|
+
export const LESSON_KINDS = ["video", "text", "session", "download"];
|
|
19
|
+
/** The most sections a course has, and lessons a section. */
|
|
20
|
+
export const MAX_SECTIONS = 50;
|
|
21
|
+
export const MAX_LESSONS_PER_SECTION = 100;
|
|
22
|
+
/** The most an outline may be, in bytes of its JSON. */
|
|
23
|
+
export const OUTLINE_MAX_BYTES = 524_288;
|
|
24
|
+
const KEY_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-";
|
|
25
|
+
const optional = (node) => ({ ...node, optional: true });
|
|
26
|
+
const richText = { type: "use", def: "richText" };
|
|
27
|
+
/** What every lesson has, whatever its kind. */
|
|
28
|
+
const common = {
|
|
29
|
+
key: {
|
|
30
|
+
type: "text",
|
|
31
|
+
min: 1,
|
|
32
|
+
max: 40,
|
|
33
|
+
chars: KEY_CHARS,
|
|
34
|
+
description: "The lesson's name for good: progress is kept by it. Never changed once published.",
|
|
35
|
+
},
|
|
36
|
+
title: { type: "text", min: 1, max: 200, noMarkup: true },
|
|
37
|
+
duration: optional({
|
|
38
|
+
type: "number",
|
|
39
|
+
min: 0,
|
|
40
|
+
max: 600,
|
|
41
|
+
integer: true,
|
|
42
|
+
description: "Minutes",
|
|
43
|
+
}),
|
|
44
|
+
preview: optional({
|
|
45
|
+
type: "boolean",
|
|
46
|
+
description: "A free preview: everyone who may read the course reads it, and plays its video",
|
|
47
|
+
}),
|
|
48
|
+
sourceId: optional({
|
|
49
|
+
type: "text",
|
|
50
|
+
max: 100,
|
|
51
|
+
description: "Its id on the platform it was imported from",
|
|
52
|
+
}),
|
|
53
|
+
};
|
|
54
|
+
const lesson = (fields, holders) => ({
|
|
55
|
+
type: "object",
|
|
56
|
+
fields: { ...common, ...fields },
|
|
57
|
+
// The lesson's own material is for holders, unless it is a free preview.
|
|
58
|
+
holders: { keys: holders, unless: "preview" },
|
|
59
|
+
});
|
|
60
|
+
/** The outline's schema: a document field's `schema` (with rich text's definitions in it). */
|
|
61
|
+
export const OUTLINE_SCHEMA = {
|
|
62
|
+
root: {
|
|
63
|
+
type: "object",
|
|
64
|
+
fields: {
|
|
65
|
+
sections: {
|
|
66
|
+
type: "array",
|
|
67
|
+
max: MAX_SECTIONS,
|
|
68
|
+
unique: "key",
|
|
69
|
+
of: {
|
|
70
|
+
type: "object",
|
|
71
|
+
fields: {
|
|
72
|
+
key: { type: "text", min: 1, max: 40, chars: KEY_CHARS },
|
|
73
|
+
title: { type: "text", min: 1, max: 200, noMarkup: true },
|
|
74
|
+
lessons: {
|
|
75
|
+
type: "array",
|
|
76
|
+
max: MAX_LESSONS_PER_SECTION,
|
|
77
|
+
unique: "key",
|
|
78
|
+
// A lesson's key once in the whole outline: its progress is kept by it.
|
|
79
|
+
uniqueAcross: true,
|
|
80
|
+
of: {
|
|
81
|
+
type: "union",
|
|
82
|
+
tag: "kind",
|
|
83
|
+
variants: {
|
|
84
|
+
video: lesson({ video: VIDEO_NODE, notes: optional(richText) }, [
|
|
85
|
+
"video",
|
|
86
|
+
"notes",
|
|
87
|
+
]),
|
|
88
|
+
text: lesson({ body: richText }, ["body"]),
|
|
89
|
+
session: lesson({
|
|
90
|
+
program: {
|
|
91
|
+
type: "ref",
|
|
92
|
+
to: "programs.program",
|
|
93
|
+
description: "A published Programs program",
|
|
94
|
+
},
|
|
95
|
+
week: { type: "number", min: 1, max: 52, integer: true },
|
|
96
|
+
session: {
|
|
97
|
+
type: "number",
|
|
98
|
+
min: 0,
|
|
99
|
+
max: 13,
|
|
100
|
+
integer: true,
|
|
101
|
+
description: "Which session of that week (0 is the first)",
|
|
102
|
+
},
|
|
103
|
+
video: optional(VIDEO_NODE),
|
|
104
|
+
}, ["program", "week", "session", "video"]),
|
|
105
|
+
download: lesson({
|
|
106
|
+
file: FILE_NODE,
|
|
107
|
+
note: optional({ type: "text", max: 2000, multiline: true, noMarkup: true }),
|
|
108
|
+
}, ["file", "note"]),
|
|
109
|
+
},
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
117
|
+
defs: { ...(RICH_TEXT_SCHEMA.defs ?? {}), richText: RICH_TEXT_SCHEMA.root },
|
|
118
|
+
};
|
|
119
|
+
/** An empty outline. */
|
|
120
|
+
export const EMPTY_OUTLINE = { sections: [] };
|
|
121
|
+
/** The value as an outline, or an empty one when it is not one. */
|
|
122
|
+
export function asOutline(value) {
|
|
123
|
+
const v = value;
|
|
124
|
+
return v && Array.isArray(v.sections) ? v : EMPTY_OUTLINE;
|
|
125
|
+
}
|
|
126
|
+
/** Every lesson in order, with its section's key. */
|
|
127
|
+
export function lessonsOf(outline) {
|
|
128
|
+
return outline.sections.flatMap((section) => (section.lessons ?? []).map((l) => ({ ...l, section: section.key })));
|
|
129
|
+
}
|
|
130
|
+
/** One lesson by its key, or null. */
|
|
131
|
+
export function findLesson(outline, key) {
|
|
132
|
+
return lessonsOf(outline).find((l) => l.key === key) ?? null;
|
|
133
|
+
}
|
|
134
|
+
/** The lesson after this one, or null at the end. */
|
|
135
|
+
export function nextLesson(outline, key) {
|
|
136
|
+
const all = lessonsOf(outline);
|
|
137
|
+
const at = all.findIndex((l) => l.key === key);
|
|
138
|
+
return at >= 0 ? (all[at + 1] ?? null) : null;
|
|
139
|
+
}
|
|
140
|
+
/** Where a lesson's video is, if it has one (a video lesson's, or a session's follow-along). */
|
|
141
|
+
export function lessonVideo(lesson) {
|
|
142
|
+
return (lesson.kind === "video" || lesson.kind === "session") && lesson.video
|
|
143
|
+
? lesson.video
|
|
144
|
+
: null;
|
|
145
|
+
}
|
|
146
|
+
/** The programs a course's session lessons use, each once. */
|
|
147
|
+
export function sessionPrograms(outline) {
|
|
148
|
+
return [
|
|
149
|
+
...new Set(lessonsOf(outline)
|
|
150
|
+
.map((l) => (l.kind === "session" ? l.program : undefined))
|
|
151
|
+
.filter((p) => Boolean(p))),
|
|
152
|
+
];
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* How far a student is: the lessons that count (every lesson that is not a download), how many of
|
|
156
|
+
* them are done, and whether the course is complete (all of them, or imported as completed). A
|
|
157
|
+
* lesson the outline no longer has does not count, whatever its progress row says.
|
|
158
|
+
*/
|
|
159
|
+
export function completion(outline, done, importedComplete = false) {
|
|
160
|
+
const counted = lessonsOf(outline).filter((l) => l.kind !== "download");
|
|
161
|
+
const doneCount = counted.filter((l) => done.has(l.key)).length;
|
|
162
|
+
return {
|
|
163
|
+
counted: counted.length,
|
|
164
|
+
done: doneCount,
|
|
165
|
+
complete: importedComplete || (counted.length > 0 && doneCount === counted.length),
|
|
166
|
+
};
|
|
167
|
+
}
|
|
168
|
+
/** A video counts as watched once its position is within this many seconds of its end. */
|
|
169
|
+
export const END_SECONDS = 10;
|
|
170
|
+
/** Whether a video left at `position` of `duration` seconds has been watched to its end. */
|
|
171
|
+
export function watchedToEnd(position, duration) {
|
|
172
|
+
return typeof duration === "number" && duration > 0 && position >= duration - END_SECONDS;
|
|
173
|
+
}
|
|
174
|
+
/** What is wrong with an outline beyond its schema: a lesson key used twice across sections. */
|
|
175
|
+
export function outlineProblems(outline) {
|
|
176
|
+
const seen = new Map();
|
|
177
|
+
const problems = [];
|
|
178
|
+
for (const section of outline.sections) {
|
|
179
|
+
for (const l of section.lessons ?? []) {
|
|
180
|
+
const before = seen.get(l.key);
|
|
181
|
+
if (before)
|
|
182
|
+
problems.push(`The lesson key "${l.key}" is in ${before} and ${section.key}`);
|
|
183
|
+
else
|
|
184
|
+
seen.set(l.key, section.key);
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return problems;
|
|
188
|
+
}
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { z } from "@composable-os/sdk";
|
|
2
|
+
export declare const THEME = "courses.theme";
|
|
3
|
+
export declare const COURSE = "courses.course";
|
|
4
|
+
export declare const BUNDLE = "courses.bundle";
|
|
5
|
+
export declare const ENROLMENT = "courses.enrolment";
|
|
6
|
+
export declare const PROGRESS = "courses.progress";
|
|
7
|
+
export declare const catalogue: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
8
|
+
theme: z.ZodOptional<z.ZodString>;
|
|
9
|
+
level: z.ZodOptional<z.ZodNumber>;
|
|
10
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
11
|
+
themes: z.ZodArray<z.ZodObject<{
|
|
12
|
+
id: z.ZodString;
|
|
13
|
+
name: z.ZodNullable<z.ZodString>;
|
|
14
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
15
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
16
|
+
picture: z.ZodNullable<z.ZodObject<{
|
|
17
|
+
media: z.ZodString;
|
|
18
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
19
|
+
}, z.core.$loose>>;
|
|
20
|
+
}, z.core.$strip>>;
|
|
21
|
+
courses: z.ZodArray<z.ZodObject<{
|
|
22
|
+
id: z.ZodString;
|
|
23
|
+
title: z.ZodNullable<z.ZodString>;
|
|
24
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
25
|
+
theme: z.ZodNullable<z.ZodString>;
|
|
26
|
+
level: z.ZodNullable<z.ZodNumber>;
|
|
27
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
28
|
+
cover: z.ZodNullable<z.ZodObject<{
|
|
29
|
+
media: z.ZodString;
|
|
30
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
31
|
+
}, z.core.$loose>>;
|
|
32
|
+
trailer: z.ZodNullable<z.ZodObject<{
|
|
33
|
+
media: z.ZodString;
|
|
34
|
+
poster: z.ZodOptional<z.ZodString>;
|
|
35
|
+
}, z.core.$strip>>;
|
|
36
|
+
price: z.ZodNullable<z.ZodNumber>;
|
|
37
|
+
lessons: z.ZodNumber;
|
|
38
|
+
}, z.core.$strip>>;
|
|
39
|
+
bundles: z.ZodArray<z.ZodObject<{
|
|
40
|
+
id: z.ZodString;
|
|
41
|
+
title: z.ZodNullable<z.ZodString>;
|
|
42
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
43
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
44
|
+
cover: z.ZodNullable<z.ZodObject<{
|
|
45
|
+
media: z.ZodString;
|
|
46
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
47
|
+
}, z.core.$loose>>;
|
|
48
|
+
courses: z.ZodArray<z.ZodString>;
|
|
49
|
+
price: z.ZodNullable<z.ZodNumber>;
|
|
50
|
+
}, z.core.$strip>>;
|
|
51
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
export declare const PLAN = "courses.plan";
|
|
54
|
+
export declare const plans: import("@composable-os/sdk").ToolSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
55
|
+
plans: z.ZodArray<z.ZodObject<{
|
|
56
|
+
id: z.ZodString;
|
|
57
|
+
title: z.ZodNullable<z.ZodString>;
|
|
58
|
+
description: z.ZodNullable<z.ZodString>;
|
|
59
|
+
price: z.ZodNullable<z.ZodNumber>;
|
|
60
|
+
trialDays: z.ZodNullable<z.ZodNumber>;
|
|
61
|
+
}, z.core.$strip>>;
|
|
62
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
63
|
+
}, z.core.$strip>>;
|
|
64
|
+
export declare const course: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
65
|
+
slug: z.ZodString;
|
|
66
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
67
|
+
id: z.ZodString;
|
|
68
|
+
title: z.ZodNullable<z.ZodString>;
|
|
69
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
70
|
+
theme: z.ZodNullable<z.ZodString>;
|
|
71
|
+
level: z.ZodNullable<z.ZodNumber>;
|
|
72
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
73
|
+
cover: z.ZodNullable<z.ZodObject<{
|
|
74
|
+
media: z.ZodString;
|
|
75
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
76
|
+
}, z.core.$loose>>;
|
|
77
|
+
trailer: z.ZodNullable<z.ZodObject<{
|
|
78
|
+
media: z.ZodString;
|
|
79
|
+
poster: z.ZodOptional<z.ZodString>;
|
|
80
|
+
}, z.core.$strip>>;
|
|
81
|
+
price: z.ZodNullable<z.ZodNumber>;
|
|
82
|
+
lessons: z.ZodNumber;
|
|
83
|
+
description: z.ZodUnknown;
|
|
84
|
+
sections: z.ZodArray<z.ZodObject<{
|
|
85
|
+
key: z.ZodString;
|
|
86
|
+
title: z.ZodString;
|
|
87
|
+
lessons: z.ZodArray<z.ZodObject<{
|
|
88
|
+
key: z.ZodString;
|
|
89
|
+
title: z.ZodString;
|
|
90
|
+
kind: z.ZodEnum<{
|
|
91
|
+
video: "video";
|
|
92
|
+
text: "text";
|
|
93
|
+
session: "session";
|
|
94
|
+
download: "download";
|
|
95
|
+
}>;
|
|
96
|
+
duration: z.ZodNullable<z.ZodNumber>;
|
|
97
|
+
preview: z.ZodBoolean;
|
|
98
|
+
}, z.core.$strip>>;
|
|
99
|
+
}, z.core.$strip>>;
|
|
100
|
+
currency: z.ZodNullable<z.ZodString>;
|
|
101
|
+
holds: z.ZodBoolean;
|
|
102
|
+
done: z.ZodArray<z.ZodString>;
|
|
103
|
+
complete: z.ZodBoolean;
|
|
104
|
+
}, z.core.$strip>>;
|
|
105
|
+
export declare const lesson: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
106
|
+
courseId: z.ZodString;
|
|
107
|
+
lessonKey: z.ZodString;
|
|
108
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
109
|
+
courseId: z.ZodString;
|
|
110
|
+
lesson: z.ZodRecord<z.ZodString, z.ZodUnknown>;
|
|
111
|
+
video: z.ZodNullable<z.ZodObject<{
|
|
112
|
+
media: z.ZodString;
|
|
113
|
+
poster: z.ZodNullable<z.ZodString>;
|
|
114
|
+
record: z.ZodObject<{
|
|
115
|
+
object: z.ZodString;
|
|
116
|
+
id: z.ZodString;
|
|
117
|
+
}, z.core.$strip>;
|
|
118
|
+
field: z.ZodString;
|
|
119
|
+
}, z.core.$strip>>;
|
|
120
|
+
position: z.ZodNullable<z.ZodNumber>;
|
|
121
|
+
state: z.ZodNullable<z.ZodEnum<{
|
|
122
|
+
done: "done";
|
|
123
|
+
started: "started";
|
|
124
|
+
}>>;
|
|
125
|
+
next: z.ZodNullable<z.ZodObject<{
|
|
126
|
+
key: z.ZodString;
|
|
127
|
+
title: z.ZodString;
|
|
128
|
+
kind: z.ZodEnum<{
|
|
129
|
+
video: "video";
|
|
130
|
+
text: "text";
|
|
131
|
+
session: "session";
|
|
132
|
+
download: "download";
|
|
133
|
+
}>;
|
|
134
|
+
duration: z.ZodNullable<z.ZodNumber>;
|
|
135
|
+
preview: z.ZodBoolean;
|
|
136
|
+
}, z.core.$strip>>;
|
|
137
|
+
}, z.core.$strip>>;
|
|
138
|
+
export declare const progress: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
139
|
+
courseId: z.ZodString;
|
|
140
|
+
lessonKey: z.ZodString;
|
|
141
|
+
state: z.ZodOptional<z.ZodEnum<{
|
|
142
|
+
done: "done";
|
|
143
|
+
started: "started";
|
|
144
|
+
}>>;
|
|
145
|
+
position: z.ZodOptional<z.ZodNumber>;
|
|
146
|
+
duration: z.ZodOptional<z.ZodNumber>;
|
|
147
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
148
|
+
lessonKey: z.ZodString;
|
|
149
|
+
state: z.ZodEnum<{
|
|
150
|
+
done: "done";
|
|
151
|
+
started: "started";
|
|
152
|
+
}>;
|
|
153
|
+
position: z.ZodNullable<z.ZodNumber>;
|
|
154
|
+
done: z.ZodNumber;
|
|
155
|
+
counted: z.ZodNumber;
|
|
156
|
+
complete: z.ZodBoolean;
|
|
157
|
+
}, z.core.$strip>>;
|
|
158
|
+
export declare const myCourses: import("@composable-os/sdk").ToolSpec<z.ZodObject<{}, z.core.$strip>, z.ZodObject<{
|
|
159
|
+
courses: z.ZodArray<z.ZodObject<{
|
|
160
|
+
id: z.ZodString;
|
|
161
|
+
title: z.ZodNullable<z.ZodString>;
|
|
162
|
+
slug: z.ZodNullable<z.ZodString>;
|
|
163
|
+
theme: z.ZodNullable<z.ZodString>;
|
|
164
|
+
level: z.ZodNullable<z.ZodNumber>;
|
|
165
|
+
summary: z.ZodNullable<z.ZodString>;
|
|
166
|
+
cover: z.ZodNullable<z.ZodObject<{
|
|
167
|
+
media: z.ZodString;
|
|
168
|
+
alt: z.ZodOptional<z.ZodString>;
|
|
169
|
+
}, z.core.$loose>>;
|
|
170
|
+
trailer: z.ZodNullable<z.ZodObject<{
|
|
171
|
+
media: z.ZodString;
|
|
172
|
+
poster: z.ZodOptional<z.ZodString>;
|
|
173
|
+
}, z.core.$strip>>;
|
|
174
|
+
price: z.ZodNullable<z.ZodNumber>;
|
|
175
|
+
lessons: z.ZodNumber;
|
|
176
|
+
why: z.ZodEnum<{
|
|
177
|
+
bought: "bought";
|
|
178
|
+
bundle: "bundle";
|
|
179
|
+
given: "given";
|
|
180
|
+
imported: "imported";
|
|
181
|
+
subscription: "subscription";
|
|
182
|
+
}>;
|
|
183
|
+
done: z.ZodNumber;
|
|
184
|
+
counted: z.ZodNumber;
|
|
185
|
+
complete: z.ZodBoolean;
|
|
186
|
+
continueWith: z.ZodNullable<z.ZodString>;
|
|
187
|
+
}, z.core.$strip>>;
|
|
188
|
+
}, z.core.$strip>>;
|
|
189
|
+
export declare const buy: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
190
|
+
courseId: z.ZodOptional<z.ZodString>;
|
|
191
|
+
bundleId: z.ZodOptional<z.ZodString>;
|
|
192
|
+
email: z.ZodOptional<z.ZodString>;
|
|
193
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
194
|
+
id: z.ZodString;
|
|
195
|
+
state: z.ZodString;
|
|
196
|
+
currency: z.ZodString;
|
|
197
|
+
total: z.ZodNumber;
|
|
198
|
+
token: z.ZodNullable<z.ZodString>;
|
|
199
|
+
}, z.core.$strip>>;
|
|
200
|
+
export declare const enrol: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
201
|
+
personId: z.ZodString;
|
|
202
|
+
courseId: z.ZodOptional<z.ZodString>;
|
|
203
|
+
bundleId: z.ZodOptional<z.ZodString>;
|
|
204
|
+
until: z.ZodOptional<z.ZodString>;
|
|
205
|
+
reason: z.ZodString;
|
|
206
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
207
|
+
enrolmentId: z.ZodString;
|
|
208
|
+
status: z.ZodString;
|
|
209
|
+
source: z.ZodString;
|
|
210
|
+
}, z.core.$strip>>;
|
|
211
|
+
export declare const endEnrolment: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
212
|
+
enrolmentId: z.ZodString;
|
|
213
|
+
reason: z.ZodString;
|
|
214
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
215
|
+
enrolmentId: z.ZodString;
|
|
216
|
+
status: z.ZodString;
|
|
217
|
+
source: z.ZodString;
|
|
218
|
+
}, z.core.$strip>>;
|
|
219
|
+
export declare const stats: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
220
|
+
courseId: z.ZodOptional<z.ZodString>;
|
|
221
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
222
|
+
courses: z.ZodArray<z.ZodObject<{
|
|
223
|
+
courseId: z.ZodString;
|
|
224
|
+
title: z.ZodNullable<z.ZodString>;
|
|
225
|
+
active: z.ZodNumber;
|
|
226
|
+
ended: z.ZodNumber;
|
|
227
|
+
void: z.ZodNumber;
|
|
228
|
+
lessonsDone: z.ZodNumber;
|
|
229
|
+
}, z.core.$strip>>;
|
|
230
|
+
byWeek: z.ZodArray<z.ZodObject<{
|
|
231
|
+
week: z.ZodString;
|
|
232
|
+
done: z.ZodNumber;
|
|
233
|
+
}, z.core.$strip>>;
|
|
234
|
+
}, z.core.$strip>>;
|
|
235
|
+
export declare const draft: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
236
|
+
brief: z.ZodString;
|
|
237
|
+
title: z.ZodOptional<z.ZodString>;
|
|
238
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
239
|
+
courseId: z.ZodString;
|
|
240
|
+
title: z.ZodString;
|
|
241
|
+
sections: z.ZodNumber;
|
|
242
|
+
lessons: z.ZodNumber;
|
|
243
|
+
videos: z.ZodArray<z.ZodString>;
|
|
244
|
+
programs: z.ZodArray<z.ZodString>;
|
|
245
|
+
published: z.ZodLiteral<false>;
|
|
246
|
+
}, z.core.$strip>>;
|
|
247
|
+
export declare const startSession: import("@composable-os/sdk").ToolSpec<z.ZodObject<{
|
|
248
|
+
courseId: z.ZodString;
|
|
249
|
+
lessonKey: z.ZodString;
|
|
250
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
251
|
+
preparing: z.ZodBoolean;
|
|
252
|
+
sessionId: z.ZodNullable<z.ZodString>;
|
|
253
|
+
date: z.ZodNullable<z.ZodString>;
|
|
254
|
+
programId: z.ZodNullable<z.ZodString>;
|
|
255
|
+
}, z.core.$strip>>;
|