@iblai/iblai-api 4.223.0-core → 4.224.0-core

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 (43) hide show
  1. package/dist/index.cjs.js +93 -47
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +92 -48
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.umd.js +93 -47
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/types/index.d.ts +3 -3
  8. package/dist/types/models/CheckoutSessionCreate.d.ts +1 -1
  9. package/dist/types/models/ItemAccessCheckResponse.d.ts +2 -8
  10. package/dist/types/models/ItemPaywallConfig.d.ts +7 -8
  11. package/dist/types/models/ItemPaywallConfigCreate.d.ts +2 -0
  12. package/dist/types/models/ItemSubscription.d.ts +1 -7
  13. package/dist/types/models/ItemSubscriptionList.d.ts +1 -7
  14. package/dist/types/models/{MediaResourceItemTypeEnum.d.ts → ItemTypeEnum.d.ts} +1 -1
  15. package/dist/types/models/MediaResource.d.ts +2 -2
  16. package/dist/types/models/PatchedMediaResource.d.ts +2 -2
  17. package/dist/types/models/PublicItemPricing.d.ts +1 -2
  18. package/dist/types/services/BillingService.d.ts +24 -23
  19. package/dist/types/services/ItemsService.d.ts +13 -0
  20. package/dist/types/services/PlatformsService.d.ts +5 -23
  21. package/dist/types/services/PricesService.d.ts +15 -0
  22. package/package.json +1 -1
  23. package/sdk_schema.yml +189 -149
  24. package/src/core/OpenAPI.ts +1 -1
  25. package/src/index.ts +3 -3
  26. package/src/models/CheckoutSessionCreate.ts +1 -1
  27. package/src/models/ItemAccessCheckResponse.ts +2 -8
  28. package/src/models/ItemPaywallConfig.ts +7 -8
  29. package/src/models/ItemPaywallConfigCreate.ts +2 -0
  30. package/src/models/ItemSubscription.ts +1 -7
  31. package/src/models/ItemSubscriptionList.ts +1 -7
  32. package/src/models/{MediaResourceItemTypeEnum.ts → ItemTypeEnum.ts} +1 -1
  33. package/src/models/MediaResource.ts +2 -2
  34. package/src/models/PatchedMediaResource.ts +2 -2
  35. package/src/models/PublicItemPricing.ts +1 -2
  36. package/src/services/BillingService.ts +47 -23
  37. package/src/services/ItemsService.ts +29 -0
  38. package/src/services/PlatformsService.ts +5 -23
  39. package/src/services/PricesService.ts +34 -0
  40. package/dist/types/models/ItemType3e2Enum.d.ts +0 -12
  41. package/dist/types/models/ItemType40fEnum.d.ts +0 -12
  42. package/src/models/ItemType3e2Enum.ts +0 -16
  43. package/src/models/ItemType40fEnum.ts +0 -16
@@ -3,7 +3,6 @@
3
3
  /* tslint:disable */
4
4
  /* eslint-disable */
5
5
  import type { ItemSubscription } from './ItemSubscription';
6
- import type { ItemType3e2Enum } from './ItemType3e2Enum';
7
6
  /**
8
7
  * Response for the generic item access check endpoint.
9
8
  *
@@ -16,14 +15,9 @@ export type ItemAccessCheckResponse = {
16
15
  */
17
16
  has_access: boolean;
18
17
  /**
19
- * Item type that was checked (e.g. 'mentor').
20
- *
21
- * * `mentor` - mentor
22
- * * `course` - course
23
- * * `program` - program
24
- * * `pathway` - pathway
18
+ * Item type that was checked (e.g. 'mentor', 'workshop').
25
19
  */
26
- item_type: ItemType3e2Enum;
20
+ item_type: string;
27
21
  /**
28
22
  * ID of the item that was checked.
29
23
  */
@@ -4,22 +4,21 @@
4
4
  /* eslint-disable */
5
5
  import type { GrandfatheringStrategyEnum } from './GrandfatheringStrategyEnum';
6
6
  import type { ItemPrice } from './ItemPrice';
7
- import type { ItemType40fEnum } from './ItemType40fEnum';
8
7
  export type ItemPaywallConfig = {
8
+ readonly unique_id: string;
9
9
  /**
10
- * Type of item being paywalled (e.g. mentor, course, program)
11
- *
12
- * * `mentor` - Mentor
13
- * * `course` - Course
14
- * * `program` - Program
15
- * * `pathway` - Pathway
10
+ * Type of item being paywalled (e.g. mentor, course, program, or custom types)
16
11
  */
17
- item_type: ItemType40fEnum;
12
+ item_type: string;
18
13
  /**
19
14
  * Identifier for the item (UUID for mentors, slug/key for others)
20
15
  */
21
16
  item_id: string;
22
17
  readonly item_name: string;
18
+ /**
19
+ * Arbitrary metadata for the item (custom types only).
20
+ */
21
+ item_metadata?: any;
23
22
  /**
24
23
  * Whether the paywall is enabled for this item
25
24
  */
@@ -4,6 +4,8 @@
4
4
  /* eslint-disable */
5
5
  import type { GrandfatheringStrategyEnum } from './GrandfatheringStrategyEnum';
6
6
  export type ItemPaywallConfigCreate = {
7
+ item_name?: string;
8
+ item_metadata?: any;
7
9
  is_enabled?: boolean;
8
10
  description?: string;
9
11
  allow_free_tier?: boolean;
@@ -3,7 +3,6 @@
3
3
  /* tslint:disable */
4
4
  /* eslint-disable */
5
5
  import type { ItemPrice } from './ItemPrice';
6
- import type { ItemType40fEnum } from './ItemType40fEnum';
7
6
  import type { Status0e3Enum } from './Status0e3Enum';
8
7
  export type ItemSubscription = {
9
8
  readonly unique_id: string;
@@ -12,13 +11,8 @@ export type ItemSubscription = {
12
11
  readonly email: string;
13
12
  /**
14
13
  * Type of item being subscribed to
15
- *
16
- * * `mentor` - Mentor
17
- * * `course` - Course
18
- * * `program` - Program
19
- * * `pathway` - Pathway
20
14
  */
21
- item_type: ItemType40fEnum;
15
+ item_type: string;
22
16
  /**
23
17
  * Identifier for the item
24
18
  */
@@ -3,7 +3,6 @@
3
3
  /* tslint:disable */
4
4
  /* eslint-disable */
5
5
  import type { ItemPrice } from './ItemPrice';
6
- import type { ItemType40fEnum } from './ItemType40fEnum';
7
6
  import type { Status0e3Enum } from './Status0e3Enum';
8
7
  export type ItemSubscriptionList = {
9
8
  readonly unique_id: string;
@@ -12,13 +11,8 @@ export type ItemSubscriptionList = {
12
11
  readonly email: string;
13
12
  /**
14
13
  * Type of item being subscribed to
15
- *
16
- * * `mentor` - Mentor
17
- * * `course` - Course
18
- * * `program` - Program
19
- * * `pathway` - Pathway
20
14
  */
21
- item_type: ItemType40fEnum;
15
+ item_type: string;
22
16
  /**
23
17
  * Identifier for the item
24
18
  */
@@ -11,7 +11,7 @@
11
11
  * * `unit_resource` - Unit and Resource
12
12
  * * `all` - Course, Unit, and Resource
13
13
  */
14
- export enum MediaResourceItemTypeEnum {
14
+ export enum ItemTypeEnum {
15
15
  COURSE = 'course',
16
16
  UNIT = 'unit',
17
17
  RESOURCE = 'resource',
@@ -2,7 +2,7 @@
2
2
  /* istanbul ignore file */
3
3
  /* tslint:disable */
4
4
  /* eslint-disable */
5
- import type { MediaResourceItemTypeEnum } from './MediaResourceItemTypeEnum';
5
+ import type { ItemTypeEnum } from './ItemTypeEnum';
6
6
  import type { MediaTypeEnum } from './MediaTypeEnum';
7
7
  export type MediaResource = {
8
8
  readonly id: number;
@@ -35,7 +35,7 @@ export type MediaResource = {
35
35
  * * `unit_resource` - Unit and Resource
36
36
  * * `all` - Course, Unit, and Resource
37
37
  */
38
- readonly item_type: MediaResourceItemTypeEnum;
38
+ readonly item_type: ItemTypeEnum;
39
39
  /**
40
40
  * ID of the associated course
41
41
  */
@@ -2,7 +2,7 @@
2
2
  /* istanbul ignore file */
3
3
  /* tslint:disable */
4
4
  /* eslint-disable */
5
- import type { MediaResourceItemTypeEnum } from './MediaResourceItemTypeEnum';
5
+ import type { ItemTypeEnum } from './ItemTypeEnum';
6
6
  import type { MediaTypeEnum } from './MediaTypeEnum';
7
7
  export type PatchedMediaResource = {
8
8
  readonly id?: number;
@@ -35,7 +35,7 @@ export type PatchedMediaResource = {
35
35
  * * `unit_resource` - Unit and Resource
36
36
  * * `all` - Course, Unit, and Resource
37
37
  */
38
- readonly item_type?: MediaResourceItemTypeEnum;
38
+ readonly item_type?: ItemTypeEnum;
39
39
  /**
40
40
  * ID of the associated course
41
41
  */
@@ -3,9 +3,8 @@
3
3
  /* tslint:disable */
4
4
  /* eslint-disable */
5
5
  import type { ItemPrice } from './ItemPrice';
6
- import type { ItemType3e2Enum } from './ItemType3e2Enum';
7
6
  export type PublicItemPricing = {
8
- item_type: ItemType3e2Enum;
7
+ item_type: string;
9
8
  item_id: string;
10
9
  item_name: string;
11
10
  is_paywalled: boolean;
@@ -131,6 +131,25 @@ export class BillingService {
131
131
  mediaType: 'application/json',
132
132
  });
133
133
  }
134
+ /**
135
+ * Get public pricing by paywall config unique_id
136
+ * Looks up the paywall config by its unique_id and delegates to the standard public pricing endpoint.
137
+ * @returns PublicItemPricing
138
+ * @throws ApiError
139
+ */
140
+ public static billingItemsPublicPricingRetrieve({
141
+ configUniqueId,
142
+ }: {
143
+ configUniqueId: string,
144
+ }): CancelablePromise<PublicItemPricing> {
145
+ return __request(OpenAPI, {
146
+ method: 'GET',
147
+ url: '/api/billing/items/{config_unique_id}/public-pricing/',
148
+ path: {
149
+ 'config_unique_id': configUniqueId,
150
+ },
151
+ });
152
+ }
134
153
  /**
135
154
  * Check whether the authenticated user has payment access to an item on a scoped platform.
136
155
  * @returns ItemAccessCheckResponse
@@ -170,7 +189,7 @@ export class BillingService {
170
189
  itemId: string,
171
190
  itemType: string,
172
191
  platformKey: string,
173
- requestBody: CheckoutSessionCreate,
192
+ requestBody?: CheckoutSessionCreate,
174
193
  }): CancelablePromise<CheckoutSessionResponse> {
175
194
  return __request(OpenAPI, {
176
195
  method: 'POST',
@@ -268,7 +287,7 @@ export class BillingService {
268
287
  itemId: string,
269
288
  itemType: string,
270
289
  platformKey: string,
271
- requestBody: CheckoutSessionCreate,
290
+ requestBody?: CheckoutSessionCreate,
272
291
  }): CancelablePromise<CheckoutSessionResponse> {
273
292
  return __request(OpenAPI, {
274
293
  method: 'POST',
@@ -676,13 +695,7 @@ export class BillingService {
676
695
  status,
677
696
  }: {
678
697
  platformKey: string,
679
- /**
680
- * * `mentor` - mentor
681
- * * `course` - course
682
- * * `program` - program
683
- * * `pathway` - pathway
684
- */
685
- itemType?: 'mentor' | 'course' | 'program' | 'pathway',
698
+ itemType?: string,
686
699
  /**
687
700
  * A page number within the paginated result set.
688
701
  */
@@ -734,13 +747,7 @@ export class BillingService {
734
747
  }: {
735
748
  platformKey: string,
736
749
  isEnabled?: boolean | null,
737
- /**
738
- * * `mentor` - mentor
739
- * * `course` - course
740
- * * `program` - program
741
- * * `pathway` - pathway
742
- */
743
- itemType?: 'mentor' | 'course' | 'program' | 'pathway',
750
+ itemType?: string,
744
751
  /**
745
752
  * A page number within the paginated result set.
746
753
  */
@@ -800,13 +807,7 @@ export class BillingService {
800
807
  status,
801
808
  }: {
802
809
  platformKey: string,
803
- /**
804
- * * `mentor` - mentor
805
- * * `course` - course
806
- * * `program` - program
807
- * * `pathway` - pathway
808
- */
809
- itemType?: 'mentor' | 'course' | 'program' | 'pathway',
810
+ itemType?: string,
810
811
  /**
811
812
  * A page number within the paginated result set.
812
813
  */
@@ -842,6 +843,29 @@ export class BillingService {
842
843
  },
843
844
  });
844
845
  }
846
+ /**
847
+ * Create guest checkout session by price unique_id
848
+ * Looks up the price by its unique_id, derives platform/item_type/item_id, and delegates to the standard guest checkout flow.
849
+ * @returns CheckoutSessionResponse
850
+ * @throws ApiError
851
+ */
852
+ public static billingPricesCheckoutGuestCreate({
853
+ priceUniqueId,
854
+ requestBody,
855
+ }: {
856
+ priceUniqueId: string,
857
+ requestBody?: CheckoutSessionCreate,
858
+ }): CancelablePromise<CheckoutSessionResponse> {
859
+ return __request(OpenAPI, {
860
+ method: 'POST',
861
+ url: '/api/billing/prices/{price_unique_id}/checkout-guest/',
862
+ path: {
863
+ 'price_unique_id': priceUniqueId,
864
+ },
865
+ body: requestBody,
866
+ mediaType: 'application/json',
867
+ });
868
+ }
845
869
  /**
846
870
  * List transaction history
847
871
  * Paginated transaction history for the credit account. Use platform_key query param to list platform account transactions (if permitted). Filter by transaction_type, from_date (YYYY-MM-DD), to_date (YYYY-MM-DD).
@@ -0,0 +1,29 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ import type { PublicItemPricing } from '../models/PublicItemPricing';
6
+ import type { CancelablePromise } from '../core/CancelablePromise';
7
+ import { OpenAPI } from '../core/OpenAPI';
8
+ import { request as __request } from '../core/request';
9
+ export class ItemsService {
10
+ /**
11
+ * Get public pricing by paywall config unique_id
12
+ * Looks up the paywall config by its unique_id and delegates to the standard public pricing endpoint.
13
+ * @returns PublicItemPricing
14
+ * @throws ApiError
15
+ */
16
+ public static itemsPublicPricingRetrieve({
17
+ configUniqueId,
18
+ }: {
19
+ configUniqueId: string,
20
+ }): CancelablePromise<PublicItemPricing> {
21
+ return __request(OpenAPI, {
22
+ method: 'GET',
23
+ url: '/items/{config_unique_id}/public-pricing/',
24
+ path: {
25
+ 'config_unique_id': configUniqueId,
26
+ },
27
+ });
28
+ }
29
+ }
@@ -59,7 +59,7 @@ export class PlatformsService {
59
59
  itemId: string,
60
60
  itemType: string,
61
61
  platformKey: string,
62
- requestBody: CheckoutSessionCreate,
62
+ requestBody?: CheckoutSessionCreate,
63
63
  }): CancelablePromise<CheckoutSessionResponse> {
64
64
  return __request(OpenAPI, {
65
65
  method: 'POST',
@@ -157,7 +157,7 @@ export class PlatformsService {
157
157
  itemId: string,
158
158
  itemType: string,
159
159
  platformKey: string,
160
- requestBody: CheckoutSessionCreate,
160
+ requestBody?: CheckoutSessionCreate,
161
161
  }): CancelablePromise<CheckoutSessionResponse> {
162
162
  return __request(OpenAPI, {
163
163
  method: 'POST',
@@ -565,13 +565,7 @@ export class PlatformsService {
565
565
  status,
566
566
  }: {
567
567
  platformKey: string,
568
- /**
569
- * * `mentor` - mentor
570
- * * `course` - course
571
- * * `program` - program
572
- * * `pathway` - pathway
573
- */
574
- itemType?: 'mentor' | 'course' | 'program' | 'pathway',
568
+ itemType?: string,
575
569
  /**
576
570
  * A page number within the paginated result set.
577
571
  */
@@ -623,13 +617,7 @@ export class PlatformsService {
623
617
  }: {
624
618
  platformKey: string,
625
619
  isEnabled?: boolean | null,
626
- /**
627
- * * `mentor` - mentor
628
- * * `course` - course
629
- * * `program` - program
630
- * * `pathway` - pathway
631
- */
632
- itemType?: 'mentor' | 'course' | 'program' | 'pathway',
620
+ itemType?: string,
633
621
  /**
634
622
  * A page number within the paginated result set.
635
623
  */
@@ -689,13 +677,7 @@ export class PlatformsService {
689
677
  status,
690
678
  }: {
691
679
  platformKey: string,
692
- /**
693
- * * `mentor` - mentor
694
- * * `course` - course
695
- * * `program` - program
696
- * * `pathway` - pathway
697
- */
698
- itemType?: 'mentor' | 'course' | 'program' | 'pathway',
680
+ itemType?: string,
699
681
  /**
700
682
  * A page number within the paginated result set.
701
683
  */
@@ -0,0 +1,34 @@
1
+ /* generated using openapi-typescript-codegen -- do not edit */
2
+ /* istanbul ignore file */
3
+ /* tslint:disable */
4
+ /* eslint-disable */
5
+ import type { CheckoutSessionCreate } from '../models/CheckoutSessionCreate';
6
+ import type { CheckoutSessionResponse } from '../models/CheckoutSessionResponse';
7
+ import type { CancelablePromise } from '../core/CancelablePromise';
8
+ import { OpenAPI } from '../core/OpenAPI';
9
+ import { request as __request } from '../core/request';
10
+ export class PricesService {
11
+ /**
12
+ * Create guest checkout session by price unique_id
13
+ * Looks up the price by its unique_id, derives platform/item_type/item_id, and delegates to the standard guest checkout flow.
14
+ * @returns CheckoutSessionResponse
15
+ * @throws ApiError
16
+ */
17
+ public static pricesCheckoutGuestCreate({
18
+ priceUniqueId,
19
+ requestBody,
20
+ }: {
21
+ priceUniqueId: string,
22
+ requestBody?: CheckoutSessionCreate,
23
+ }): CancelablePromise<CheckoutSessionResponse> {
24
+ return __request(OpenAPI, {
25
+ method: 'POST',
26
+ url: '/prices/{price_unique_id}/checkout-guest/',
27
+ path: {
28
+ 'price_unique_id': priceUniqueId,
29
+ },
30
+ body: requestBody,
31
+ mediaType: 'application/json',
32
+ });
33
+ }
34
+ }
@@ -1,12 +0,0 @@
1
- /**
2
- * * `mentor` - mentor
3
- * * `course` - course
4
- * * `program` - program
5
- * * `pathway` - pathway
6
- */
7
- export declare enum ItemType3e2Enum {
8
- MENTOR = "mentor",
9
- COURSE = "course",
10
- PROGRAM = "program",
11
- PATHWAY = "pathway"
12
- }
@@ -1,12 +0,0 @@
1
- /**
2
- * * `mentor` - Mentor
3
- * * `course` - Course
4
- * * `program` - Program
5
- * * `pathway` - Pathway
6
- */
7
- export declare enum ItemType40fEnum {
8
- MENTOR = "mentor",
9
- COURSE = "course",
10
- PROGRAM = "program",
11
- PATHWAY = "pathway"
12
- }
@@ -1,16 +0,0 @@
1
- /* generated using openapi-typescript-codegen -- do not edit */
2
- /* istanbul ignore file */
3
- /* tslint:disable */
4
- /* eslint-disable */
5
- /**
6
- * * `mentor` - mentor
7
- * * `course` - course
8
- * * `program` - program
9
- * * `pathway` - pathway
10
- */
11
- export enum ItemType3e2Enum {
12
- MENTOR = 'mentor',
13
- COURSE = 'course',
14
- PROGRAM = 'program',
15
- PATHWAY = 'pathway',
16
- }
@@ -1,16 +0,0 @@
1
- /* generated using openapi-typescript-codegen -- do not edit */
2
- /* istanbul ignore file */
3
- /* tslint:disable */
4
- /* eslint-disable */
5
- /**
6
- * * `mentor` - Mentor
7
- * * `course` - Course
8
- * * `program` - Program
9
- * * `pathway` - Pathway
10
- */
11
- export enum ItemType40fEnum {
12
- MENTOR = 'mentor',
13
- COURSE = 'course',
14
- PROGRAM = 'program',
15
- PATHWAY = 'pathway',
16
- }