@whop/sdk 0.0.2 → 0.0.4
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/CHANGELOG.md +55 -0
- package/client.d.mts +30 -12
- package/client.d.mts.map +1 -1
- package/client.d.ts +30 -12
- package/client.d.ts.map +1 -1
- package/client.js +19 -1
- package/client.js.map +1 -1
- package/client.mjs +21 -3
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/app-builds.d.mts +16 -13
- package/resources/app-builds.d.mts.map +1 -1
- package/resources/app-builds.d.ts +16 -13
- package/resources/app-builds.d.ts.map +1 -1
- package/resources/app-builds.js +1 -1
- package/resources/app-builds.mjs +1 -1
- package/resources/apps.d.mts +15 -10
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +15 -10
- package/resources/apps.d.ts.map +1 -1
- package/resources/checkout-configurations.d.mts +252 -140
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +252 -140
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js +6 -20
- package/resources/checkout-configurations.js.map +1 -1
- package/resources/checkout-configurations.mjs +6 -20
- package/resources/checkout-configurations.mjs.map +1 -1
- package/resources/companies.d.mts +157 -0
- package/resources/companies.d.mts.map +1 -1
- package/resources/companies.d.ts +157 -0
- package/resources/companies.d.ts.map +1 -1
- package/resources/companies.js +22 -0
- package/resources/companies.js.map +1 -1
- package/resources/companies.mjs +22 -0
- package/resources/companies.mjs.map +1 -1
- package/resources/course-chapters.d.mts +185 -0
- package/resources/course-chapters.d.mts.map +1 -0
- package/resources/course-chapters.d.ts +185 -0
- package/resources/course-chapters.d.ts.map +1 -0
- package/resources/course-chapters.js +103 -0
- package/resources/course-chapters.js.map +1 -0
- package/resources/course-chapters.mjs +99 -0
- package/resources/course-chapters.mjs.map +1 -0
- package/resources/course-lesson-interactions.d.mts +2 -2
- package/resources/course-lesson-interactions.d.ts +2 -2
- package/resources/course-lesson-interactions.js +2 -2
- package/resources/course-lesson-interactions.mjs +2 -2
- package/resources/course-lessons.d.mts +563 -0
- package/resources/course-lessons.d.mts.map +1 -0
- package/resources/course-lessons.d.ts +563 -0
- package/resources/course-lessons.d.ts.map +1 -0
- package/resources/course-lessons.js +101 -0
- package/resources/course-lessons.js.map +1 -0
- package/resources/course-lessons.mjs +97 -0
- package/resources/course-lessons.mjs.map +1 -0
- package/resources/course-students.d.mts +187 -0
- package/resources/course-students.d.mts.map +1 -0
- package/resources/course-students.d.ts +187 -0
- package/resources/course-students.d.ts.map +1 -0
- package/resources/course-students.js +36 -0
- package/resources/course-students.js.map +1 -0
- package/resources/course-students.mjs +32 -0
- package/resources/course-students.mjs.map +1 -0
- package/resources/courses.d.mts +485 -0
- package/resources/courses.d.mts.map +1 -0
- package/resources/courses.d.ts +485 -0
- package/resources/courses.d.ts.map +1 -0
- package/resources/courses.js +98 -0
- package/resources/courses.js.map +1 -0
- package/resources/courses.mjs +94 -0
- package/resources/courses.mjs.map +1 -0
- package/resources/experiences.d.mts +42 -11
- package/resources/experiences.d.mts.map +1 -1
- package/resources/experiences.d.ts +42 -11
- package/resources/experiences.d.ts.map +1 -1
- package/resources/experiences.js +22 -0
- package/resources/experiences.js.map +1 -1
- package/resources/experiences.mjs +22 -0
- package/resources/experiences.mjs.map +1 -1
- package/resources/forum-posts.d.mts +75 -10
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +75 -10
- package/resources/forum-posts.d.ts.map +1 -1
- package/resources/forum-posts.js +11 -0
- package/resources/forum-posts.js.map +1 -1
- package/resources/forum-posts.mjs +11 -0
- package/resources/forum-posts.mjs.map +1 -1
- package/resources/index.d.mts +12 -6
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +12 -6
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +13 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +7 -1
- package/resources/index.mjs.map +1 -1
- package/resources/invoices.d.mts +529 -146
- package/resources/invoices.d.mts.map +1 -1
- package/resources/invoices.d.ts +529 -146
- package/resources/invoices.d.ts.map +1 -1
- package/resources/invoices.js +2 -24
- package/resources/invoices.js.map +1 -1
- package/resources/invoices.mjs +2 -24
- package/resources/invoices.mjs.map +1 -1
- package/resources/ledger-accounts.d.mts +1 -1
- package/resources/ledger-accounts.d.mts.map +1 -1
- package/resources/ledger-accounts.d.ts +1 -1
- package/resources/ledger-accounts.d.ts.map +1 -1
- package/resources/members.d.mts +4 -0
- package/resources/members.d.mts.map +1 -1
- package/resources/members.d.ts +4 -0
- package/resources/members.d.ts.map +1 -1
- package/resources/memberships.d.mts +26 -5
- package/resources/memberships.d.mts.map +1 -1
- package/resources/memberships.d.ts +26 -5
- package/resources/memberships.d.ts.map +1 -1
- package/resources/memberships.js +1 -1
- package/resources/memberships.js.map +1 -1
- package/resources/memberships.mjs +1 -1
- package/resources/memberships.mjs.map +1 -1
- package/resources/messages.d.mts +57 -10
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +57 -10
- package/resources/messages.d.ts.map +1 -1
- package/resources/messages.js +6 -0
- package/resources/messages.js.map +1 -1
- package/resources/messages.mjs +6 -0
- package/resources/messages.mjs.map +1 -1
- package/resources/payments.d.mts +35 -13
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +35 -13
- package/resources/payments.d.ts.map +1 -1
- package/resources/plans.d.mts +161 -17
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +161 -17
- package/resources/plans.d.ts.map +1 -1
- package/resources/plans.js.map +1 -1
- package/resources/plans.mjs.map +1 -1
- package/resources/products.d.mts +30 -33
- package/resources/products.d.mts.map +1 -1
- package/resources/products.d.ts +30 -33
- package/resources/products.d.ts.map +1 -1
- package/resources/promo-codes.d.mts +394 -0
- package/resources/promo-codes.d.mts.map +1 -0
- package/resources/promo-codes.d.ts +394 -0
- package/resources/promo-codes.d.ts.map +1 -0
- package/resources/promo-codes.js +91 -0
- package/resources/promo-codes.js.map +1 -0
- package/resources/promo-codes.mjs +87 -0
- package/resources/promo-codes.mjs.map +1 -0
- package/resources/reviews.d.mts +277 -0
- package/resources/reviews.d.mts.map +1 -0
- package/resources/reviews.d.ts +277 -0
- package/resources/reviews.d.ts.map +1 -0
- package/resources/reviews.js +23 -0
- package/resources/reviews.js.map +1 -0
- package/resources/reviews.mjs +19 -0
- package/resources/reviews.mjs.map +1 -0
- package/resources/shared.d.mts +117 -14
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +117 -14
- package/resources/shared.d.ts.map +1 -1
- package/resources/transfers.d.mts +12 -0
- package/resources/transfers.d.mts.map +1 -1
- package/resources/transfers.d.ts +12 -0
- package/resources/transfers.d.ts.map +1 -1
- package/src/client.ts +166 -11
- package/src/resources/app-builds.ts +19 -14
- package/src/resources/apps.ts +16 -11
- package/src/resources/checkout-configurations.ts +278 -143
- package/src/resources/companies.ts +196 -0
- package/src/resources/course-chapters.ts +236 -0
- package/src/resources/course-lesson-interactions.ts +2 -2
- package/src/resources/course-lessons.ts +699 -0
- package/src/resources/course-students.ts +238 -0
- package/src/resources/courses.ts +622 -0
- package/src/resources/experiences.ts +54 -11
- package/src/resources/forum-posts.ts +95 -10
- package/src/resources/index.ts +73 -2
- package/src/resources/invoices.ts +620 -149
- package/src/resources/ledger-accounts.ts +13 -1
- package/src/resources/members.ts +5 -0
- package/src/resources/memberships.ts +31 -6
- package/src/resources/messages.ts +74 -10
- package/src/resources/payments.ts +146 -19
- package/src/resources/plans.ts +184 -17
- package/src/resources/products.ts +36 -37
- package/src/resources/promo-codes.ts +490 -0
- package/src/resources/reviews.ts +348 -0
- package/src/resources/shared.ts +128 -14
- package/src/resources/transfers.ts +10 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -0,0 +1,185 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.js";
|
|
4
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
5
|
+
export declare class CourseChapters extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new course chapter
|
|
8
|
+
*
|
|
9
|
+
* Required permissions:
|
|
10
|
+
*
|
|
11
|
+
* - `courses:update`
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const courseChapter = await client.courseChapters.create({
|
|
16
|
+
* course_id: 'cors_xxxxxxxxxxxxx',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
create(body: CourseChapterCreateParams, options?: RequestOptions): APIPromise<CourseChapter>;
|
|
21
|
+
/**
|
|
22
|
+
* Retrieves a course chapter by ID
|
|
23
|
+
*
|
|
24
|
+
* Required permissions:
|
|
25
|
+
*
|
|
26
|
+
* - `courses:read`
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const courseChapter = await client.courseChapters.retrieve(
|
|
31
|
+
* 'chap_xxxxxxxxxxxxx',
|
|
32
|
+
* );
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<CourseChapter>;
|
|
36
|
+
/**
|
|
37
|
+
* Updates a course chapter
|
|
38
|
+
*
|
|
39
|
+
* Required permissions:
|
|
40
|
+
*
|
|
41
|
+
* - `courses:update`
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const courseChapter = await client.courseChapters.update(
|
|
46
|
+
* 'chap_xxxxxxxxxxxxx',
|
|
47
|
+
* { title: 'title' },
|
|
48
|
+
* );
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
update(id: string, body: CourseChapterUpdateParams, options?: RequestOptions): APIPromise<CourseChapter>;
|
|
52
|
+
/**
|
|
53
|
+
* Lists chapters for a course
|
|
54
|
+
*
|
|
55
|
+
* Required permissions:
|
|
56
|
+
*
|
|
57
|
+
* - `courses:read`
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* // Automatically fetches more pages as needed.
|
|
62
|
+
* for await (const courseChapterListResponse of client.courseChapters.list(
|
|
63
|
+
* { course_id: 'cors_xxxxxxxxxxxxx' },
|
|
64
|
+
* )) {
|
|
65
|
+
* // ...
|
|
66
|
+
* }
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
list(query: CourseChapterListParams, options?: RequestOptions): PagePromise<CourseChapterListResponsesCursorPage, CourseChapterListResponse>;
|
|
70
|
+
/**
|
|
71
|
+
* Deletes a course chapter
|
|
72
|
+
*
|
|
73
|
+
* Required permissions:
|
|
74
|
+
*
|
|
75
|
+
* - `courses:update`
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const courseChapter = await client.courseChapters.delete(
|
|
80
|
+
* 'chap_xxxxxxxxxxxxx',
|
|
81
|
+
* );
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
delete(id: string, options?: RequestOptions): APIPromise<CourseChapterDeleteResponse>;
|
|
85
|
+
}
|
|
86
|
+
export type CourseChapterListResponsesCursorPage = CursorPage<CourseChapterListResponse>;
|
|
87
|
+
/**
|
|
88
|
+
* A chapter from the courses app
|
|
89
|
+
*/
|
|
90
|
+
export interface CourseChapter {
|
|
91
|
+
/**
|
|
92
|
+
* The ID of the chapter. Looks like chap_XXX
|
|
93
|
+
*/
|
|
94
|
+
id: string;
|
|
95
|
+
/**
|
|
96
|
+
* The lessons in this chapter
|
|
97
|
+
*/
|
|
98
|
+
lessons: Array<CourseChapter.Lesson>;
|
|
99
|
+
/**
|
|
100
|
+
* The order of the chapter within its course
|
|
101
|
+
*/
|
|
102
|
+
order: number;
|
|
103
|
+
/**
|
|
104
|
+
* The title of the chapter
|
|
105
|
+
*/
|
|
106
|
+
title: string;
|
|
107
|
+
}
|
|
108
|
+
export declare namespace CourseChapter {
|
|
109
|
+
/**
|
|
110
|
+
* A lesson from the courses app
|
|
111
|
+
*/
|
|
112
|
+
interface Lesson {
|
|
113
|
+
/**
|
|
114
|
+
* The ID of the lesson
|
|
115
|
+
*/
|
|
116
|
+
id: string;
|
|
117
|
+
/**
|
|
118
|
+
* The order of the lesson within its chapter
|
|
119
|
+
*/
|
|
120
|
+
order: number;
|
|
121
|
+
/**
|
|
122
|
+
* The title of the lesson
|
|
123
|
+
*/
|
|
124
|
+
title: string;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* A chapter from the courses app
|
|
129
|
+
*/
|
|
130
|
+
export interface CourseChapterListResponse {
|
|
131
|
+
/**
|
|
132
|
+
* The ID of the chapter. Looks like chap_XXX
|
|
133
|
+
*/
|
|
134
|
+
id: string;
|
|
135
|
+
/**
|
|
136
|
+
* The order of the chapter within its course
|
|
137
|
+
*/
|
|
138
|
+
order: number;
|
|
139
|
+
/**
|
|
140
|
+
* The title of the chapter
|
|
141
|
+
*/
|
|
142
|
+
title: string;
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Represents `true` or `false` values.
|
|
146
|
+
*/
|
|
147
|
+
export type CourseChapterDeleteResponse = boolean;
|
|
148
|
+
export interface CourseChapterCreateParams {
|
|
149
|
+
/**
|
|
150
|
+
* The ID of the course to create the chapter in
|
|
151
|
+
*/
|
|
152
|
+
course_id: string;
|
|
153
|
+
/**
|
|
154
|
+
* The title of the chapter
|
|
155
|
+
*/
|
|
156
|
+
title?: string | null;
|
|
157
|
+
}
|
|
158
|
+
export interface CourseChapterUpdateParams {
|
|
159
|
+
/**
|
|
160
|
+
* The title of the chapter
|
|
161
|
+
*/
|
|
162
|
+
title: string;
|
|
163
|
+
}
|
|
164
|
+
export interface CourseChapterListParams extends CursorPageParams {
|
|
165
|
+
/**
|
|
166
|
+
* The ID of the course
|
|
167
|
+
*/
|
|
168
|
+
course_id: string;
|
|
169
|
+
/**
|
|
170
|
+
* Returns the elements in the list that come before the specified cursor.
|
|
171
|
+
*/
|
|
172
|
+
before?: string | null;
|
|
173
|
+
/**
|
|
174
|
+
* Returns the first _n_ elements from the list.
|
|
175
|
+
*/
|
|
176
|
+
first?: number | null;
|
|
177
|
+
/**
|
|
178
|
+
* Returns the last _n_ elements from the list.
|
|
179
|
+
*/
|
|
180
|
+
last?: number | null;
|
|
181
|
+
}
|
|
182
|
+
export declare namespace CourseChapters {
|
|
183
|
+
export { type CourseChapter as CourseChapter, type CourseChapterListResponse as CourseChapterListResponse, type CourseChapterDeleteResponse as CourseChapterDeleteResponse, type CourseChapterListResponsesCursorPage as CourseChapterListResponsesCursorPage, type CourseChapterCreateParams as CourseChapterCreateParams, type CourseChapterUpdateParams as CourseChapterUpdateParams, type CourseChapterListParams as CourseChapterListParams, };
|
|
184
|
+
}
|
|
185
|
+
//# sourceMappingURL=course-chapters.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"course-chapters.d.ts","sourceRoot":"","sources":["../src/resources/course-chapters.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.CourseChapters = void 0;
|
|
5
|
+
const resource_1 = require("../core/resource.js");
|
|
6
|
+
const pagination_1 = require("../core/pagination.js");
|
|
7
|
+
const path_1 = require("../internal/utils/path.js");
|
|
8
|
+
class CourseChapters extends resource_1.APIResource {
|
|
9
|
+
/**
|
|
10
|
+
* Creates a new course chapter
|
|
11
|
+
*
|
|
12
|
+
* Required permissions:
|
|
13
|
+
*
|
|
14
|
+
* - `courses:update`
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const courseChapter = await client.courseChapters.create({
|
|
19
|
+
* course_id: 'cors_xxxxxxxxxxxxx',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
create(body, options) {
|
|
24
|
+
return this._client.post('/course_chapters', { body, ...options });
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Retrieves a course chapter by ID
|
|
28
|
+
*
|
|
29
|
+
* Required permissions:
|
|
30
|
+
*
|
|
31
|
+
* - `courses:read`
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const courseChapter = await client.courseChapters.retrieve(
|
|
36
|
+
* 'chap_xxxxxxxxxxxxx',
|
|
37
|
+
* );
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
retrieve(id, options) {
|
|
41
|
+
return this._client.get((0, path_1.path) `/course_chapters/${id}`, options);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Updates a course chapter
|
|
45
|
+
*
|
|
46
|
+
* Required permissions:
|
|
47
|
+
*
|
|
48
|
+
* - `courses:update`
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* const courseChapter = await client.courseChapters.update(
|
|
53
|
+
* 'chap_xxxxxxxxxxxxx',
|
|
54
|
+
* { title: 'title' },
|
|
55
|
+
* );
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
update(id, body, options) {
|
|
59
|
+
return this._client.patch((0, path_1.path) `/course_chapters/${id}`, { body, ...options });
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Lists chapters for a course
|
|
63
|
+
*
|
|
64
|
+
* Required permissions:
|
|
65
|
+
*
|
|
66
|
+
* - `courses:read`
|
|
67
|
+
*
|
|
68
|
+
* @example
|
|
69
|
+
* ```ts
|
|
70
|
+
* // Automatically fetches more pages as needed.
|
|
71
|
+
* for await (const courseChapterListResponse of client.courseChapters.list(
|
|
72
|
+
* { course_id: 'cors_xxxxxxxxxxxxx' },
|
|
73
|
+
* )) {
|
|
74
|
+
* // ...
|
|
75
|
+
* }
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
list(query, options) {
|
|
79
|
+
return this._client.getAPIList('/course_chapters', (pagination_1.CursorPage), {
|
|
80
|
+
query,
|
|
81
|
+
...options,
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Deletes a course chapter
|
|
86
|
+
*
|
|
87
|
+
* Required permissions:
|
|
88
|
+
*
|
|
89
|
+
* - `courses:update`
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const courseChapter = await client.courseChapters.delete(
|
|
94
|
+
* 'chap_xxxxxxxxxxxxx',
|
|
95
|
+
* );
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
delete(id, options) {
|
|
99
|
+
return this._client.delete((0, path_1.path) `/course_chapters/${id}`, options);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.CourseChapters = CourseChapters;
|
|
103
|
+
//# sourceMappingURL=course-chapters.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"course-chapters.js","sourceRoot":"","sources":["../src/resources/course-chapters.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,cAAe,SAAQ,sBAAW;IAC7C;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAA+B,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,oBAAoB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAU,EAAE,IAA+B,EAAE,OAAwB;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAA,WAAI,EAAA,oBAAoB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CACF,KAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAA,uBAAqC,CAAA,EAAE;YACxF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAA,WAAI,EAAA,oBAAoB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF;AApGD,wCAoGC"}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
import { APIResource } from "../core/resource.mjs";
|
|
3
|
+
import { CursorPage } from "../core/pagination.mjs";
|
|
4
|
+
import { path } from "../internal/utils/path.mjs";
|
|
5
|
+
export class CourseChapters extends APIResource {
|
|
6
|
+
/**
|
|
7
|
+
* Creates a new course chapter
|
|
8
|
+
*
|
|
9
|
+
* Required permissions:
|
|
10
|
+
*
|
|
11
|
+
* - `courses:update`
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const courseChapter = await client.courseChapters.create({
|
|
16
|
+
* course_id: 'cors_xxxxxxxxxxxxx',
|
|
17
|
+
* });
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
create(body, options) {
|
|
21
|
+
return this._client.post('/course_chapters', { body, ...options });
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Retrieves a course chapter by ID
|
|
25
|
+
*
|
|
26
|
+
* Required permissions:
|
|
27
|
+
*
|
|
28
|
+
* - `courses:read`
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const courseChapter = await client.courseChapters.retrieve(
|
|
33
|
+
* 'chap_xxxxxxxxxxxxx',
|
|
34
|
+
* );
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
retrieve(id, options) {
|
|
38
|
+
return this._client.get(path `/course_chapters/${id}`, options);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Updates a course chapter
|
|
42
|
+
*
|
|
43
|
+
* Required permissions:
|
|
44
|
+
*
|
|
45
|
+
* - `courses:update`
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const courseChapter = await client.courseChapters.update(
|
|
50
|
+
* 'chap_xxxxxxxxxxxxx',
|
|
51
|
+
* { title: 'title' },
|
|
52
|
+
* );
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
update(id, body, options) {
|
|
56
|
+
return this._client.patch(path `/course_chapters/${id}`, { body, ...options });
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Lists chapters for a course
|
|
60
|
+
*
|
|
61
|
+
* Required permissions:
|
|
62
|
+
*
|
|
63
|
+
* - `courses:read`
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* // Automatically fetches more pages as needed.
|
|
68
|
+
* for await (const courseChapterListResponse of client.courseChapters.list(
|
|
69
|
+
* { course_id: 'cors_xxxxxxxxxxxxx' },
|
|
70
|
+
* )) {
|
|
71
|
+
* // ...
|
|
72
|
+
* }
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
list(query, options) {
|
|
76
|
+
return this._client.getAPIList('/course_chapters', (CursorPage), {
|
|
77
|
+
query,
|
|
78
|
+
...options,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Deletes a course chapter
|
|
83
|
+
*
|
|
84
|
+
* Required permissions:
|
|
85
|
+
*
|
|
86
|
+
* - `courses:update`
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const courseChapter = await client.courseChapters.delete(
|
|
91
|
+
* 'chap_xxxxxxxxxxxxx',
|
|
92
|
+
* );
|
|
93
|
+
* ```
|
|
94
|
+
*/
|
|
95
|
+
delete(id, options) {
|
|
96
|
+
return this._client.delete(path `/course_chapters/${id}`, options);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=course-chapters.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"course-chapters.mjs","sourceRoot":"","sources":["../src/resources/course-chapters.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,cAAe,SAAQ,WAAW;IAC7C;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAA+B,EAAE,OAAwB;QAC9D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACrE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,oBAAoB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACjE,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAU,EAAE,IAA+B,EAAE,OAAwB;QAC1E,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,oBAAoB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAChF,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CACF,KAA8B,EAC9B,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,kBAAkB,EAAE,CAAA,UAAqC,CAAA,EAAE;YACxF,KAAK;YACL,GAAG,OAAO;SACX,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAU,EAAE,OAAwB;QACzC,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAA,oBAAoB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACpE,CAAC;CACF"}
|
|
@@ -10,8 +10,8 @@ export declare class CourseLessonInteractions extends APIResource {
|
|
|
10
10
|
*
|
|
11
11
|
* Required permissions:
|
|
12
12
|
*
|
|
13
|
-
* - `course_lesson_interaction:read`
|
|
14
13
|
* - `courses:read`
|
|
14
|
+
* - `course_analytics:read`
|
|
15
15
|
*/
|
|
16
16
|
retrieve(id: string, options?: RequestOptions): APIPromise<Shared.CourseLessonInteraction>;
|
|
17
17
|
/**
|
|
@@ -19,8 +19,8 @@ export declare class CourseLessonInteractions extends APIResource {
|
|
|
19
19
|
*
|
|
20
20
|
* Required permissions:
|
|
21
21
|
*
|
|
22
|
-
* - `course_lesson_interaction:read`
|
|
23
22
|
* - `courses:read`
|
|
23
|
+
* - `course_analytics:read`
|
|
24
24
|
*/
|
|
25
25
|
list(query?: CourseLessonInteractionListParams | null | undefined, options?: RequestOptions): PagePromise<CourseLessonInteractionListItemsCursorPage, Shared.CourseLessonInteractionListItem>;
|
|
26
26
|
}
|
|
@@ -10,8 +10,8 @@ export declare class CourseLessonInteractions extends APIResource {
|
|
|
10
10
|
*
|
|
11
11
|
* Required permissions:
|
|
12
12
|
*
|
|
13
|
-
* - `course_lesson_interaction:read`
|
|
14
13
|
* - `courses:read`
|
|
14
|
+
* - `course_analytics:read`
|
|
15
15
|
*/
|
|
16
16
|
retrieve(id: string, options?: RequestOptions): APIPromise<Shared.CourseLessonInteraction>;
|
|
17
17
|
/**
|
|
@@ -19,8 +19,8 @@ export declare class CourseLessonInteractions extends APIResource {
|
|
|
19
19
|
*
|
|
20
20
|
* Required permissions:
|
|
21
21
|
*
|
|
22
|
-
* - `course_lesson_interaction:read`
|
|
23
22
|
* - `courses:read`
|
|
23
|
+
* - `course_analytics:read`
|
|
24
24
|
*/
|
|
25
25
|
list(query?: CourseLessonInteractionListParams | null | undefined, options?: RequestOptions): PagePromise<CourseLessonInteractionListItemsCursorPage, Shared.CourseLessonInteractionListItem>;
|
|
26
26
|
}
|
|
@@ -11,8 +11,8 @@ class CourseLessonInteractions extends resource_1.APIResource {
|
|
|
11
11
|
*
|
|
12
12
|
* Required permissions:
|
|
13
13
|
*
|
|
14
|
-
* - `course_lesson_interaction:read`
|
|
15
14
|
* - `courses:read`
|
|
15
|
+
* - `course_analytics:read`
|
|
16
16
|
*/
|
|
17
17
|
retrieve(id, options) {
|
|
18
18
|
return this._client.get((0, path_1.path) `/course_lesson_interactions/${id}`, options);
|
|
@@ -22,8 +22,8 @@ class CourseLessonInteractions extends resource_1.APIResource {
|
|
|
22
22
|
*
|
|
23
23
|
* Required permissions:
|
|
24
24
|
*
|
|
25
|
-
* - `course_lesson_interaction:read`
|
|
26
25
|
* - `courses:read`
|
|
26
|
+
* - `course_analytics:read`
|
|
27
27
|
*/
|
|
28
28
|
list(query = {}, options) {
|
|
29
29
|
return this._client.getAPIList('/course_lesson_interactions', (pagination_1.CursorPage), { query, ...options });
|
|
@@ -8,8 +8,8 @@ export class CourseLessonInteractions extends APIResource {
|
|
|
8
8
|
*
|
|
9
9
|
* Required permissions:
|
|
10
10
|
*
|
|
11
|
-
* - `course_lesson_interaction:read`
|
|
12
11
|
* - `courses:read`
|
|
12
|
+
* - `course_analytics:read`
|
|
13
13
|
*/
|
|
14
14
|
retrieve(id, options) {
|
|
15
15
|
return this._client.get(path `/course_lesson_interactions/${id}`, options);
|
|
@@ -19,8 +19,8 @@ export class CourseLessonInteractions extends APIResource {
|
|
|
19
19
|
*
|
|
20
20
|
* Required permissions:
|
|
21
21
|
*
|
|
22
|
-
* - `course_lesson_interaction:read`
|
|
23
22
|
* - `courses:read`
|
|
23
|
+
* - `course_analytics:read`
|
|
24
24
|
*/
|
|
25
25
|
list(query = {}, options) {
|
|
26
26
|
return this._client.getAPIList('/course_lesson_interactions', (CursorPage), { query, ...options });
|