@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.
Files changed (196) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/client.d.mts +30 -12
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +30 -12
  5. package/client.d.ts.map +1 -1
  6. package/client.js +19 -1
  7. package/client.js.map +1 -1
  8. package/client.mjs +21 -3
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/app-builds.d.mts +16 -13
  12. package/resources/app-builds.d.mts.map +1 -1
  13. package/resources/app-builds.d.ts +16 -13
  14. package/resources/app-builds.d.ts.map +1 -1
  15. package/resources/app-builds.js +1 -1
  16. package/resources/app-builds.mjs +1 -1
  17. package/resources/apps.d.mts +15 -10
  18. package/resources/apps.d.mts.map +1 -1
  19. package/resources/apps.d.ts +15 -10
  20. package/resources/apps.d.ts.map +1 -1
  21. package/resources/checkout-configurations.d.mts +252 -140
  22. package/resources/checkout-configurations.d.mts.map +1 -1
  23. package/resources/checkout-configurations.d.ts +252 -140
  24. package/resources/checkout-configurations.d.ts.map +1 -1
  25. package/resources/checkout-configurations.js +6 -20
  26. package/resources/checkout-configurations.js.map +1 -1
  27. package/resources/checkout-configurations.mjs +6 -20
  28. package/resources/checkout-configurations.mjs.map +1 -1
  29. package/resources/companies.d.mts +157 -0
  30. package/resources/companies.d.mts.map +1 -1
  31. package/resources/companies.d.ts +157 -0
  32. package/resources/companies.d.ts.map +1 -1
  33. package/resources/companies.js +22 -0
  34. package/resources/companies.js.map +1 -1
  35. package/resources/companies.mjs +22 -0
  36. package/resources/companies.mjs.map +1 -1
  37. package/resources/course-chapters.d.mts +185 -0
  38. package/resources/course-chapters.d.mts.map +1 -0
  39. package/resources/course-chapters.d.ts +185 -0
  40. package/resources/course-chapters.d.ts.map +1 -0
  41. package/resources/course-chapters.js +103 -0
  42. package/resources/course-chapters.js.map +1 -0
  43. package/resources/course-chapters.mjs +99 -0
  44. package/resources/course-chapters.mjs.map +1 -0
  45. package/resources/course-lesson-interactions.d.mts +2 -2
  46. package/resources/course-lesson-interactions.d.ts +2 -2
  47. package/resources/course-lesson-interactions.js +2 -2
  48. package/resources/course-lesson-interactions.mjs +2 -2
  49. package/resources/course-lessons.d.mts +563 -0
  50. package/resources/course-lessons.d.mts.map +1 -0
  51. package/resources/course-lessons.d.ts +563 -0
  52. package/resources/course-lessons.d.ts.map +1 -0
  53. package/resources/course-lessons.js +101 -0
  54. package/resources/course-lessons.js.map +1 -0
  55. package/resources/course-lessons.mjs +97 -0
  56. package/resources/course-lessons.mjs.map +1 -0
  57. package/resources/course-students.d.mts +187 -0
  58. package/resources/course-students.d.mts.map +1 -0
  59. package/resources/course-students.d.ts +187 -0
  60. package/resources/course-students.d.ts.map +1 -0
  61. package/resources/course-students.js +36 -0
  62. package/resources/course-students.js.map +1 -0
  63. package/resources/course-students.mjs +32 -0
  64. package/resources/course-students.mjs.map +1 -0
  65. package/resources/courses.d.mts +485 -0
  66. package/resources/courses.d.mts.map +1 -0
  67. package/resources/courses.d.ts +485 -0
  68. package/resources/courses.d.ts.map +1 -0
  69. package/resources/courses.js +98 -0
  70. package/resources/courses.js.map +1 -0
  71. package/resources/courses.mjs +94 -0
  72. package/resources/courses.mjs.map +1 -0
  73. package/resources/experiences.d.mts +42 -11
  74. package/resources/experiences.d.mts.map +1 -1
  75. package/resources/experiences.d.ts +42 -11
  76. package/resources/experiences.d.ts.map +1 -1
  77. package/resources/experiences.js +22 -0
  78. package/resources/experiences.js.map +1 -1
  79. package/resources/experiences.mjs +22 -0
  80. package/resources/experiences.mjs.map +1 -1
  81. package/resources/forum-posts.d.mts +75 -10
  82. package/resources/forum-posts.d.mts.map +1 -1
  83. package/resources/forum-posts.d.ts +75 -10
  84. package/resources/forum-posts.d.ts.map +1 -1
  85. package/resources/forum-posts.js +11 -0
  86. package/resources/forum-posts.js.map +1 -1
  87. package/resources/forum-posts.mjs +11 -0
  88. package/resources/forum-posts.mjs.map +1 -1
  89. package/resources/index.d.mts +12 -6
  90. package/resources/index.d.mts.map +1 -1
  91. package/resources/index.d.ts +12 -6
  92. package/resources/index.d.ts.map +1 -1
  93. package/resources/index.js +13 -1
  94. package/resources/index.js.map +1 -1
  95. package/resources/index.mjs +7 -1
  96. package/resources/index.mjs.map +1 -1
  97. package/resources/invoices.d.mts +529 -146
  98. package/resources/invoices.d.mts.map +1 -1
  99. package/resources/invoices.d.ts +529 -146
  100. package/resources/invoices.d.ts.map +1 -1
  101. package/resources/invoices.js +2 -24
  102. package/resources/invoices.js.map +1 -1
  103. package/resources/invoices.mjs +2 -24
  104. package/resources/invoices.mjs.map +1 -1
  105. package/resources/ledger-accounts.d.mts +1 -1
  106. package/resources/ledger-accounts.d.mts.map +1 -1
  107. package/resources/ledger-accounts.d.ts +1 -1
  108. package/resources/ledger-accounts.d.ts.map +1 -1
  109. package/resources/members.d.mts +4 -0
  110. package/resources/members.d.mts.map +1 -1
  111. package/resources/members.d.ts +4 -0
  112. package/resources/members.d.ts.map +1 -1
  113. package/resources/memberships.d.mts +26 -5
  114. package/resources/memberships.d.mts.map +1 -1
  115. package/resources/memberships.d.ts +26 -5
  116. package/resources/memberships.d.ts.map +1 -1
  117. package/resources/memberships.js +1 -1
  118. package/resources/memberships.js.map +1 -1
  119. package/resources/memberships.mjs +1 -1
  120. package/resources/memberships.mjs.map +1 -1
  121. package/resources/messages.d.mts +57 -10
  122. package/resources/messages.d.mts.map +1 -1
  123. package/resources/messages.d.ts +57 -10
  124. package/resources/messages.d.ts.map +1 -1
  125. package/resources/messages.js +6 -0
  126. package/resources/messages.js.map +1 -1
  127. package/resources/messages.mjs +6 -0
  128. package/resources/messages.mjs.map +1 -1
  129. package/resources/payments.d.mts +35 -13
  130. package/resources/payments.d.mts.map +1 -1
  131. package/resources/payments.d.ts +35 -13
  132. package/resources/payments.d.ts.map +1 -1
  133. package/resources/plans.d.mts +161 -17
  134. package/resources/plans.d.mts.map +1 -1
  135. package/resources/plans.d.ts +161 -17
  136. package/resources/plans.d.ts.map +1 -1
  137. package/resources/plans.js.map +1 -1
  138. package/resources/plans.mjs.map +1 -1
  139. package/resources/products.d.mts +30 -33
  140. package/resources/products.d.mts.map +1 -1
  141. package/resources/products.d.ts +30 -33
  142. package/resources/products.d.ts.map +1 -1
  143. package/resources/promo-codes.d.mts +394 -0
  144. package/resources/promo-codes.d.mts.map +1 -0
  145. package/resources/promo-codes.d.ts +394 -0
  146. package/resources/promo-codes.d.ts.map +1 -0
  147. package/resources/promo-codes.js +91 -0
  148. package/resources/promo-codes.js.map +1 -0
  149. package/resources/promo-codes.mjs +87 -0
  150. package/resources/promo-codes.mjs.map +1 -0
  151. package/resources/reviews.d.mts +277 -0
  152. package/resources/reviews.d.mts.map +1 -0
  153. package/resources/reviews.d.ts +277 -0
  154. package/resources/reviews.d.ts.map +1 -0
  155. package/resources/reviews.js +23 -0
  156. package/resources/reviews.js.map +1 -0
  157. package/resources/reviews.mjs +19 -0
  158. package/resources/reviews.mjs.map +1 -0
  159. package/resources/shared.d.mts +117 -14
  160. package/resources/shared.d.mts.map +1 -1
  161. package/resources/shared.d.ts +117 -14
  162. package/resources/shared.d.ts.map +1 -1
  163. package/resources/transfers.d.mts +12 -0
  164. package/resources/transfers.d.mts.map +1 -1
  165. package/resources/transfers.d.ts +12 -0
  166. package/resources/transfers.d.ts.map +1 -1
  167. package/src/client.ts +166 -11
  168. package/src/resources/app-builds.ts +19 -14
  169. package/src/resources/apps.ts +16 -11
  170. package/src/resources/checkout-configurations.ts +278 -143
  171. package/src/resources/companies.ts +196 -0
  172. package/src/resources/course-chapters.ts +236 -0
  173. package/src/resources/course-lesson-interactions.ts +2 -2
  174. package/src/resources/course-lessons.ts +699 -0
  175. package/src/resources/course-students.ts +238 -0
  176. package/src/resources/courses.ts +622 -0
  177. package/src/resources/experiences.ts +54 -11
  178. package/src/resources/forum-posts.ts +95 -10
  179. package/src/resources/index.ts +73 -2
  180. package/src/resources/invoices.ts +620 -149
  181. package/src/resources/ledger-accounts.ts +13 -1
  182. package/src/resources/members.ts +5 -0
  183. package/src/resources/memberships.ts +31 -6
  184. package/src/resources/messages.ts +74 -10
  185. package/src/resources/payments.ts +146 -19
  186. package/src/resources/plans.ts +184 -17
  187. package/src/resources/products.ts +36 -37
  188. package/src/resources/promo-codes.ts +490 -0
  189. package/src/resources/reviews.ts +348 -0
  190. package/src/resources/shared.ts +128 -14
  191. package/src/resources/transfers.ts +10 -0
  192. package/src/version.ts +1 -1
  193. package/version.d.mts +1 -1
  194. package/version.d.ts +1 -1
  195. package/version.js +1 -1
  196. package/version.mjs +1 -1
@@ -0,0 +1,97 @@
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 CourseLessons extends APIResource {
6
+ /**
7
+ * Creates a new course lesson
8
+ *
9
+ * Required permissions:
10
+ *
11
+ * - `courses:update`
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * const lesson = await client.courseLessons.create({
16
+ * chapter_id: 'chap_xxxxxxxxxxxxx',
17
+ * lesson_type: 'text',
18
+ * });
19
+ * ```
20
+ */
21
+ create(body, options) {
22
+ return this._client.post('/course_lessons', { body, ...options });
23
+ }
24
+ /**
25
+ * Retrieves a course lesson by ID
26
+ *
27
+ * Required permissions:
28
+ *
29
+ * - `courses:read`
30
+ *
31
+ * @example
32
+ * ```ts
33
+ * const lesson = await client.courseLessons.retrieve(
34
+ * 'lesn_xxxxxxxxxxxxx',
35
+ * );
36
+ * ```
37
+ */
38
+ retrieve(id, options) {
39
+ return this._client.get(path `/course_lessons/${id}`, options);
40
+ }
41
+ /**
42
+ * Updates a course lesson
43
+ *
44
+ * Required permissions:
45
+ *
46
+ * - `courses:update`
47
+ *
48
+ * @example
49
+ * ```ts
50
+ * const lesson = await client.courseLessons.update(
51
+ * 'lesn_xxxxxxxxxxxxx',
52
+ * );
53
+ * ```
54
+ */
55
+ update(id, body = {}, options) {
56
+ return this._client.patch(path `/course_lessons/${id}`, { body, ...options });
57
+ }
58
+ /**
59
+ * Lists lessons for a course or chapter
60
+ *
61
+ * Required permissions:
62
+ *
63
+ * - `courses:read`
64
+ *
65
+ * @example
66
+ * ```ts
67
+ * // Automatically fetches more pages as needed.
68
+ * for await (const courseLessonListResponse of client.courseLessons.list()) {
69
+ * // ...
70
+ * }
71
+ * ```
72
+ */
73
+ list(query = {}, options) {
74
+ return this._client.getAPIList('/course_lessons', (CursorPage), {
75
+ query,
76
+ ...options,
77
+ });
78
+ }
79
+ /**
80
+ * Deletes a course lesson
81
+ *
82
+ * Required permissions:
83
+ *
84
+ * - `courses:update`
85
+ *
86
+ * @example
87
+ * ```ts
88
+ * const courseLesson = await client.courseLessons.delete(
89
+ * 'lesn_xxxxxxxxxxxxx',
90
+ * );
91
+ * ```
92
+ */
93
+ delete(id, options) {
94
+ return this._client.delete(path `/course_lessons/${id}`, options);
95
+ }
96
+ }
97
+ //# sourceMappingURL=course-lessons.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-lessons.mjs","sourceRoot":"","sources":["../src/resources/course-lessons.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,aAAc,SAAQ,WAAW;IAC5C;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,IAA8B,EAAE,OAAwB;QAC7D,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,iBAAiB,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,mBAAmB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAChE,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,MAAM,CACJ,EAAU,EACV,OAAoD,EAAE,EACtD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,IAAI,CAAA,mBAAmB,EAAE,EAAE,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC/E,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,IAAI,CACF,QAAmD,EAAE,EACrD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,iBAAiB,EAAE,CAAA,UAAoC,CAAA,EAAE;YACtF,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,mBAAmB,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACnE,CAAC;CACF"}
@@ -0,0 +1,187 @@
1
+ import { APIResource } from "../core/resource.mjs";
2
+ import { APIPromise } from "../core/api-promise.mjs";
3
+ import { CursorPage, type CursorPageParams, PagePromise } from "../core/pagination.mjs";
4
+ import { RequestOptions } from "../internal/request-options.mjs";
5
+ export declare class CourseStudents extends APIResource {
6
+ /**
7
+ * Retrieves a course student by interaction ID
8
+ *
9
+ * Required permissions:
10
+ *
11
+ * - `courses:read`
12
+ * - `course_analytics:read`
13
+ */
14
+ retrieve(id: string, options?: RequestOptions): APIPromise<CourseStudentRetrieveResponse>;
15
+ /**
16
+ * Lists students for a course
17
+ *
18
+ * Required permissions:
19
+ *
20
+ * - `courses:read`
21
+ * - `course_analytics:read`
22
+ */
23
+ list(query: CourseStudentListParams, options?: RequestOptions): PagePromise<CourseStudentListResponsesCursorPage, CourseStudentListResponse>;
24
+ }
25
+ export type CourseStudentListResponsesCursorPage = CursorPage<CourseStudentListResponse>;
26
+ /**
27
+ * A course student (enrollment of a student in a course)
28
+ */
29
+ export interface CourseStudentRetrieveResponse {
30
+ /**
31
+ * The ID of the course student. Looks like crsi_XXX
32
+ */
33
+ id: string;
34
+ /**
35
+ * The number of lessons the student has completed
36
+ */
37
+ completed_lessons_count: number;
38
+ /**
39
+ * The percentage of lessons completed (0-100)
40
+ */
41
+ completion_rate: number;
42
+ /**
43
+ * The course the student is enrolled in
44
+ */
45
+ course: CourseStudentRetrieveResponse.Course;
46
+ /**
47
+ * When the student first interacted with the course
48
+ */
49
+ first_interaction_at: string;
50
+ /**
51
+ * When the student last interacted with the course
52
+ */
53
+ last_interaction_at: string;
54
+ /**
55
+ * The total number of lessons the student has access to
56
+ */
57
+ total_lessons_count: number;
58
+ /**
59
+ * The user who is enrolled in the course
60
+ */
61
+ user: CourseStudentRetrieveResponse.User;
62
+ }
63
+ export declare namespace CourseStudentRetrieveResponse {
64
+ /**
65
+ * The course the student is enrolled in
66
+ */
67
+ interface Course {
68
+ /**
69
+ * The ID of the course. Looks like cors_XXX
70
+ */
71
+ id: string;
72
+ /**
73
+ * The experience that the course belongs to
74
+ */
75
+ experience: Course.Experience;
76
+ /**
77
+ * The title of the course
78
+ */
79
+ title: string | null;
80
+ }
81
+ namespace Course {
82
+ /**
83
+ * The experience that the course belongs to
84
+ */
85
+ interface Experience {
86
+ /**
87
+ * The unique ID representing this experience
88
+ */
89
+ id: string;
90
+ }
91
+ }
92
+ /**
93
+ * The user who is enrolled in the course
94
+ */
95
+ interface User {
96
+ /**
97
+ * The internal ID of the user.
98
+ */
99
+ id: string;
100
+ /**
101
+ * The name of the user from their Whop account.
102
+ */
103
+ name: string | null;
104
+ /**
105
+ * The username of the user from their Whop account.
106
+ */
107
+ username: string;
108
+ }
109
+ }
110
+ /**
111
+ * A course student (enrollment of a student in a course)
112
+ */
113
+ export interface CourseStudentListResponse {
114
+ /**
115
+ * The ID of the course student. Looks like crsi_XXX
116
+ */
117
+ id: string;
118
+ /**
119
+ * The number of lessons the student has completed
120
+ */
121
+ completed_lessons_count: number;
122
+ /**
123
+ * The percentage of lessons completed (0-100)
124
+ */
125
+ completion_rate: number;
126
+ /**
127
+ * When the student first interacted with the course
128
+ */
129
+ first_interaction_at: string;
130
+ /**
131
+ * When the student last interacted with the course
132
+ */
133
+ last_interaction_at: string;
134
+ /**
135
+ * The total number of lessons the student has access to
136
+ */
137
+ total_lessons_count: number;
138
+ /**
139
+ * The user who is enrolled in the course
140
+ */
141
+ user: CourseStudentListResponse.User;
142
+ }
143
+ export declare namespace CourseStudentListResponse {
144
+ /**
145
+ * The user who is enrolled in the course
146
+ */
147
+ interface User {
148
+ /**
149
+ * The internal ID of the user.
150
+ */
151
+ id: string;
152
+ /**
153
+ * The name of the user from their Whop account.
154
+ */
155
+ name: string | null;
156
+ /**
157
+ * The username of the user from their Whop account.
158
+ */
159
+ username: string;
160
+ }
161
+ }
162
+ export interface CourseStudentListParams extends CursorPageParams {
163
+ /**
164
+ * The ID of the course
165
+ */
166
+ course_id: string;
167
+ /**
168
+ * Returns the elements in the list that come before the specified cursor.
169
+ */
170
+ before?: string | null;
171
+ /**
172
+ * Returns the first _n_ elements from the list.
173
+ */
174
+ first?: number | null;
175
+ /**
176
+ * Filter students by name - returns students whose names match the keyword
177
+ */
178
+ keyword?: string | null;
179
+ /**
180
+ * Returns the last _n_ elements from the list.
181
+ */
182
+ last?: number | null;
183
+ }
184
+ export declare namespace CourseStudents {
185
+ export { type CourseStudentRetrieveResponse as CourseStudentRetrieveResponse, type CourseStudentListResponse as CourseStudentListResponse, type CourseStudentListResponsesCursorPage as CourseStudentListResponsesCursorPage, type CourseStudentListParams as CourseStudentListParams, };
186
+ }
187
+ //# sourceMappingURL=course-students.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-students.d.mts","sourceRoot":"","sources":["../src/resources/course-students.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,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AAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
@@ -0,0 +1,187 @@
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 CourseStudents extends APIResource {
6
+ /**
7
+ * Retrieves a course student by interaction ID
8
+ *
9
+ * Required permissions:
10
+ *
11
+ * - `courses:read`
12
+ * - `course_analytics:read`
13
+ */
14
+ retrieve(id: string, options?: RequestOptions): APIPromise<CourseStudentRetrieveResponse>;
15
+ /**
16
+ * Lists students for a course
17
+ *
18
+ * Required permissions:
19
+ *
20
+ * - `courses:read`
21
+ * - `course_analytics:read`
22
+ */
23
+ list(query: CourseStudentListParams, options?: RequestOptions): PagePromise<CourseStudentListResponsesCursorPage, CourseStudentListResponse>;
24
+ }
25
+ export type CourseStudentListResponsesCursorPage = CursorPage<CourseStudentListResponse>;
26
+ /**
27
+ * A course student (enrollment of a student in a course)
28
+ */
29
+ export interface CourseStudentRetrieveResponse {
30
+ /**
31
+ * The ID of the course student. Looks like crsi_XXX
32
+ */
33
+ id: string;
34
+ /**
35
+ * The number of lessons the student has completed
36
+ */
37
+ completed_lessons_count: number;
38
+ /**
39
+ * The percentage of lessons completed (0-100)
40
+ */
41
+ completion_rate: number;
42
+ /**
43
+ * The course the student is enrolled in
44
+ */
45
+ course: CourseStudentRetrieveResponse.Course;
46
+ /**
47
+ * When the student first interacted with the course
48
+ */
49
+ first_interaction_at: string;
50
+ /**
51
+ * When the student last interacted with the course
52
+ */
53
+ last_interaction_at: string;
54
+ /**
55
+ * The total number of lessons the student has access to
56
+ */
57
+ total_lessons_count: number;
58
+ /**
59
+ * The user who is enrolled in the course
60
+ */
61
+ user: CourseStudentRetrieveResponse.User;
62
+ }
63
+ export declare namespace CourseStudentRetrieveResponse {
64
+ /**
65
+ * The course the student is enrolled in
66
+ */
67
+ interface Course {
68
+ /**
69
+ * The ID of the course. Looks like cors_XXX
70
+ */
71
+ id: string;
72
+ /**
73
+ * The experience that the course belongs to
74
+ */
75
+ experience: Course.Experience;
76
+ /**
77
+ * The title of the course
78
+ */
79
+ title: string | null;
80
+ }
81
+ namespace Course {
82
+ /**
83
+ * The experience that the course belongs to
84
+ */
85
+ interface Experience {
86
+ /**
87
+ * The unique ID representing this experience
88
+ */
89
+ id: string;
90
+ }
91
+ }
92
+ /**
93
+ * The user who is enrolled in the course
94
+ */
95
+ interface User {
96
+ /**
97
+ * The internal ID of the user.
98
+ */
99
+ id: string;
100
+ /**
101
+ * The name of the user from their Whop account.
102
+ */
103
+ name: string | null;
104
+ /**
105
+ * The username of the user from their Whop account.
106
+ */
107
+ username: string;
108
+ }
109
+ }
110
+ /**
111
+ * A course student (enrollment of a student in a course)
112
+ */
113
+ export interface CourseStudentListResponse {
114
+ /**
115
+ * The ID of the course student. Looks like crsi_XXX
116
+ */
117
+ id: string;
118
+ /**
119
+ * The number of lessons the student has completed
120
+ */
121
+ completed_lessons_count: number;
122
+ /**
123
+ * The percentage of lessons completed (0-100)
124
+ */
125
+ completion_rate: number;
126
+ /**
127
+ * When the student first interacted with the course
128
+ */
129
+ first_interaction_at: string;
130
+ /**
131
+ * When the student last interacted with the course
132
+ */
133
+ last_interaction_at: string;
134
+ /**
135
+ * The total number of lessons the student has access to
136
+ */
137
+ total_lessons_count: number;
138
+ /**
139
+ * The user who is enrolled in the course
140
+ */
141
+ user: CourseStudentListResponse.User;
142
+ }
143
+ export declare namespace CourseStudentListResponse {
144
+ /**
145
+ * The user who is enrolled in the course
146
+ */
147
+ interface User {
148
+ /**
149
+ * The internal ID of the user.
150
+ */
151
+ id: string;
152
+ /**
153
+ * The name of the user from their Whop account.
154
+ */
155
+ name: string | null;
156
+ /**
157
+ * The username of the user from their Whop account.
158
+ */
159
+ username: string;
160
+ }
161
+ }
162
+ export interface CourseStudentListParams extends CursorPageParams {
163
+ /**
164
+ * The ID of the course
165
+ */
166
+ course_id: string;
167
+ /**
168
+ * Returns the elements in the list that come before the specified cursor.
169
+ */
170
+ before?: string | null;
171
+ /**
172
+ * Returns the first _n_ elements from the list.
173
+ */
174
+ first?: number | null;
175
+ /**
176
+ * Filter students by name - returns students whose names match the keyword
177
+ */
178
+ keyword?: string | null;
179
+ /**
180
+ * Returns the last _n_ elements from the list.
181
+ */
182
+ last?: number | null;
183
+ }
184
+ export declare namespace CourseStudents {
185
+ export { type CourseStudentRetrieveResponse as CourseStudentRetrieveResponse, type CourseStudentListResponse as CourseStudentListResponse, type CourseStudentListResponsesCursorPage as CourseStudentListResponsesCursorPage, type CourseStudentListParams as CourseStudentListParams, };
186
+ }
187
+ //# sourceMappingURL=course-students.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-students.d.ts","sourceRoot":"","sources":["../src/resources/course-students.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,cAAe,SAAQ,WAAW;IAC7C;;;;;;;OAOG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,6BAA6B,CAAC;IAIzF;;;;;;;OAOG;IACH,IAAI,CACF,KAAK,EAAE,uBAAuB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,oCAAoC,EAAE,yBAAyB,CAAC;CAMhF;AAED,MAAM,MAAM,oCAAoC,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;AAEzF;;GAEG;AACH,MAAM,WAAW,6BAA6B;IAC5C;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,uBAAuB,EAAE,MAAM,CAAC;IAEhC;;OAEG;IACH,eAAe,EAAE,MAAM,CAAC;IAExB;;OAEG;IACH,MAAM,EAAE,6BAA6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M,GAAG,IAAI,CAAC;QAEpB;;WAEG;QACH,QAAQ,EAAE,MAAM,CAAC;KAClB;CACF;AAED,MAAM,WAAW,uBAAwB,SAAQ,gBAAgB;IAC/D;;OAEG;IACH,SAAS,EAAE,MAAM,CAAC;IAElB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAExB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,6BAA6B,IAAI,6BAA6B,EACnE,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
@@ -0,0 +1,36 @@
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.CourseStudents = 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 CourseStudents extends resource_1.APIResource {
9
+ /**
10
+ * Retrieves a course student by interaction ID
11
+ *
12
+ * Required permissions:
13
+ *
14
+ * - `courses:read`
15
+ * - `course_analytics:read`
16
+ */
17
+ retrieve(id, options) {
18
+ return this._client.get((0, path_1.path) `/course_students/${id}`, options);
19
+ }
20
+ /**
21
+ * Lists students for a course
22
+ *
23
+ * Required permissions:
24
+ *
25
+ * - `courses:read`
26
+ * - `course_analytics:read`
27
+ */
28
+ list(query, options) {
29
+ return this._client.getAPIList('/course_students', (pagination_1.CursorPage), {
30
+ query,
31
+ ...options,
32
+ });
33
+ }
34
+ }
35
+ exports.CourseStudents = CourseStudents;
36
+ //# sourceMappingURL=course-students.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-students.js","sourceRoot":"","sources":["../src/resources/course-students.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAE/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,cAAe,SAAQ,sBAAW;IAC7C;;;;;;;OAOG;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;;;;;;;OAOG;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;CACF;AA9BD,wCA8BC"}
@@ -0,0 +1,32 @@
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 CourseStudents extends APIResource {
6
+ /**
7
+ * Retrieves a course student by interaction ID
8
+ *
9
+ * Required permissions:
10
+ *
11
+ * - `courses:read`
12
+ * - `course_analytics:read`
13
+ */
14
+ retrieve(id, options) {
15
+ return this._client.get(path `/course_students/${id}`, options);
16
+ }
17
+ /**
18
+ * Lists students for a course
19
+ *
20
+ * Required permissions:
21
+ *
22
+ * - `courses:read`
23
+ * - `course_analytics:read`
24
+ */
25
+ list(query, options) {
26
+ return this._client.getAPIList('/course_students', (CursorPage), {
27
+ query,
28
+ ...options,
29
+ });
30
+ }
31
+ }
32
+ //# sourceMappingURL=course-students.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"course-students.mjs","sourceRoot":"","sources":["../src/resources/course-students.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;;;;;;;OAOG;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;;;;;;;OAOG;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;CACF"}