@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
|
@@ -3,10 +3,23 @@
|
|
|
3
3
|
import { APIResource } from '../core/resource';
|
|
4
4
|
import * as Shared from './shared';
|
|
5
5
|
import { APIPromise } from '../core/api-promise';
|
|
6
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
|
|
6
7
|
import { RequestOptions } from '../internal/request-options';
|
|
7
8
|
import { path } from '../internal/utils/path';
|
|
8
9
|
|
|
9
10
|
export class Companies extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Create a new sub company for your platform
|
|
13
|
+
*
|
|
14
|
+
* Required permissions:
|
|
15
|
+
*
|
|
16
|
+
* - `company:create_child`
|
|
17
|
+
* - `company:basic:read`
|
|
18
|
+
*/
|
|
19
|
+
create(body: CompanyCreateParams, options?: RequestOptions): APIPromise<Shared.Company> {
|
|
20
|
+
return this._client.post('/companies', { body, ...options });
|
|
21
|
+
}
|
|
22
|
+
|
|
10
23
|
/**
|
|
11
24
|
* Retrieves an company by ID or its url route
|
|
12
25
|
*
|
|
@@ -17,4 +30,187 @@ export class Companies extends APIResource {
|
|
|
17
30
|
retrieve(id: string, options?: RequestOptions): APIPromise<Shared.Company> {
|
|
18
31
|
return this._client.get(path`/companies/${id}`, options);
|
|
19
32
|
}
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Lists companies the current user has access to
|
|
36
|
+
*
|
|
37
|
+
* Required permissions:
|
|
38
|
+
*
|
|
39
|
+
* - `company:basic:read`
|
|
40
|
+
*/
|
|
41
|
+
list(
|
|
42
|
+
query: CompanyListParams,
|
|
43
|
+
options?: RequestOptions,
|
|
44
|
+
): PagePromise<CompanyListResponsesCursorPage, CompanyListResponse> {
|
|
45
|
+
return this._client.getAPIList('/companies', CursorPage<CompanyListResponse>, { query, ...options });
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export type CompanyListResponsesCursorPage = CursorPage<CompanyListResponse>;
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* An object representing a (sanitized) company.
|
|
53
|
+
*/
|
|
54
|
+
export interface CompanyListResponse {
|
|
55
|
+
/**
|
|
56
|
+
* The ID (tag) of the company.
|
|
57
|
+
*/
|
|
58
|
+
id: string;
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The different business types a company can be.
|
|
62
|
+
*/
|
|
63
|
+
business_type: Shared.BusinessTypes | null;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* When the company was created (signed up)
|
|
67
|
+
*/
|
|
68
|
+
created_at: string;
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* The creator pitch for the company.
|
|
72
|
+
*/
|
|
73
|
+
description: string | null;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The different industry types a company can be in.
|
|
77
|
+
*/
|
|
78
|
+
industry_type: Shared.IndustryTypes | null;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The company's logo.
|
|
82
|
+
*/
|
|
83
|
+
logo: CompanyListResponse.Logo | null;
|
|
84
|
+
|
|
85
|
+
/**
|
|
86
|
+
* The number of members in the company.
|
|
87
|
+
*/
|
|
88
|
+
member_count: number;
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* A key-value store of data for the account, created/updated by the platform that
|
|
92
|
+
* made the account.
|
|
93
|
+
*/
|
|
94
|
+
metadata: { [key: string]: unknown } | null;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* The user who owns this company
|
|
98
|
+
*/
|
|
99
|
+
owner_user: CompanyListResponse.OwnerUser;
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* The number of reviews that have been published for the company.
|
|
103
|
+
*/
|
|
104
|
+
published_reviews_count: number;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The slug/route of the company on the Whop site.
|
|
108
|
+
*/
|
|
109
|
+
route: string;
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* The title of the company.
|
|
113
|
+
*/
|
|
114
|
+
title: string;
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* The time the company was last updated.
|
|
118
|
+
*/
|
|
119
|
+
updated_at: string;
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* If the company is Whop Verified
|
|
123
|
+
*/
|
|
124
|
+
verified: boolean;
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export namespace CompanyListResponse {
|
|
128
|
+
/**
|
|
129
|
+
* The company's logo.
|
|
130
|
+
*/
|
|
131
|
+
export interface Logo {
|
|
132
|
+
/**
|
|
133
|
+
* This is the URL you use to render optimized attachments on the client. This
|
|
134
|
+
* should be used for apps.
|
|
135
|
+
*/
|
|
136
|
+
url: string | null;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* The user who owns this company
|
|
141
|
+
*/
|
|
142
|
+
export interface OwnerUser {
|
|
143
|
+
/**
|
|
144
|
+
* The internal ID of the user.
|
|
145
|
+
*/
|
|
146
|
+
id: string;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The name of the user from their Whop account.
|
|
150
|
+
*/
|
|
151
|
+
name: string | null;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* The username of the user from their Whop account.
|
|
155
|
+
*/
|
|
156
|
+
username: string;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export interface CompanyCreateParams {
|
|
161
|
+
/**
|
|
162
|
+
* The email of the user who the company will belong to.
|
|
163
|
+
*/
|
|
164
|
+
email: string;
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* The company ID of the platform creating this company.
|
|
168
|
+
*/
|
|
169
|
+
parent_company_id: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* The name of the company being created.
|
|
173
|
+
*/
|
|
174
|
+
title: string;
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Additional metadata for the account
|
|
178
|
+
*/
|
|
179
|
+
metadata?: { [key: string]: unknown } | null;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
export interface CompanyListParams extends CursorPageParams {
|
|
183
|
+
/**
|
|
184
|
+
* The ID of the parent company to list sub companies for
|
|
185
|
+
*/
|
|
186
|
+
parent_company_id: string;
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Returns the elements in the list that come before the specified cursor.
|
|
190
|
+
*/
|
|
191
|
+
before?: string | null;
|
|
192
|
+
|
|
193
|
+
/**
|
|
194
|
+
* The direction of the sort.
|
|
195
|
+
*/
|
|
196
|
+
direction?: Shared.Direction | null;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Returns the first _n_ elements from the list.
|
|
200
|
+
*/
|
|
201
|
+
first?: number | null;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Returns the last _n_ elements from the list.
|
|
205
|
+
*/
|
|
206
|
+
last?: number | null;
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
export declare namespace Companies {
|
|
210
|
+
export {
|
|
211
|
+
type CompanyListResponse as CompanyListResponse,
|
|
212
|
+
type CompanyListResponsesCursorPage as CompanyListResponsesCursorPage,
|
|
213
|
+
type CompanyCreateParams as CompanyCreateParams,
|
|
214
|
+
type CompanyListParams as CompanyListParams,
|
|
215
|
+
};
|
|
20
216
|
}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../core/resource';
|
|
4
|
+
import { APIPromise } from '../core/api-promise';
|
|
5
|
+
import { CursorPage, type CursorPageParams, PagePromise } from '../core/pagination';
|
|
6
|
+
import { RequestOptions } from '../internal/request-options';
|
|
7
|
+
import { path } from '../internal/utils/path';
|
|
8
|
+
|
|
9
|
+
export class CourseChapters extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* Creates a new course chapter
|
|
12
|
+
*
|
|
13
|
+
* Required permissions:
|
|
14
|
+
*
|
|
15
|
+
* - `courses:update`
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const courseChapter = await client.courseChapters.create({
|
|
20
|
+
* course_id: 'cors_xxxxxxxxxxxxx',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*/
|
|
24
|
+
create(body: CourseChapterCreateParams, options?: RequestOptions): APIPromise<CourseChapter> {
|
|
25
|
+
return this._client.post('/course_chapters', { body, ...options });
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Retrieves a course chapter by ID
|
|
30
|
+
*
|
|
31
|
+
* Required permissions:
|
|
32
|
+
*
|
|
33
|
+
* - `courses:read`
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const courseChapter = await client.courseChapters.retrieve(
|
|
38
|
+
* 'chap_xxxxxxxxxxxxx',
|
|
39
|
+
* );
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<CourseChapter> {
|
|
43
|
+
return this._client.get(path`/course_chapters/${id}`, options);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* Updates a course chapter
|
|
48
|
+
*
|
|
49
|
+
* Required permissions:
|
|
50
|
+
*
|
|
51
|
+
* - `courses:update`
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const courseChapter = await client.courseChapters.update(
|
|
56
|
+
* 'chap_xxxxxxxxxxxxx',
|
|
57
|
+
* { title: 'title' },
|
|
58
|
+
* );
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
update(id: string, body: CourseChapterUpdateParams, options?: RequestOptions): APIPromise<CourseChapter> {
|
|
62
|
+
return this._client.patch(path`/course_chapters/${id}`, { body, ...options });
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Lists chapters for a course
|
|
67
|
+
*
|
|
68
|
+
* Required permissions:
|
|
69
|
+
*
|
|
70
|
+
* - `courses:read`
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* // Automatically fetches more pages as needed.
|
|
75
|
+
* for await (const courseChapterListResponse of client.courseChapters.list(
|
|
76
|
+
* { course_id: 'cors_xxxxxxxxxxxxx' },
|
|
77
|
+
* )) {
|
|
78
|
+
* // ...
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
list(
|
|
83
|
+
query: CourseChapterListParams,
|
|
84
|
+
options?: RequestOptions,
|
|
85
|
+
): PagePromise<CourseChapterListResponsesCursorPage, CourseChapterListResponse> {
|
|
86
|
+
return this._client.getAPIList('/course_chapters', CursorPage<CourseChapterListResponse>, {
|
|
87
|
+
query,
|
|
88
|
+
...options,
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/**
|
|
93
|
+
* Deletes a course chapter
|
|
94
|
+
*
|
|
95
|
+
* Required permissions:
|
|
96
|
+
*
|
|
97
|
+
* - `courses:update`
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* const courseChapter = await client.courseChapters.delete(
|
|
102
|
+
* 'chap_xxxxxxxxxxxxx',
|
|
103
|
+
* );
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
delete(id: string, options?: RequestOptions): APIPromise<CourseChapterDeleteResponse> {
|
|
107
|
+
return this._client.delete(path`/course_chapters/${id}`, options);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
export type CourseChapterListResponsesCursorPage = CursorPage<CourseChapterListResponse>;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* A chapter from the courses app
|
|
115
|
+
*/
|
|
116
|
+
export interface CourseChapter {
|
|
117
|
+
/**
|
|
118
|
+
* The ID of the chapter. Looks like chap_XXX
|
|
119
|
+
*/
|
|
120
|
+
id: string;
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The lessons in this chapter
|
|
124
|
+
*/
|
|
125
|
+
lessons: Array<CourseChapter.Lesson>;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* The order of the chapter within its course
|
|
129
|
+
*/
|
|
130
|
+
order: number;
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* The title of the chapter
|
|
134
|
+
*/
|
|
135
|
+
title: string;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export namespace CourseChapter {
|
|
139
|
+
/**
|
|
140
|
+
* A lesson from the courses app
|
|
141
|
+
*/
|
|
142
|
+
export interface Lesson {
|
|
143
|
+
/**
|
|
144
|
+
* The ID of the lesson
|
|
145
|
+
*/
|
|
146
|
+
id: string;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* The order of the lesson within its chapter
|
|
150
|
+
*/
|
|
151
|
+
order: number;
|
|
152
|
+
|
|
153
|
+
/**
|
|
154
|
+
* The title of the lesson
|
|
155
|
+
*/
|
|
156
|
+
title: string;
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/**
|
|
161
|
+
* A chapter from the courses app
|
|
162
|
+
*/
|
|
163
|
+
export interface CourseChapterListResponse {
|
|
164
|
+
/**
|
|
165
|
+
* The ID of the chapter. Looks like chap_XXX
|
|
166
|
+
*/
|
|
167
|
+
id: string;
|
|
168
|
+
|
|
169
|
+
/**
|
|
170
|
+
* The order of the chapter within its course
|
|
171
|
+
*/
|
|
172
|
+
order: number;
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* The title of the chapter
|
|
176
|
+
*/
|
|
177
|
+
title: string;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Represents `true` or `false` values.
|
|
182
|
+
*/
|
|
183
|
+
export type CourseChapterDeleteResponse = boolean;
|
|
184
|
+
|
|
185
|
+
export interface CourseChapterCreateParams {
|
|
186
|
+
/**
|
|
187
|
+
* The ID of the course to create the chapter in
|
|
188
|
+
*/
|
|
189
|
+
course_id: string;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* The title of the chapter
|
|
193
|
+
*/
|
|
194
|
+
title?: string | null;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
export interface CourseChapterUpdateParams {
|
|
198
|
+
/**
|
|
199
|
+
* The title of the chapter
|
|
200
|
+
*/
|
|
201
|
+
title: string;
|
|
202
|
+
}
|
|
203
|
+
|
|
204
|
+
export interface CourseChapterListParams extends CursorPageParams {
|
|
205
|
+
/**
|
|
206
|
+
* The ID of the course
|
|
207
|
+
*/
|
|
208
|
+
course_id: string;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Returns the elements in the list that come before the specified cursor.
|
|
212
|
+
*/
|
|
213
|
+
before?: string | null;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Returns the first _n_ elements from the list.
|
|
217
|
+
*/
|
|
218
|
+
first?: number | null;
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Returns the last _n_ elements from the list.
|
|
222
|
+
*/
|
|
223
|
+
last?: number | null;
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
export declare namespace CourseChapters {
|
|
227
|
+
export {
|
|
228
|
+
type CourseChapter as CourseChapter,
|
|
229
|
+
type CourseChapterListResponse as CourseChapterListResponse,
|
|
230
|
+
type CourseChapterDeleteResponse as CourseChapterDeleteResponse,
|
|
231
|
+
type CourseChapterListResponsesCursorPage as CourseChapterListResponsesCursorPage,
|
|
232
|
+
type CourseChapterCreateParams as CourseChapterCreateParams,
|
|
233
|
+
type CourseChapterUpdateParams as CourseChapterUpdateParams,
|
|
234
|
+
type CourseChapterListParams as CourseChapterListParams,
|
|
235
|
+
};
|
|
236
|
+
}
|
|
@@ -14,8 +14,8 @@ export class CourseLessonInteractions extends APIResource {
|
|
|
14
14
|
*
|
|
15
15
|
* Required permissions:
|
|
16
16
|
*
|
|
17
|
-
* - `course_lesson_interaction:read`
|
|
18
17
|
* - `courses:read`
|
|
18
|
+
* - `course_analytics:read`
|
|
19
19
|
*/
|
|
20
20
|
retrieve(id: string, options?: RequestOptions): APIPromise<Shared.CourseLessonInteraction> {
|
|
21
21
|
return this._client.get(path`/course_lesson_interactions/${id}`, options);
|
|
@@ -26,8 +26,8 @@ export class CourseLessonInteractions extends APIResource {
|
|
|
26
26
|
*
|
|
27
27
|
* Required permissions:
|
|
28
28
|
*
|
|
29
|
-
* - `course_lesson_interaction:read`
|
|
30
29
|
* - `courses:read`
|
|
30
|
+
* - `course_analytics:read`
|
|
31
31
|
*/
|
|
32
32
|
list(
|
|
33
33
|
query: CourseLessonInteractionListParams | null | undefined = {},
|