@whop/sdk 0.0.1-canary.0 → 0.0.3
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 +44 -0
- package/client.d.mts +39 -11
- package/client.d.mts.map +1 -1
- package/client.d.ts +39 -11
- package/client.d.ts.map +1 -1
- package/client.js +23 -2
- package/client.js.map +1 -1
- package/client.mjs +23 -2
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/apps.d.mts +16 -0
- package/resources/apps.d.mts.map +1 -1
- package/resources/apps.d.ts +16 -0
- package/resources/apps.d.ts.map +1 -1
- package/resources/checkout-configurations.d.mts +96 -19
- package/resources/checkout-configurations.d.mts.map +1 -1
- package/resources/checkout-configurations.d.ts +96 -19
- package/resources/checkout-configurations.d.ts.map +1 -1
- package/resources/checkout-configurations.js +3 -1
- package/resources/checkout-configurations.js.map +1 -1
- package/resources/checkout-configurations.mjs +3 -1
- package/resources/checkout-configurations.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-lessons.d.mts +523 -0
- package/resources/course-lessons.d.mts.map +1 -0
- package/resources/course-lessons.d.ts +523 -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/courses.d.mts +465 -0
- package/resources/courses.d.mts.map +1 -0
- package/resources/courses.d.ts +465 -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 +59 -1
- package/resources/experiences.d.mts.map +1 -1
- package/resources/experiences.d.ts +59 -1
- 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 +56 -1
- package/resources/forum-posts.d.mts.map +1 -1
- package/resources/forum-posts.d.ts +56 -1
- 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/forums.d.mts +112 -0
- package/resources/forums.d.mts.map +1 -0
- package/resources/forums.d.ts +112 -0
- package/resources/forums.d.ts.map +1 -0
- package/resources/forums.js +41 -0
- package/resources/forums.js.map +1 -0
- package/resources/forums.mjs +37 -0
- package/resources/forums.mjs.map +1 -0
- package/resources/index.d.mts +12 -5
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +12 -5
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +15 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +7 -0
- package/resources/index.mjs.map +1 -1
- package/resources/invoices.d.mts +5 -2
- package/resources/invoices.d.mts.map +1 -1
- package/resources/invoices.d.ts +5 -2
- package/resources/invoices.d.ts.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 +274 -0
- package/resources/members.d.mts.map +1 -0
- package/resources/members.d.ts +274 -0
- package/resources/members.d.ts.map +1 -0
- package/resources/members.js +35 -0
- package/resources/members.js.map +1 -0
- package/resources/members.mjs +31 -0
- package/resources/members.mjs.map +1 -0
- 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 +38 -1
- package/resources/messages.d.mts.map +1 -1
- package/resources/messages.d.ts +38 -1
- 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 +28 -13
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +28 -13
- package/resources/payments.d.ts.map +1 -1
- package/resources/plans.d.mts +54 -3
- package/resources/plans.d.mts.map +1 -1
- package/resources/plans.d.ts +54 -3
- package/resources/plans.d.ts.map +1 -1
- package/resources/products.d.mts +17 -25
- package/resources/products.d.mts.map +1 -1
- package/resources/products.d.ts +17 -25
- 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 +245 -24
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +245 -24
- package/resources/shared.d.ts.map +1 -1
- package/resources/users.d.mts +18 -1
- package/resources/users.d.mts.map +1 -1
- package/resources/users.d.ts +18 -1
- package/resources/users.d.ts.map +1 -1
- package/resources/users.js.map +1 -1
- package/resources/users.mjs.map +1 -1
- package/resources/webhooks.d.mts +224 -2
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +224 -2
- package/resources/webhooks.d.ts.map +1 -1
- package/src/client.ts +197 -3
- package/src/resources/apps.ts +18 -0
- package/src/resources/checkout-configurations.ts +111 -19
- package/src/resources/course-chapters.ts +236 -0
- package/src/resources/course-lessons.ts +646 -0
- package/src/resources/courses.ts +594 -0
- package/src/resources/experiences.ts +71 -0
- package/src/resources/forum-posts.ts +71 -0
- package/src/resources/forums.ts +152 -0
- package/src/resources/index.ts +83 -0
- package/src/resources/invoices.ts +5 -2
- package/src/resources/ledger-accounts.ts +13 -1
- package/src/resources/members.ts +342 -0
- package/src/resources/memberships.ts +31 -6
- package/src/resources/messages.ts +50 -0
- package/src/resources/payments.ts +139 -19
- package/src/resources/plans.ts +65 -3
- package/src/resources/products.ts +20 -29
- package/src/resources/promo-codes.ts +490 -0
- package/src/resources/reviews.ts +348 -0
- package/src/resources/shared.ts +296 -24
- package/src/resources/users.ts +20 -1
- package/src/resources/webhooks.ts +293 -1
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -5,12 +5,14 @@ import { CursorPage, type CursorPageParams, PagePromise } from "../core/paginati
|
|
|
5
5
|
import { RequestOptions } from "../internal/request-options.js";
|
|
6
6
|
export declare class CheckoutConfigurations extends APIResource {
|
|
7
7
|
/**
|
|
8
|
-
* Creates a new checkout
|
|
8
|
+
* Creates a new checkout configuration
|
|
9
9
|
*
|
|
10
10
|
* Required permissions:
|
|
11
11
|
*
|
|
12
12
|
* - `checkout_configuration:create`
|
|
13
13
|
* - `plan:create`
|
|
14
|
+
* - `access_pass:create`
|
|
15
|
+
* - `access_pass:update`
|
|
14
16
|
*
|
|
15
17
|
* @example
|
|
16
18
|
* ```ts
|
|
@@ -56,43 +58,47 @@ export declare class CheckoutConfigurations extends APIResource {
|
|
|
56
58
|
}
|
|
57
59
|
export type CheckoutConfigurationListResponsesCursorPage = CursorPage<CheckoutConfigurationListResponse>;
|
|
58
60
|
/**
|
|
59
|
-
* A checkout
|
|
61
|
+
* A checkout configuration object.
|
|
62
|
+
* Can be used to create a reusable custom configuration for a checkout, including attaching plans, affiliates and custom metadata to the checkout.
|
|
63
|
+
* This configuration can be re-used by multiple users.
|
|
64
|
+
* All successful payments and memberships resulting from a checkout will contain the passed metadata.
|
|
60
65
|
*/
|
|
61
66
|
export interface CheckoutConfigurationListResponse {
|
|
62
67
|
/**
|
|
63
|
-
* The ID of the checkout
|
|
68
|
+
* The ID of the checkout configuration
|
|
64
69
|
*/
|
|
65
70
|
id: string;
|
|
66
71
|
/**
|
|
67
|
-
* The affiliate code to use for the checkout
|
|
72
|
+
* The affiliate code to use for the checkout configuration
|
|
68
73
|
*/
|
|
69
|
-
affiliate_code: string;
|
|
74
|
+
affiliate_code: string | null;
|
|
70
75
|
/**
|
|
71
|
-
* The ID of the company to use for the checkout
|
|
76
|
+
* The ID of the company to use for the checkout configuration
|
|
72
77
|
*/
|
|
73
78
|
company_id: string;
|
|
74
79
|
/**
|
|
75
|
-
* The metadata to use for the checkout
|
|
80
|
+
* The metadata to use for the checkout configuration
|
|
76
81
|
*/
|
|
77
82
|
metadata: {
|
|
78
83
|
[key: string]: unknown;
|
|
79
84
|
};
|
|
80
85
|
/**
|
|
81
|
-
* The plan to use for the checkout
|
|
86
|
+
* The plan to use for the checkout configuration
|
|
82
87
|
*/
|
|
83
88
|
plan: CheckoutConfigurationListResponse.Plan;
|
|
84
89
|
/**
|
|
85
|
-
*
|
|
90
|
+
* A URL you can send to customers to complete a checkout. It looks like
|
|
91
|
+
* `/checkout/plan_xxxx?session={id}`
|
|
86
92
|
*/
|
|
87
93
|
purchase_url: string;
|
|
88
94
|
/**
|
|
89
|
-
* The URL to redirect the user to after the checkout
|
|
95
|
+
* The URL to redirect the user to after the checkout configuration is created
|
|
90
96
|
*/
|
|
91
|
-
redirect_url: string;
|
|
97
|
+
redirect_url: string | null;
|
|
92
98
|
}
|
|
93
99
|
export declare namespace CheckoutConfigurationListResponse {
|
|
94
100
|
/**
|
|
95
|
-
* The plan to use for the checkout
|
|
101
|
+
* The plan to use for the checkout configuration
|
|
96
102
|
*/
|
|
97
103
|
interface Plan {
|
|
98
104
|
/**
|
|
@@ -139,31 +145,31 @@ export declare namespace CheckoutConfigurationListResponse {
|
|
|
139
145
|
}
|
|
140
146
|
export interface CheckoutConfigurationCreateParams {
|
|
141
147
|
/**
|
|
142
|
-
* The affiliate code to use for the checkout
|
|
148
|
+
* The affiliate code to use for the checkout configuration
|
|
143
149
|
*/
|
|
144
150
|
affiliate_code?: string | null;
|
|
145
151
|
/**
|
|
146
|
-
* The metadata to use for the checkout
|
|
152
|
+
* The metadata to use for the checkout configuration
|
|
147
153
|
*/
|
|
148
154
|
metadata?: {
|
|
149
155
|
[key: string]: unknown;
|
|
150
156
|
} | null;
|
|
151
157
|
/**
|
|
152
|
-
* Pass this object to create a new plan for this checkout
|
|
158
|
+
* Pass this object to create a new plan for this checkout configuration
|
|
153
159
|
*/
|
|
154
160
|
plan?: CheckoutConfigurationCreateParams.Plan | null;
|
|
155
161
|
/**
|
|
156
|
-
* The ID of the plan to use for the checkout
|
|
162
|
+
* The ID of the plan to use for the checkout configuration
|
|
157
163
|
*/
|
|
158
164
|
plan_id?: string | null;
|
|
159
165
|
/**
|
|
160
|
-
* The URL to redirect the user to after the checkout
|
|
166
|
+
* The URL to redirect the user to after the checkout configuration is created
|
|
161
167
|
*/
|
|
162
168
|
redirect_url?: string | null;
|
|
163
169
|
}
|
|
164
170
|
export declare namespace CheckoutConfigurationCreateParams {
|
|
165
171
|
/**
|
|
166
|
-
* Pass this object to create a new plan for this checkout
|
|
172
|
+
* Pass this object to create a new plan for this checkout configuration
|
|
167
173
|
*/
|
|
168
174
|
interface Plan {
|
|
169
175
|
/**
|
|
@@ -217,7 +223,12 @@ export declare namespace CheckoutConfigurationCreateParams {
|
|
|
217
223
|
*/
|
|
218
224
|
plan_type?: Shared.PlanType | null;
|
|
219
225
|
/**
|
|
220
|
-
*
|
|
226
|
+
* Pass this object to create a new product for this plan. We will use the product
|
|
227
|
+
* external identifier to find or create an existing product.
|
|
228
|
+
*/
|
|
229
|
+
product?: Plan.Product | null;
|
|
230
|
+
/**
|
|
231
|
+
* The product the plan is related to. Either this or product is required.
|
|
221
232
|
*/
|
|
222
233
|
product_id?: string | null;
|
|
223
234
|
/**
|
|
@@ -285,6 +296,72 @@ export declare namespace CheckoutConfigurationCreateParams {
|
|
|
285
296
|
*/
|
|
286
297
|
direct_upload_id?: string | null;
|
|
287
298
|
}
|
|
299
|
+
/**
|
|
300
|
+
* Pass this object to create a new product for this plan. We will use the product
|
|
301
|
+
* external identifier to find or create an existing product.
|
|
302
|
+
*/
|
|
303
|
+
interface Product {
|
|
304
|
+
/**
|
|
305
|
+
* A unique ID used to find or create a product. When provided during creation, we
|
|
306
|
+
* will look for an existing product with this external identifier — if found, it
|
|
307
|
+
* will be updated; otherwise, a new product will be created.
|
|
308
|
+
*/
|
|
309
|
+
external_identifier: string;
|
|
310
|
+
/**
|
|
311
|
+
* The title of the product.
|
|
312
|
+
*/
|
|
313
|
+
title: string;
|
|
314
|
+
/**
|
|
315
|
+
* The different business types a company can be.
|
|
316
|
+
*/
|
|
317
|
+
business_type?: Shared.BusinessTypes | null;
|
|
318
|
+
/**
|
|
319
|
+
* Whether or not to collect shipping information at checkout from the customer.
|
|
320
|
+
*/
|
|
321
|
+
collect_shipping_address?: boolean | null;
|
|
322
|
+
/**
|
|
323
|
+
* The custom statement descriptor for the product i.e. WHOP\*SPORTS, must be
|
|
324
|
+
* between 5 and 22 characters, contain at least one letter, and not contain any of
|
|
325
|
+
* the following characters: <, >, \, ', "
|
|
326
|
+
*/
|
|
327
|
+
custom_statement_descriptor?: string | null;
|
|
328
|
+
/**
|
|
329
|
+
* A written description of the product.
|
|
330
|
+
*/
|
|
331
|
+
description?: string | null;
|
|
332
|
+
/**
|
|
333
|
+
* The percentage of the revenue that goes to the global affiliate program.
|
|
334
|
+
*/
|
|
335
|
+
global_affiliate_percentage?: number | null;
|
|
336
|
+
/**
|
|
337
|
+
* The different statuses of the global affiliate program for an access pass.
|
|
338
|
+
*/
|
|
339
|
+
global_affiliate_status?: Shared.GlobalAffiliateStatus | null;
|
|
340
|
+
/**
|
|
341
|
+
* The headline of the product.
|
|
342
|
+
*/
|
|
343
|
+
headline?: string | null;
|
|
344
|
+
/**
|
|
345
|
+
* The different industry types a company can be in.
|
|
346
|
+
*/
|
|
347
|
+
industry_type?: Shared.IndustryTypes | null;
|
|
348
|
+
/**
|
|
349
|
+
* The ID of the product tax code to apply to this product.
|
|
350
|
+
*/
|
|
351
|
+
product_tax_code_id?: string | null;
|
|
352
|
+
/**
|
|
353
|
+
* The URL to redirect the customer to after a purchase.
|
|
354
|
+
*/
|
|
355
|
+
redirect_purchase_url?: string | null;
|
|
356
|
+
/**
|
|
357
|
+
* The route of the product.
|
|
358
|
+
*/
|
|
359
|
+
route?: string | null;
|
|
360
|
+
/**
|
|
361
|
+
* Visibility of a resource
|
|
362
|
+
*/
|
|
363
|
+
visibility?: Shared.Visibility | null;
|
|
364
|
+
}
|
|
288
365
|
}
|
|
289
366
|
}
|
|
290
367
|
export interface CheckoutConfigurationListParams extends CursorPageParams {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-configurations.d.ts","sourceRoot":"","sources":["../src/resources/checkout-configurations.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,KAAK,MAAM;OACX,EAAE,UAAU,EAAE;OACd,EAAE,UAAU,EAAE,KAAK,gBAAgB,EAAE,WAAW,EAAE;OAClD,EAAE,cAAc,EAAE;AAGzB,qBAAa,sBAAuB,SAAQ,WAAW;IACrD
|
|
1
|
+
{"version":3,"file":"checkout-configurations.d.ts","sourceRoot":"","sources":["../src/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,EAAE,MAAM,CAAC,UAAU,GAAG,IAAI,CAAC;SACvC;KACF;CACF;AAED,MAAM,WAAW,+BAAgC,SAAQ,gBAAgB;IACvE;;OAEG;IACH,UAAU,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;IAEpC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEtB;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAErB;;OAEG;IACH,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,MAAM,CAAC,OAAO,WAAW,sBAAsB,CAAC;IAC9C,OAAO,EACL,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,4CAA4C,IAAI,4CAA4C,EACjG,KAAK,iCAAiC,IAAI,iCAAiC,EAC3E,KAAK,+BAA+B,IAAI,+BAA+B,GACxE,CAAC;CACH"}
|
|
@@ -7,12 +7,14 @@ const pagination_1 = require("../core/pagination.js");
|
|
|
7
7
|
const path_1 = require("../internal/utils/path.js");
|
|
8
8
|
class CheckoutConfigurations extends resource_1.APIResource {
|
|
9
9
|
/**
|
|
10
|
-
* Creates a new checkout
|
|
10
|
+
* Creates a new checkout configuration
|
|
11
11
|
*
|
|
12
12
|
* Required permissions:
|
|
13
13
|
*
|
|
14
14
|
* - `checkout_configuration:create`
|
|
15
15
|
* - `plan:create`
|
|
16
|
+
* - `access_pass:create`
|
|
17
|
+
* - `access_pass:update`
|
|
16
18
|
*
|
|
17
19
|
* @example
|
|
18
20
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-configurations.js","sourceRoot":"","sources":["../src/resources/checkout-configurations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,sBAAuB,SAAQ,sBAAW;IACrD
|
|
1
|
+
{"version":3,"file":"checkout-configurations.js","sourceRoot":"","sources":["../src/resources/checkout-configurations.ts"],"names":[],"mappings":";AAAA,sFAAsF;;;AAEtF,kDAA+C;AAG/C,sDAAoF;AAEpF,oDAA8C;AAE9C,MAAa,sBAAuB,SAAQ,sBAAW;IACrD;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CACJ,OAA6D,EAAE,EAC/D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,4BAA4B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CACF,KAAsC,EACtC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,0BAA0B,EAC1B,CAAA,uBAA6C,CAAA,EAC7C,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF;AAtED,wDAsEC"}
|
|
@@ -4,12 +4,14 @@ import { CursorPage } from "../core/pagination.mjs";
|
|
|
4
4
|
import { path } from "../internal/utils/path.mjs";
|
|
5
5
|
export class CheckoutConfigurations extends APIResource {
|
|
6
6
|
/**
|
|
7
|
-
* Creates a new checkout
|
|
7
|
+
* Creates a new checkout configuration
|
|
8
8
|
*
|
|
9
9
|
* Required permissions:
|
|
10
10
|
*
|
|
11
11
|
* - `checkout_configuration:create`
|
|
12
12
|
* - `plan:create`
|
|
13
|
+
* - `access_pass:create`
|
|
14
|
+
* - `access_pass:update`
|
|
13
15
|
*
|
|
14
16
|
* @example
|
|
15
17
|
* ```ts
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkout-configurations.mjs","sourceRoot":"","sources":["../src/resources/checkout-configurations.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,sBAAuB,SAAQ,WAAW;IACrD
|
|
1
|
+
{"version":3,"file":"checkout-configurations.mjs","sourceRoot":"","sources":["../src/resources/checkout-configurations.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAGf,EAAE,UAAU,EAAsC;OAElD,EAAE,IAAI,EAAE;AAEf,MAAM,OAAO,sBAAuB,SAAQ,WAAW;IACrD;;;;;;;;;;;;;;;OAeG;IACH,MAAM,CACJ,OAA6D,EAAE,EAC/D,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,0BAA0B,EAAE,EAAE,IAAI,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC7E,CAAC;IAED;;;;;;;;;;;;;;OAcG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,4BAA4B,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IACzE,CAAC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CACF,KAAsC,EACtC,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAC5B,0BAA0B,EAC1B,CAAA,UAA6C,CAAA,EAC7C,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CACtB,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -0,0 +1,185 @@
|
|
|
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 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.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"course-chapters.d.mts","sourceRoot":"","sources":["../src/resources/course-chapters.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;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAI5F;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAIzE;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE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AM,CAAC;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,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,CAAC,OAAO,WAAW,cAAc,CAAC;IACtC,OAAO,EACL,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,2BAA2B,IAAI,2BAA2B,EAC/D,KAAK,oCAAoC,IAAI,oCAAoC,EACjF,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,yBAAyB,IAAI,yBAAyB,EAC3D,KAAK,uBAAuB,IAAI,uBAAuB,GACxD,CAAC;CACH"}
|
|
@@ -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":"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;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,IAAI,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAI5F;;;;;;;;;;;;;OAaG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAIzE;;;;;;;;;;;;;;OAcG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,yBAAyB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,aAAa,CAAC;IAIxG;;;;;;;;;;;;;;;;OAgBG;IACH,IAAI,CACF,KAAK,EAAE,uBAAuB,EAC9B,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,oCAAoC,EAAE,yBAAyB,CAAC;IAO/E;;;;;;;;;;;;;OAaG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,2BAA2B,CAAC;CAGtF;AAED,MAAM,MAAM,oCAAoC,GAAG,UAAU,CAAC,yBAAyB,CAAC,CAAC;AAEzF;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,OAAO,EAAE,KAAK,CAAC,aAAa,CAA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