@iblai/iblai-api 4.504.1-ai → 4.507.0-ai

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 (51) hide show
  1. package/dist/index.cjs.js +25 -260
  2. package/dist/index.cjs.js.map +1 -1
  3. package/dist/index.esm.js +26 -261
  4. package/dist/index.esm.js.map +1 -1
  5. package/dist/index.umd.js +25 -260
  6. package/dist/index.umd.js.map +1 -1
  7. package/dist/types/index.d.ts +0 -15
  8. package/dist/types/services/AiAccountService.d.ts +2 -22
  9. package/dist/types/services/AiAnalyticsService.d.ts +8 -4
  10. package/dist/types/services/AnalyticsService.d.ts +5 -2
  11. package/dist/types/services/CommerceService.d.ts +2 -135
  12. package/dist/types/services/V1AnalyticsService.d.ts +3 -2
  13. package/package.json +1 -1
  14. package/sdk_schema.yml +14 -643
  15. package/src/core/OpenAPI.ts +1 -1
  16. package/src/index.ts +0 -15
  17. package/src/services/AiAccountService.ts +2 -22
  18. package/src/services/AiAnalyticsService.ts +10 -5
  19. package/src/services/AnalyticsService.ts +5 -2
  20. package/src/services/CommerceService.ts +2 -243
  21. package/src/services/V1AnalyticsService.ts +5 -3
  22. package/dist/types/models/AWSTenantLaunchRequest.d.ts +0 -24
  23. package/dist/types/models/AppleSubscriptionStatusRequest.d.ts +0 -3
  24. package/dist/types/models/AppleSubscriptionStatusView.d.ts +0 -3
  25. package/dist/types/models/AppleVerifyTransactionId.d.ts +0 -3
  26. package/dist/types/models/AssociateAccountResponse.d.ts +0 -5
  27. package/dist/types/models/AssociateAppleAccount.d.ts +0 -3
  28. package/dist/types/models/BaseErrorResponse.d.ts +0 -5
  29. package/dist/types/models/BaseResponse.d.ts +0 -5
  30. package/dist/types/models/GCPTenantLaunchRequest.d.ts +0 -28
  31. package/dist/types/models/GooglePayAccountResponse.d.ts +0 -15
  32. package/dist/types/models/GooglePayAccountResponseStatusEnum.d.ts +0 -8
  33. package/dist/types/models/GooglePayVerifyToken.d.ts +0 -6
  34. package/dist/types/models/VerifyGCPMarketPlaceFailedResponse.d.ts +0 -11
  35. package/dist/types/models/VerifyGCPMarketPlaceRequest.d.ts +0 -3
  36. package/dist/types/models/VerifyGCPMarketPlaceResponse.d.ts +0 -11
  37. package/src/models/AWSTenantLaunchRequest.ts +0 -29
  38. package/src/models/AppleSubscriptionStatusRequest.ts +0 -8
  39. package/src/models/AppleSubscriptionStatusView.ts +0 -8
  40. package/src/models/AppleVerifyTransactionId.ts +0 -8
  41. package/src/models/AssociateAccountResponse.ts +0 -10
  42. package/src/models/AssociateAppleAccount.ts +0 -8
  43. package/src/models/BaseErrorResponse.ts +0 -10
  44. package/src/models/BaseResponse.ts +0 -10
  45. package/src/models/GCPTenantLaunchRequest.ts +0 -33
  46. package/src/models/GooglePayAccountResponse.ts +0 -20
  47. package/src/models/GooglePayAccountResponseStatusEnum.ts +0 -12
  48. package/src/models/GooglePayVerifyToken.ts +0 -11
  49. package/src/models/VerifyGCPMarketPlaceFailedResponse.ts +0 -16
  50. package/src/models/VerifyGCPMarketPlaceRequest.ts +0 -8
  51. package/src/models/VerifyGCPMarketPlaceResponse.ts +0 -16
package/dist/index.cjs.js CHANGED
@@ -110,7 +110,7 @@ class CancelablePromise {
110
110
 
111
111
  const OpenAPI = {
112
112
  BASE: 'https://base.manager.iblai.app',
113
- VERSION: '4.504.1-ai-plus',
113
+ VERSION: '4.507.0-ai-plus',
114
114
  WITH_CREDENTIALS: false,
115
115
  CREDENTIALS: 'include',
116
116
  TOKEN: undefined,
@@ -1029,20 +1029,6 @@ exports.GenderEnum = void 0;
1029
1029
  GenderEnum["OTHER"] = "other";
1030
1030
  })(exports.GenderEnum || (exports.GenderEnum = {}));
1031
1031
 
1032
- /* generated using openapi-typescript-codegen -- do not edit */
1033
- /* istanbul ignore file */
1034
- /* tslint:disable */
1035
- /* eslint-disable */
1036
- /**
1037
- * * `ACCOUNT_ACTIVE` - Account Active
1038
- * * `ACCOUNT_PENDING` - Account Pending
1039
- */
1040
- exports.GooglePayAccountResponseStatusEnum = void 0;
1041
- (function (GooglePayAccountResponseStatusEnum) {
1042
- GooglePayAccountResponseStatusEnum["ACCOUNT_ACTIVE"] = "ACCOUNT_ACTIVE";
1043
- GooglePayAccountResponseStatusEnum["ACCOUNT_PENDING"] = "ACCOUNT_PENDING";
1044
- })(exports.GooglePayAccountResponseStatusEnum || (exports.GooglePayAccountResponseStatusEnum = {}));
1045
-
1046
1032
  /* generated using openapi-typescript-codegen -- do not edit */
1047
1033
  /* istanbul ignore file */
1048
1034
  /* tslint:disable */
@@ -4265,29 +4251,9 @@ class AiAccountService {
4265
4251
  });
4266
4252
  }
4267
4253
  /**
4268
- * Wires RBAC into a DRF view.
4269
- *
4270
- * Two responsibilities:
4271
- *
4272
- * 1. When RBAC is enabled, replace the view's `permission_classes` with
4273
- * `RbacAuthGate` (the gate the RBAC layer assumes — `IsEdxAuthenticated`
4274
- * semantics, plus opt-in acceptance of token-policies PlatformApiKeys for
4275
- * views that set `token_policies_enabled = True`).
4276
- *
4277
- * 2. Detect server-to-server (Django auth) callers via `is_service_account`.
4278
- * Server-to-server tokens authenticate as Django auth users with no
4279
- * relationship to a platform EdxUser. The convention is "we trust this
4280
- * caller — bypass RBAC and serve the request."
4281
- *
4282
- * Combine it with the RBAC-disabled check at the top of `initial()` so
4283
- * the early exit skips all RBAC prep work:
4254
+ * The connect flow is always for the caller, on their token's platform.
4284
4255
  *
4285
- * if not ConfigFlags.rbac_enabled() or self.is_service_account:
4286
- * return
4287
- *
4288
- * Use `is_service_account` at any other touch points where caller
4289
- * identity matters (queryset ownership filters, owner attribution on
4290
- * create, serializer context, etc.).
4256
+ * Service accounts are refused: the consent happens in the user's browser.
4291
4257
  * @returns OAuthStartResponse Starts the OAuth flow for the given provider and service
4292
4258
  * @throws ApiError
4293
4259
  */
@@ -7173,11 +7139,12 @@ class AiAnalyticsService {
7173
7139
  * Response: Available filter options for chat message history.
7174
7140
  *
7175
7141
  * Raises:
7176
- * NotFound: If the specified organization does not exist.
7142
+ * PermissionDenied: If `org` is not the token's platform.
7143
+ * NotFound: If the organization or mentor does not exist.
7177
7144
  *
7178
7145
  * Query Parameters:
7179
7146
  * monthly_range (bool): Whether to return monthly or weekly date ranges.
7180
- * mentor_id (str): Filter users by those who have chatted with a specific mentor.
7147
+ * mentor_id (str): Narrow topics, date ranges and users to one mentor.
7181
7148
  * @returns ChatHistoryFilterData
7182
7149
  * @throws ApiError
7183
7150
  */
@@ -7203,7 +7170,8 @@ class AiAnalyticsService {
7203
7170
  'start_date': startDate
7204
7171
  },
7205
7172
  errors: {
7206
- 404: `Organization not found`
7173
+ 403: `org is not the token's platform, or no ChatHistory list grant`,
7174
+ 404: `Organization or mentor not found`
7207
7175
  }
7208
7176
  });
7209
7177
  }
@@ -10802,10 +10770,11 @@ class AiAnalyticsService {
10802
10770
  * **Required query parameters**
10803
10771
  * - group_by – provider | llm_model | username | mentor | platform
10804
10772
  * - metrics – csv list of KPI names, e.g. total_cost, sessions
10773
+ * - platform_key – must match the token's platform (optional for service
10774
+ * accounts, which see every platform when it is omitted)
10805
10775
  *
10806
10776
  * **Shared optional filters**
10807
10777
  * - start_date, end_date – ISO yyyy-mm-dd (ignored when all_time=true)
10808
- * - platform_key – tenant isolation
10809
10778
  * - mentor_unique_id – filter to one agent
10810
10779
  * - username – filter to a learner
10811
10780
  * - provider / llm_model – filter to LLM provider / model
@@ -10819,6 +10788,7 @@ class AiAnalyticsService {
10819
10788
  * GET /api/v2/analytics/financial/details?
10820
10789
  * group_by=provider&
10821
10790
  * metrics=total_cost&
10791
+ * platform_key=web-app&
10822
10792
  * start_date=2025-01-01&
10823
10793
  * end_date=2025-01-07&
10824
10794
  * page=1&limit=10
@@ -10829,9 +10799,10 @@ class AiAnalyticsService {
10829
10799
  * GET /api/v2/analytics/financial/details?
10830
10800
  * group_by=username&
10831
10801
  * metrics=total_cost,sessions&
10802
+ * platform_key=web-app&
10832
10803
  * all_time=true&page=1&limit=50
10833
10804
  * ```
10834
- * 3. Cost by LLM model with tenant filter
10805
+ * 3. Cost by LLM model
10835
10806
  * ```
10836
10807
  * GET /api/v2/analytics/financial/details?
10837
10808
  * group_by=llm_model&
@@ -25065,10 +25036,11 @@ class AnalyticsService {
25065
25036
  * **Required query parameters**
25066
25037
  * - group_by – provider | llm_model | username | mentor | platform
25067
25038
  * - metrics – csv list of KPI names, e.g. total_cost, sessions
25039
+ * - platform_key – must match the token's platform (optional for service
25040
+ * accounts, which see every platform when it is omitted)
25068
25041
  *
25069
25042
  * **Shared optional filters**
25070
25043
  * - start_date, end_date – ISO yyyy-mm-dd (ignored when all_time=true)
25071
- * - platform_key – tenant isolation
25072
25044
  * - mentor_unique_id – filter to one agent
25073
25045
  * - username – filter to a learner
25074
25046
  * - provider / llm_model – filter to LLM provider / model
@@ -25082,6 +25054,7 @@ class AnalyticsService {
25082
25054
  * GET /api/v2/analytics/financial/details?
25083
25055
  * group_by=provider&
25084
25056
  * metrics=total_cost&
25057
+ * platform_key=web-app&
25085
25058
  * start_date=2025-01-01&
25086
25059
  * end_date=2025-01-07&
25087
25060
  * page=1&limit=10
@@ -25092,9 +25065,10 @@ class AnalyticsService {
25092
25065
  * GET /api/v2/analytics/financial/details?
25093
25066
  * group_by=username&
25094
25067
  * metrics=total_cost,sessions&
25068
+ * platform_key=web-app&
25095
25069
  * all_time=true&page=1&limit=50
25096
25070
  * ```
25097
- * 3. Cost by LLM model with tenant filter
25071
+ * 3. Cost by LLM model
25098
25072
  * ```
25099
25073
  * GET /api/v2/analytics/financial/details?
25100
25074
  * group_by=llm_model&
@@ -35986,76 +35960,6 @@ class CommerceService {
35986
35960
  }
35987
35961
  });
35988
35962
  }
35989
- /**
35990
- * Associate an Apple account with a user known user
35991
- * @returns AssociateAccountResponse
35992
- * @throws ApiError
35993
- */
35994
- static providersAppleAssociateAccountCreate({
35995
- requestBody
35996
- }) {
35997
- return request(OpenAPI, {
35998
- method: 'POST',
35999
- url: '/api/providers/apple/associate-account/',
36000
- body: requestBody,
36001
- mediaType: 'application/json'
36002
- });
36003
- }
36004
- /**
36005
- * View to handle apple webhooks
36006
- * @returns any No response body
36007
- * @throws ApiError
36008
- */
36009
- static providersAppleHookCreate() {
36010
- return request(OpenAPI, {
36011
- method: 'POST',
36012
- url: '/api/providers/apple/hook/'
36013
- });
36014
- }
36015
- /**
36016
- * Returns information about a user subscription status
36017
- * @returns AppleSubscriptionStatusView
36018
- * @throws ApiError
36019
- */
36020
- static providersAppleSubscriptionStatusCreate({
36021
- requestBody
36022
- }) {
36023
- return request(OpenAPI, {
36024
- method: 'POST',
36025
- url: '/api/providers/apple/subscription-status/',
36026
- body: requestBody,
36027
- mediaType: 'application/json'
36028
- });
36029
- }
36030
- /**
36031
- * Checks if a provided transaction_id is valid
36032
- * @returns BaseResponse
36033
- * @throws ApiError
36034
- */
36035
- static providersAppleValidateTransactionIdCreate({
36036
- requestBody
36037
- }) {
36038
- return request(OpenAPI, {
36039
- method: 'POST',
36040
- url: '/api/providers/apple/validate-transaction-id/',
36041
- body: requestBody,
36042
- mediaType: 'application/json'
36043
- });
36044
- }
36045
- /**
36046
- * Serves a view that redirects to the AWS marketplace create organization page
36047
- *
36048
- * Set CREATE_ORGANIZATION_URL in GlobalConfigurationFetcher to the
36049
- * URL of the AWS marketplace create organization page
36050
- * @returns any No response body
36051
- * @throws ApiError
36052
- */
36053
- static providersAwsCreateOrganizationCreate() {
36054
- return request(OpenAPI, {
36055
- method: 'POST',
36056
- url: '/api/providers/aws/create-organization/'
36057
- });
36058
- }
36059
35963
  /**
36060
35964
  * API endpoint to get domain setup status
36061
35965
  * @returns any No response body
@@ -36067,25 +35971,6 @@ class CommerceService {
36067
35971
  url: '/api/providers/aws/domain-status/'
36068
35972
  });
36069
35973
  }
36070
- /**
36071
- * Proxy to the Platform launch API
36072
- *
36073
- * We cannot expose launching a tenant to an authorized user hence the need for the API
36074
- *
36075
- * The API validates the x_amzn_marketplace_token and then proxies the request to the Platform Launch API
36076
- * @returns TenantLaunchResponse
36077
- * @throws ApiError
36078
- */
36079
- static providersAwsLaunchTenantCreate({
36080
- requestBody
36081
- }) {
36082
- return request(OpenAPI, {
36083
- method: 'POST',
36084
- url: '/api/providers/aws/launch-tenant/',
36085
- body: requestBody,
36086
- mediaType: 'application/json'
36087
- });
36088
- }
36089
35974
  /**
36090
35975
  * API endpoint to get/update CNAME records for domain setup
36091
35976
  * @returns any No response body
@@ -36108,124 +35993,6 @@ class CommerceService {
36108
35993
  url: '/api/providers/aws/sync-domain-records/'
36109
35994
  });
36110
35995
  }
36111
- /**
36112
- * Serves a view that redirects to the GCP marketplace create organization page
36113
- *
36114
- * Set CREATE_ORGANIZATION_URL in GlobalConfigurationFetcher to the URL of the GCP marketplace create organization
36115
- * page
36116
- * @returns any No response body
36117
- * @throws ApiError
36118
- */
36119
- static providersGcpCreateOrganizationCreate() {
36120
- return request(OpenAPI, {
36121
- method: 'POST',
36122
- url: '/api/providers/gcp/create-organization/'
36123
- });
36124
- }
36125
- /**
36126
- * Serves a view that redirects to the GCP marketplace create organization page
36127
- *
36128
- * Set CREATE_ORGANIZATION_URL in GlobalConfigurationFetcher to the URL of the GCP marketplace create organization
36129
- * page
36130
- * @returns any No response body
36131
- * @throws ApiError
36132
- */
36133
- static providersGcpCreateOrganizationCreate2({
36134
- productId
36135
- }) {
36136
- return request(OpenAPI, {
36137
- method: 'POST',
36138
- url: '/api/providers/gcp/create-organization/{product_id}/',
36139
- path: {
36140
- 'product_id': productId
36141
- }
36142
- });
36143
- }
36144
- /**
36145
- * @returns any No response body
36146
- * @throws ApiError
36147
- */
36148
- static providersGcpHookCreate() {
36149
- return request(OpenAPI, {
36150
- method: 'POST',
36151
- url: '/api/providers/gcp/hook/'
36152
- });
36153
- }
36154
- /**
36155
- * Proxy to the Platform launch API
36156
- *
36157
- * We cannot expose launching a tenant to an authorized user hence the need for the API
36158
- *
36159
- * The API validates the x_gcp_marketplace_token and then proxies the request to the Platform Launc API
36160
- * @returns TenantLaunchResponse
36161
- * @throws ApiError
36162
- */
36163
- static providersGcpLaunchTenantCreate({
36164
- requestBody
36165
- }) {
36166
- return request(OpenAPI, {
36167
- method: 'POST',
36168
- url: '/api/providers/gcp/launch-tenant/',
36169
- body: requestBody,
36170
- mediaType: 'application/json'
36171
- });
36172
- }
36173
- /**
36174
- * @returns VerifyGCPMarketPlaceResponse
36175
- * @throws ApiError
36176
- */
36177
- static providersGcpValidateSignupTokenCreate({
36178
- requestBody
36179
- }) {
36180
- return request(OpenAPI, {
36181
- method: 'POST',
36182
- url: '/api/providers/gcp/validate-signup-token/',
36183
- body: requestBody,
36184
- mediaType: 'application/json'
36185
- });
36186
- }
36187
- /**
36188
- * Google Allows us to pass an obfuscated account id to be sent to during a subscription purchase
36189
- * @returns GooglePayAccountResponse
36190
- * @throws ApiError
36191
- */
36192
- static providersGooglePayGetAccountRetrieve({
36193
- bundleId
36194
- }) {
36195
- return request(OpenAPI, {
36196
- method: 'GET',
36197
- url: '/api/providers/google-pay/get-account/{bundle_id}',
36198
- path: {
36199
- 'bundle_id': bundleId
36200
- }
36201
- });
36202
- }
36203
- /**
36204
- * View to handle Google Pay webhooks
36205
- * @returns any No response body
36206
- * @throws ApiError
36207
- */
36208
- static providersGooglePayHookCreate() {
36209
- return request(OpenAPI, {
36210
- method: 'POST',
36211
- url: '/api/providers/google-pay/hook/'
36212
- });
36213
- }
36214
- /**
36215
- * Associate a Google Pay account with a known user
36216
- * @returns BaseResponse
36217
- * @throws ApiError
36218
- */
36219
- static providersGooglePayValidateTransactionIdCreate({
36220
- requestBody
36221
- }) {
36222
- return request(OpenAPI, {
36223
- method: 'POST',
36224
- url: '/api/providers/google-pay/validate-transaction-id/',
36225
- body: requestBody,
36226
- mediaType: 'application/json'
36227
- });
36228
- }
36229
35996
  /**
36230
35997
  * Proxy to the Platform launch API
36231
35998
  *
@@ -36268,15 +36035,11 @@ class CommerceService {
36268
36035
  /**
36269
36036
  * User/tenant creation API
36270
36037
  *
36271
- * To create using any payment provider, ensure you use the StudentToken Authentication Mechanism
36272
- * and also include the correct `provider_key` in the request body:
36038
+ * To create using the payment provider, ensure you use the StudentToken Authentication Mechanism
36039
+ * and also include the `provider_key` in the request body:
36273
36040
  *
36274
36041
  * ```
36275
- * apple_transaction_id: str
36276
36042
  * stripe_checkout_id: str
36277
- * x_gcp_marketplace_token: str
36278
- * aws_transaction_id: str
36279
- * google_pay_transaction_id: str
36280
36043
  * ```
36281
36044
  *
36282
36045
  * To create a tenant without a payment provider, call the API without ny of the above provider keys in the request body
@@ -50625,11 +50388,12 @@ class V1AnalyticsService {
50625
50388
  * Response: Available filter options for chat message history.
50626
50389
  *
50627
50390
  * Raises:
50628
- * NotFound: If the specified organization does not exist.
50391
+ * PermissionDenied: If `org` is not the token's platform.
50392
+ * NotFound: If the organization or mentor does not exist.
50629
50393
  *
50630
50394
  * Query Parameters:
50631
50395
  * monthly_range (bool): Whether to return monthly or weekly date ranges.
50632
- * mentor_id (str): Filter users by those who have chatted with a specific mentor.
50396
+ * mentor_id (str): Narrow topics, date ranges and users to one mentor.
50633
50397
  * @returns ChatHistoryFilterData
50634
50398
  * @throws ApiError
50635
50399
  */
@@ -50649,7 +50413,8 @@ class V1AnalyticsService {
50649
50413
  'start_date': startDate
50650
50414
  },
50651
50415
  errors: {
50652
- 404: `Organization not found`
50416
+ 403: `org is not the token's platform, or no ChatHistory list grant`,
50417
+ 404: `Organization or mentor not found`
50653
50418
  }
50654
50419
  });
50655
50420
  }