@whop/sdk 0.0.3 → 0.0.5

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 (165) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/client.d.mts +14 -8
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +14 -8
  5. package/client.d.ts.map +1 -1
  6. package/client.js +6 -0
  7. package/client.js.map +1 -1
  8. package/client.mjs +8 -2
  9. package/client.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/resources/access-tokens.d.mts +58 -0
  12. package/resources/access-tokens.d.mts.map +1 -0
  13. package/resources/access-tokens.d.ts +58 -0
  14. package/resources/access-tokens.d.ts.map +1 -0
  15. package/resources/access-tokens.js +25 -0
  16. package/resources/access-tokens.js.map +1 -0
  17. package/resources/access-tokens.mjs +21 -0
  18. package/resources/access-tokens.mjs.map +1 -0
  19. package/resources/app-builds.d.mts +16 -13
  20. package/resources/app-builds.d.mts.map +1 -1
  21. package/resources/app-builds.d.ts +16 -13
  22. package/resources/app-builds.d.ts.map +1 -1
  23. package/resources/app-builds.js +1 -1
  24. package/resources/app-builds.mjs +1 -1
  25. package/resources/apps.d.mts +15 -10
  26. package/resources/apps.d.mts.map +1 -1
  27. package/resources/apps.d.ts +15 -10
  28. package/resources/apps.d.ts.map +1 -1
  29. package/resources/checkout-configurations.d.mts +221 -183
  30. package/resources/checkout-configurations.d.mts.map +1 -1
  31. package/resources/checkout-configurations.d.ts +221 -183
  32. package/resources/checkout-configurations.d.ts.map +1 -1
  33. package/resources/checkout-configurations.js +4 -20
  34. package/resources/checkout-configurations.js.map +1 -1
  35. package/resources/checkout-configurations.mjs +4 -20
  36. package/resources/checkout-configurations.mjs.map +1 -1
  37. package/resources/companies.d.mts +157 -0
  38. package/resources/companies.d.mts.map +1 -1
  39. package/resources/companies.d.ts +157 -0
  40. package/resources/companies.d.ts.map +1 -1
  41. package/resources/companies.js +22 -0
  42. package/resources/companies.js.map +1 -1
  43. package/resources/companies.mjs +22 -0
  44. package/resources/companies.mjs.map +1 -1
  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 +184 -24
  50. package/resources/course-lessons.d.mts.map +1 -1
  51. package/resources/course-lessons.d.ts +184 -24
  52. package/resources/course-lessons.d.ts.map +1 -1
  53. package/resources/course-students.d.mts +187 -0
  54. package/resources/course-students.d.mts.map +1 -0
  55. package/resources/course-students.d.ts +187 -0
  56. package/resources/course-students.d.ts.map +1 -0
  57. package/resources/course-students.js +36 -0
  58. package/resources/course-students.js.map +1 -0
  59. package/resources/course-students.mjs +32 -0
  60. package/resources/course-students.mjs.map +1 -0
  61. package/resources/courses.d.mts +85 -21
  62. package/resources/courses.d.mts.map +1 -1
  63. package/resources/courses.d.ts +85 -21
  64. package/resources/courses.d.ts.map +1 -1
  65. package/resources/entries.d.mts +2 -2
  66. package/resources/entries.d.ts +2 -2
  67. package/resources/experiences.d.mts +15 -10
  68. package/resources/experiences.d.mts.map +1 -1
  69. package/resources/experiences.d.ts +15 -10
  70. package/resources/experiences.d.ts.map +1 -1
  71. package/resources/forum-posts.d.mts +29 -19
  72. package/resources/forum-posts.d.mts.map +1 -1
  73. package/resources/forum-posts.d.ts +29 -19
  74. package/resources/forum-posts.d.ts.map +1 -1
  75. package/resources/index.d.mts +6 -4
  76. package/resources/index.d.mts.map +1 -1
  77. package/resources/index.d.ts +6 -4
  78. package/resources/index.d.ts.map +1 -1
  79. package/resources/index.js +5 -1
  80. package/resources/index.js.map +1 -1
  81. package/resources/index.mjs +3 -1
  82. package/resources/index.mjs.map +1 -1
  83. package/resources/invoices.d.mts +539 -167
  84. package/resources/invoices.d.mts.map +1 -1
  85. package/resources/invoices.d.ts +539 -167
  86. package/resources/invoices.d.ts.map +1 -1
  87. package/resources/invoices.js +2 -24
  88. package/resources/invoices.js.map +1 -1
  89. package/resources/invoices.mjs +2 -24
  90. package/resources/invoices.mjs.map +1 -1
  91. package/resources/ledger-accounts.d.mts +1 -1
  92. package/resources/ledger-accounts.d.ts +1 -1
  93. package/resources/ledger-accounts.js +1 -1
  94. package/resources/ledger-accounts.mjs +1 -1
  95. package/resources/members.d.mts +11 -11
  96. package/resources/members.d.mts.map +1 -1
  97. package/resources/members.d.ts +11 -11
  98. package/resources/members.d.ts.map +1 -1
  99. package/resources/memberships.d.mts +4 -4
  100. package/resources/memberships.d.mts.map +1 -1
  101. package/resources/memberships.d.ts +4 -4
  102. package/resources/memberships.d.ts.map +1 -1
  103. package/resources/messages.d.mts +29 -19
  104. package/resources/messages.d.mts.map +1 -1
  105. package/resources/messages.d.ts +29 -19
  106. package/resources/messages.d.ts.map +1 -1
  107. package/resources/payments.d.mts +10 -3
  108. package/resources/payments.d.mts.map +1 -1
  109. package/resources/payments.d.ts +10 -3
  110. package/resources/payments.d.ts.map +1 -1
  111. package/resources/plans.d.mts +118 -20
  112. package/resources/plans.d.mts.map +1 -1
  113. package/resources/plans.d.ts +118 -20
  114. package/resources/plans.d.ts.map +1 -1
  115. package/resources/plans.js.map +1 -1
  116. package/resources/plans.mjs.map +1 -1
  117. package/resources/products.d.mts +20 -15
  118. package/resources/products.d.mts.map +1 -1
  119. package/resources/products.d.ts +20 -15
  120. package/resources/products.d.ts.map +1 -1
  121. package/resources/promo-codes.d.mts +4 -4
  122. package/resources/promo-codes.d.ts +4 -4
  123. package/resources/shared.d.mts +69 -20
  124. package/resources/shared.d.mts.map +1 -1
  125. package/resources/shared.d.ts +69 -20
  126. package/resources/shared.d.ts.map +1 -1
  127. package/resources/transfers.d.mts +12 -0
  128. package/resources/transfers.d.mts.map +1 -1
  129. package/resources/transfers.d.ts +12 -0
  130. package/resources/transfers.d.ts.map +1 -1
  131. package/resources/users.d.mts +3 -0
  132. package/resources/users.d.mts.map +1 -1
  133. package/resources/users.d.ts +3 -0
  134. package/resources/users.d.ts.map +1 -1
  135. package/src/client.ts +45 -10
  136. package/src/resources/access-tokens.ts +72 -0
  137. package/src/resources/app-builds.ts +19 -14
  138. package/src/resources/apps.ts +16 -11
  139. package/src/resources/checkout-configurations.ts +245 -199
  140. package/src/resources/companies.ts +196 -0
  141. package/src/resources/course-lesson-interactions.ts +2 -2
  142. package/src/resources/course-lessons.ts +223 -24
  143. package/src/resources/course-students.ts +238 -0
  144. package/src/resources/courses.ts +104 -22
  145. package/src/resources/entries.ts +2 -2
  146. package/src/resources/experiences.ts +19 -11
  147. package/src/resources/forum-posts.ts +35 -21
  148. package/src/resources/index.ts +17 -2
  149. package/src/resources/invoices.ts +630 -171
  150. package/src/resources/ledger-accounts.ts +1 -1
  151. package/src/resources/members.ts +12 -12
  152. package/src/resources/memberships.ts +5 -5
  153. package/src/resources/messages.ts +35 -21
  154. package/src/resources/payments.ts +10 -3
  155. package/src/resources/plans.ts +130 -20
  156. package/src/resources/products.ts +24 -16
  157. package/src/resources/promo-codes.ts +4 -4
  158. package/src/resources/shared.ts +70 -20
  159. package/src/resources/transfers.ts +10 -0
  160. package/src/resources/users.ts +3 -0
  161. package/src/version.ts +1 -1
  162. package/version.d.mts +1 -1
  163. package/version.d.ts +1 -1
  164. package/version.js +1 -1
  165. package/version.mjs +1 -1
@@ -5,12 +5,13 @@ import * as PaymentsAPI from './payments';
5
5
  import { CursorPage } from '../core/pagination';
6
6
 
7
7
  /**
8
- * The access level a given user (or company) has to an access pass or company.
8
+ * The access level a given user (or company) has to a product or company.
9
9
  */
10
10
  export type AccessLevel = 'no_access' | 'admin' | 'customer';
11
11
 
12
12
  /**
13
- * The different types an access pass can be.
13
+ * The different types an product can be. Only use 'regular'. The rest are for
14
+ * internal use
14
15
  */
15
16
  export type AccessPassType = 'regular' | 'app' | 'experience_upsell' | 'api_only';
16
17
 
@@ -557,6 +558,12 @@ export interface Company {
557
558
  */
558
559
  member_count: number;
559
560
 
561
+ /**
562
+ * A key-value store of data for the account, created/updated by the platform that
563
+ * made the account.
564
+ */
565
+ metadata: { [key: string]: unknown } | null;
566
+
560
567
  /**
561
568
  * The user who owns this company
562
569
  */
@@ -964,7 +971,7 @@ export interface Entry {
964
971
  plan: Entry.Plan | null;
965
972
 
966
973
  /**
967
- * The access pass tied to this entry, if there is one.
974
+ * The product tied to this entry, if there is one.
968
975
  */
969
976
  product: Entry.Product | null;
970
977
 
@@ -1011,7 +1018,7 @@ export namespace Entry {
1011
1018
  }
1012
1019
 
1013
1020
  /**
1014
- * The access pass tied to this entry, if there is one.
1021
+ * The product tied to this entry, if there is one.
1015
1022
  */
1016
1023
  export interface Product {
1017
1024
  /**
@@ -1096,10 +1103,9 @@ export interface Experience {
1096
1103
  order: string | null;
1097
1104
 
1098
1105
  /**
1099
- * The access passes that are associated with this experience. This should not be
1100
- * used unless you are trying to list all access passes the experience has, for
1101
- * some reason. You probably don't want to use this though and should be using
1102
- * accessPass.
1106
+ * The products that this experience is attached to. This defines which set of
1107
+ * customers have access and can view this experience. If empty, this experience is
1108
+ * only visible to authorized users of the company
1103
1109
  */
1104
1110
  products: Array<Experience.Product>;
1105
1111
  }
@@ -1172,7 +1178,7 @@ export namespace Experience {
1172
1178
  }
1173
1179
 
1174
1180
  /**
1175
- * An object representing a (sanitized) access pass.
1181
+ * Represents a product on whop. Use products to sell anything on the platform.
1176
1182
  */
1177
1183
  export interface Product {
1178
1184
  /**
@@ -1244,7 +1250,7 @@ export namespace Forum {
1244
1250
  */
1245
1251
  export interface ForumPost {
1246
1252
  /**
1247
- * The unique identifier for the entity
1253
+ * The unique identifier of the resource.
1248
1254
  */
1249
1255
  id: string;
1250
1256
 
@@ -1353,7 +1359,7 @@ export type FriendlyReceiptStatus =
1353
1359
  | 'canceled';
1354
1360
 
1355
1361
  /**
1356
- * The different statuses of the global affiliate program for an access pass.
1362
+ * The different statuses of the global affiliate program for a product.
1357
1363
  */
1358
1364
  export type GlobalAffiliateStatus = 'enabled' | 'disabled';
1359
1365
 
@@ -1846,7 +1852,7 @@ export type MembershipStatus =
1846
1852
  */
1847
1853
  export interface Message {
1848
1854
  /**
1849
- * The unique identifier for the entity
1855
+ * The unique identifier of the resource.
1850
1856
  */
1851
1857
  id: string;
1852
1858
 
@@ -2094,6 +2100,12 @@ export interface Payment {
2094
2100
  */
2095
2101
  membership: Payment.Membership | null;
2096
2102
 
2103
+ /**
2104
+ * The custom metadata stored on this payment. This will be copied the checkout
2105
+ * configuration for which this payment was made
2106
+ */
2107
+ metadata: { [key: string]: unknown } | null;
2108
+
2097
2109
  /**
2098
2110
  * The datetime the payment was paid
2099
2111
  */
@@ -2110,7 +2122,7 @@ export interface Payment {
2110
2122
  plan: Payment.Plan | null;
2111
2123
 
2112
2124
  /**
2113
- * The access pass attached to this payment.
2125
+ * The product this payment was made for
2114
2126
  */
2115
2127
  product: Payment.Product | null;
2116
2128
 
@@ -2281,7 +2293,7 @@ export namespace Payment {
2281
2293
  }
2282
2294
 
2283
2295
  /**
2284
- * The access pass attached to this payment.
2296
+ * The product this payment was made for
2285
2297
  */
2286
2298
  export interface Product {
2287
2299
  /**
@@ -2362,7 +2374,9 @@ export namespace Payment {
2362
2374
  }
2363
2375
 
2364
2376
  /**
2365
- * An object representing a (sanitized) plan of an access pass.
2377
+ * A plan for an product. Plans define the core parameters that define a checkout
2378
+ * and payment on whop. Use plans to create different ways to price your products
2379
+ * (Eg renewal / one_time)
2366
2380
  */
2367
2381
  export interface Plan {
2368
2382
  /**
@@ -2430,13 +2444,18 @@ export interface Plan {
2430
2444
  */
2431
2445
  member_count: number | null;
2432
2446
 
2447
+ /**
2448
+ * The explicit payment method configuration for the plan, if any.
2449
+ */
2450
+ payment_method_configuration: Plan.PaymentMethodConfiguration | null;
2451
+
2433
2452
  /**
2434
2453
  * Indicates if the plan is a one time payment or recurring.
2435
2454
  */
2436
2455
  plan_type: PlanType;
2437
2456
 
2438
2457
  /**
2439
- * The access pass for the plan.
2458
+ * The product that this plan belongs to.
2440
2459
  */
2441
2460
  product: Plan.Product | null;
2442
2461
 
@@ -2553,7 +2572,33 @@ export namespace Plan {
2553
2572
  }
2554
2573
 
2555
2574
  /**
2556
- * The access pass for the plan.
2575
+ * The explicit payment method configuration for the plan, if any.
2576
+ */
2577
+ export interface PaymentMethodConfiguration {
2578
+ /**
2579
+ * An array of payment method identifiers that are explicitly disabled. Only
2580
+ * applies if the include_platform_defaults is true.
2581
+ */
2582
+ disabled: Array<PaymentsAPI.PaymentMethodTypes>;
2583
+
2584
+ /**
2585
+ * An array of payment method identifiers that are explicitly enabled. This means
2586
+ * these payment methods will be shown on checkout. Example use case is to only
2587
+ * enable a specific payment method like cashapp, or extending the platform
2588
+ * defaults with additional methods.
2589
+ */
2590
+ enabled: Array<PaymentsAPI.PaymentMethodTypes>;
2591
+
2592
+ /**
2593
+ * Whether Whop's platform default payment method enablement settings are included
2594
+ * in this configuration. The full list of default payment methods can be found in
2595
+ * the documentation at docs.whop.com/payments.
2596
+ */
2597
+ include_platform_defaults: boolean;
2598
+ }
2599
+
2600
+ /**
2601
+ * The product that this plan belongs to.
2557
2602
  */
2558
2603
  export interface Product {
2559
2604
  /**
@@ -2569,12 +2614,12 @@ export namespace Plan {
2569
2614
  }
2570
2615
 
2571
2616
  /**
2572
- * The type of plan that can be attached to an access pass
2617
+ * The type of plan that can be attached to a product
2573
2618
  */
2574
2619
  export type PlanType = 'renewal' | 'one_time';
2575
2620
 
2576
2621
  /**
2577
- * An object representing a (sanitized) access pass.
2622
+ * Represents a product on whop. Use products to sell anything on the platform.
2578
2623
  */
2579
2624
  export interface Product {
2580
2625
  /**
@@ -2765,7 +2810,7 @@ export namespace Product {
2765
2810
  }
2766
2811
 
2767
2812
  /**
2768
- * An object representing a (sanitized) access pass.
2813
+ * Represents a product on whop. Use products to sell anything on the platform.
2769
2814
  */
2770
2815
  export interface ProductListItem {
2771
2816
  /**
@@ -3196,6 +3241,11 @@ export interface Transfer {
3196
3241
  */
3197
3242
  fee_amount: number | null;
3198
3243
 
3244
+ /**
3245
+ * A hash of metadata attached to the transfer
3246
+ */
3247
+ metadata: { [key: string]: unknown } | null;
3248
+
3199
3249
  /**
3200
3250
  * The notes of the credit transaction transfer
3201
3251
  */
@@ -106,6 +106,11 @@ export interface TransferListResponse {
106
106
  */
107
107
  fee_amount: number | null;
108
108
 
109
+ /**
110
+ * A hash of metadata attached to the transfer
111
+ */
112
+ metadata: { [key: string]: unknown } | null;
113
+
109
114
  /**
110
115
  * The notes of the credit transaction transfer
111
116
  */
@@ -145,6 +150,11 @@ export interface TransferCreateParams {
145
150
  */
146
151
  idempotence_key?: string | null;
147
152
 
153
+ /**
154
+ * A hash of metadata to attach to the transfer.
155
+ */
156
+ metadata?: { [key: string]: unknown } | null;
157
+
148
158
  /**
149
159
  * Notes for the transfer. Maximum of 50 characters.
150
160
  */
@@ -91,6 +91,9 @@ export interface UserCheckAccessResponse {
91
91
  }
92
92
 
93
93
  export interface UserCheckAccessParams {
94
+ /**
95
+ * The ID (user_xxx) or username of the user
96
+ */
94
97
  id: string;
95
98
  }
96
99
 
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.0.3'; // x-release-please-version
1
+ export const VERSION = '0.0.5'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.3";
1
+ export declare const VERSION = "0.0.5";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.0.3";
1
+ export declare const VERSION = "0.0.5";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.0.3'; // x-release-please-version
4
+ exports.VERSION = '0.0.5'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.0.3'; // x-release-please-version
1
+ export const VERSION = '0.0.5'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map