@iblai/web-utils 0.2.0 → 0.3.0
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/dist/data-layer/src/core/index.d.ts +2 -1
- package/dist/data-layer/src/features/analytics/api-slice.d.ts +1879 -122
- package/dist/data-layer/src/features/analytics/constants.d.ts +56 -1
- package/dist/data-layer/src/features/analytics/types.d.ts +327 -1
- package/dist/data-layer/src/features/api-keys/api-slice.d.ts +59 -70
- package/dist/data-layer/src/features/apps/api-slice.d.ts +73 -84
- package/dist/data-layer/src/features/auth/api-slice.d.ts +504 -2
- package/dist/data-layer/src/features/auth/constants.d.ts +13 -1
- package/dist/data-layer/src/features/auth/types.d.ts +20 -0
- package/dist/data-layer/src/features/billing/api-slice.d.ts +33 -33
- package/dist/data-layer/src/features/career/api-slice.d.ts +2345 -180
- package/dist/data-layer/src/features/catalog/api-slice.d.ts +2578 -562
- package/dist/data-layer/src/features/chat/api-slice.d.ts +150 -150
- package/dist/data-layer/src/features/chat-history/api-slice.d.ts +134 -134
- package/dist/data-layer/src/features/core/api-slice.d.ts +3484 -75
- package/dist/data-layer/src/features/core/constants.d.ts +40 -0
- package/dist/data-layer/src/features/core/custom-api-slice.d.ts +1458 -0
- package/dist/data-layer/src/features/core/types.d.ts +27 -0
- package/dist/data-layer/src/features/credentials/api-slice.d.ts +859 -221
- package/dist/data-layer/src/features/custom-domain/api-slice.d.ts +602 -0
- package/dist/data-layer/src/features/custom-domain/constants.d.ts +20 -0
- package/dist/data-layer/src/features/custom-domain/types.d.ts +46 -0
- package/dist/data-layer/src/features/datasets/api-slice.d.ts +56 -56
- package/dist/data-layer/src/features/disclaimers/api-slice.d.ts +912 -0
- package/dist/data-layer/src/features/disclaimers/constants.d.ts +27 -0
- package/dist/data-layer/src/features/disclaimers/types.d.ts +67 -0
- package/dist/data-layer/src/features/edx-proctoring/api-slice.d.ts +590 -0
- package/dist/data-layer/src/features/edx-proctoring/constants.d.ts +15 -0
- package/dist/data-layer/src/features/edx-proctoring/types.d.ts +61 -0
- package/dist/data-layer/src/features/llms/api-slice.d.ts +40 -40
- package/dist/data-layer/src/features/memory/api-slice.d.ts +2129 -0
- package/dist/data-layer/src/features/memory/constants.d.ts +50 -0
- package/dist/data-layer/src/features/memory/types.d.ts +122 -0
- package/dist/data-layer/src/features/mentor/api-slice.d.ts +1176 -470
- package/dist/data-layer/src/features/mentor/constants.d.ts +8 -0
- package/dist/data-layer/src/features/mentor/custom-api-slice.d.ts +529 -1
- package/dist/data-layer/src/features/mentor/types.d.ts +39 -0
- package/dist/data-layer/src/features/mentor-categories/api-slice.d.ts +436 -40
- package/dist/data-layer/src/features/notifications/api-slice.d.ts +750 -96
- package/dist/data-layer/src/features/notifications/constants.d.ts +20 -0
- package/dist/data-layer/src/features/notifications/custom-api-slice.d.ts +996 -0
- package/dist/data-layer/src/features/notifications/types.d.ts +46 -0
- package/dist/data-layer/src/features/per-learner/api-slice.d.ts +118 -118
- package/dist/data-layer/src/features/platform/api-slice.d.ts +345 -191
- package/dist/data-layer/src/features/platform/constants.d.ts +17 -0
- package/dist/data-layer/src/features/platform/custom-api-slice.d.ts +493 -0
- package/dist/data-layer/src/features/platform/types.d.ts +48 -0
- package/dist/data-layer/src/features/projects/api-slice.d.ts +2026 -0
- package/dist/data-layer/src/features/projects/constants.d.ts +51 -0
- package/dist/data-layer/src/features/projects/types.d.ts +79 -0
- package/dist/data-layer/src/features/prompts/api-slice.d.ts +193 -171
- package/dist/data-layer/src/features/reports/api-slice.d.ts +814 -0
- package/dist/data-layer/src/features/search/ai-search-api-slice.d.ts +1015 -0
- package/dist/data-layer/src/features/search/api-slice.d.ts +59 -59
- package/dist/data-layer/src/features/search/constants.d.ts +31 -0
- package/dist/data-layer/src/features/search/types.d.ts +89 -0
- package/dist/data-layer/src/features/sessions/api-slice.d.ts +72 -72
- package/dist/data-layer/src/features/skills/api-slice.d.ts +157 -157
- package/dist/data-layer/src/features/stripe/api-slice.d.ts +201 -40
- package/dist/data-layer/src/features/stripe/constants.d.ts +5 -1
- package/dist/data-layer/src/features/stripe/types.d.ts +10 -0
- package/dist/data-layer/src/features/tenant/api-slice.d.ts +77 -86
- package/dist/data-layer/src/features/tenant/types.d.ts +1 -0
- package/dist/data-layer/src/features/tools/api-slice.d.ts +84 -40
- package/dist/data-layer/src/features/training-documents/api-slice.d.ts +582 -75
- package/dist/data-layer/src/features/user/api-slice.d.ts +124 -124
- package/dist/data-layer/src/features/user/constants.d.ts +3 -1
- package/dist/data-layer/src/features/user-invitations/api-slice.d.ts +56 -56
- package/dist/data-layer/src/features/utils.d.ts +8 -5
- package/dist/data-layer/src/index.d.ts +75 -47
- package/dist/data-layer/src/reducers/skills.d.ts +2 -1148
- package/dist/data-layer/src/services/StorageService.d.ts +1 -1
- package/dist/index.d.ts +1021 -5
- package/dist/index.esm.js +3299 -453
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +3305 -448
- package/dist/index.js.map +1 -1
- package/dist/package.json +34 -18
- package/dist/web-utils/src/features/chat/slice.d.ts +12 -0
- package/dist/web-utils/src/features/index.d.ts +1 -0
- package/dist/web-utils/src/features/tracking/__tests__/time-tracker.test.d.ts +1 -0
- package/dist/web-utils/src/features/tracking/examples.d.ts +4 -0
- package/dist/web-utils/src/features/tracking/index.d.ts +6 -0
- package/dist/web-utils/src/features/tracking/time-tracker.d.ts +29 -0
- package/dist/web-utils/src/features/tracking/use-time-tracker-native.d.ts +14 -0
- package/dist/web-utils/src/features/tracking/use-time-tracker.d.ts +14 -0
- package/dist/web-utils/src/hooks/chat/use-advanced-chat.d.ts +2 -2
- package/dist/web-utils/src/hooks/chat/use-chat-v2.d.ts +9 -1
- package/dist/web-utils/src/hooks/chat/use-get-chat-details.d.ts +2 -1
- package/dist/web-utils/src/hooks/chat/use-mentor-tools.d.ts +3 -0
- package/dist/web-utils/src/hooks/index.d.ts +1 -0
- package/dist/web-utils/src/hooks/subscription/class-subscription-flow.d.ts +6 -6
- package/dist/web-utils/src/hooks/subscription-v2/class-subscription-flow.d.ts +9 -8
- package/dist/web-utils/src/hooks/subscription-v2/use-external-pricing-plan.d.ts +1 -1
- package/dist/web-utils/src/hooks/tenant-metadata/use-tenant-metadata.d.ts +2 -1
- package/dist/web-utils/src/hooks/use-mentor-settings.d.ts +1 -0
- package/dist/web-utils/src/index.mobile.d.ts +10 -0
- package/dist/web-utils/src/index.web.d.ts +12 -0
- package/dist/web-utils/src/providers/auth-provider.d.ts +55 -1
- package/dist/web-utils/src/providers/mentor-provider.d.ts +3 -1
- package/dist/web-utils/src/providers/tenant-provider.d.ts +10 -5
- package/dist/web-utils/src/types/index.d.ts +9 -0
- package/dist/web-utils/src/utils/constants.d.ts +4 -0
- package/dist/web-utils/src/utils/helpers.d.ts +1 -0
- package/dist/web-utils/src/utils/platform.d.ts +7 -0
- package/dist/web-utils/tests/hooks/subscription/class-subscription-flow.test.d.ts +1 -0
- package/dist/web-utils/tests/hooks/subscription/constants.test.d.ts +1 -0
- package/dist/web-utils/tests/hooks/subscription/use-subscription-handler.test.d.ts +1 -0
- package/dist/web-utils/tests/hooks/use-day-js.test.d.ts +1 -0
- package/dist/web-utils/tests/setupTests.d.ts +5 -0
- package/dist/web-utils/tsconfig.tsbuildinfo +1 -0
- package/package.json +37 -22
- package/dist/features/chat/slice.d.ts +0 -59
- package/dist/features/index.d.ts +0 -1
- package/dist/hooks/chat/use-advanced-chat.d.ts +0 -41
- package/dist/hooks/chat/use-chat-v2.d.ts +0 -53
- package/dist/hooks/chat/use-chat.d.ts +0 -52
- package/dist/hooks/chat/use-get-chat-details.d.ts +0 -13
- package/dist/hooks/index.d.ts +0 -10
- package/dist/hooks/subscription/class-subscription-flow.d.ts +0 -70
- package/dist/hooks/subscription/constants.d.ts +0 -4
- package/dist/hooks/subscription/use-subscription-handler.d.ts +0 -11
- package/dist/hooks/subscription-v2/class-subscription-flow.d.ts +0 -62
- package/dist/hooks/subscription-v2/constants.d.ts +0 -5
- package/dist/hooks/subscription-v2/use-external-pricing-plan.d.ts +0 -7
- package/dist/hooks/subscription-v2/use-subscription-handler.d.ts +0 -12
- package/dist/hooks/use-day-js.d.ts +0 -7
- package/dist/providers/auth-provider.d.ts +0 -63
- package/dist/providers/index.d.ts +0 -3
- package/dist/providers/mentor-provider.d.ts +0 -40
- package/dist/providers/tenant-provider.d.ts +0 -60
- package/dist/types/chat.d.ts +0 -1
- package/dist/types/index.d.ts +0 -55
- package/dist/types/subscription.d.ts +0 -18
- package/dist/utils/constants.d.ts +0 -13
- package/dist/utils/data/advanced-tab.d.ts +0 -62
- package/dist/utils/helpers.d.ts +0 -1
- package/dist/utils/index.d.ts +0 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,1021 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { FreeUsageCount, StripeCustomerPortalRequest } from '@iblai/iblai-api';
|
|
2
|
+
import { StripeContextResponse, UploadProfileImageResponse, RemoveProfileImageResponse, StorageService, TokenResponse } from '@iblai/data-layer';
|
|
3
|
+
import * as React$1 from 'react';
|
|
4
|
+
import React__default from 'react';
|
|
5
|
+
import { PricingModalData as PricingModalData$1 } from '@web-utils/types/subscription';
|
|
6
|
+
import { OpUnitType } from 'dayjs';
|
|
7
|
+
import duration from 'dayjs/plugin/duration';
|
|
8
|
+
import { ChatStatus as ChatStatus$1 } from '@web-utils/features';
|
|
9
|
+
import * as _reduxjs_toolkit from '@reduxjs/toolkit';
|
|
10
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
11
|
+
import { Tenant as Tenant$3 } from '@web-utils/types';
|
|
12
|
+
import { z } from 'zod';
|
|
13
|
+
|
|
14
|
+
interface Tenant$2 {
|
|
15
|
+
key: string;
|
|
16
|
+
is_admin: boolean;
|
|
17
|
+
org: string;
|
|
18
|
+
}
|
|
19
|
+
interface SubscriptionFlowConfig {
|
|
20
|
+
platformName: string;
|
|
21
|
+
currentTenantKey: string;
|
|
22
|
+
username: string;
|
|
23
|
+
currentTenantOrg: string;
|
|
24
|
+
userTenants: Tenant$2[];
|
|
25
|
+
isAdmin: boolean;
|
|
26
|
+
mainTenantKey: string;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* SubscriptionFlow class manages all subscription-related flows and user interactions
|
|
30
|
+
* Handles free trial, usage limits, and subscription management
|
|
31
|
+
*/
|
|
32
|
+
declare abstract class SubscriptionFlow {
|
|
33
|
+
protected platformName: string;
|
|
34
|
+
protected currentTenantKey: string;
|
|
35
|
+
protected username: string;
|
|
36
|
+
protected currentTenantOrg: string;
|
|
37
|
+
protected userTenants: Tenant$2[];
|
|
38
|
+
protected isAdmin: boolean;
|
|
39
|
+
protected mainTenantKey: string;
|
|
40
|
+
constructor(config: SubscriptionFlowConfig);
|
|
41
|
+
getPlatformName(): string;
|
|
42
|
+
getCurrentTenantKey(): string;
|
|
43
|
+
getUsername(): string;
|
|
44
|
+
getCurrentTenantOrg(): string;
|
|
45
|
+
getUserTenants(): Tenant$2[];
|
|
46
|
+
isUserAdmin(): boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Handles the flow when user reaches their free usage limit
|
|
49
|
+
* Updates banner with appropriate message based on remaining usage count
|
|
50
|
+
*/
|
|
51
|
+
abstract handleFreeUsageCountFlow(freeUsageCount: FreeUsageCount): void;
|
|
52
|
+
/**
|
|
53
|
+
* Handles the flow when user's free trial period has ended
|
|
54
|
+
* Updates banner and clears any existing trial interval
|
|
55
|
+
*/
|
|
56
|
+
abstract handleTrialEndedFlow(freeTrialIntervalID?: number): void;
|
|
57
|
+
/**
|
|
58
|
+
* Handles the flow for ongoing subscription period
|
|
59
|
+
* Updates banner with remaining trial time and subscription options
|
|
60
|
+
*/
|
|
61
|
+
abstract handleSubscriptionOnGoingFlow(timeRemainingInString: string): void;
|
|
62
|
+
/**
|
|
63
|
+
* Handles redirection to external URLs with optional toast notification
|
|
64
|
+
*/
|
|
65
|
+
abstract handleRedirectToURLFlow(redirectUrl: string, toastMessage?: string): void;
|
|
66
|
+
/**
|
|
67
|
+
* Displays the pricing modal for subscription options
|
|
68
|
+
*/
|
|
69
|
+
handlePricingPageDisplayFlow(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Handles the pre-subscription state
|
|
72
|
+
* Updates banner to show loading state
|
|
73
|
+
*/
|
|
74
|
+
handleBeforeSubscribeUserTriggerFlow(): void;
|
|
75
|
+
/**
|
|
76
|
+
* Handles successful subscription completion
|
|
77
|
+
* Shows success message and disables subscription banner
|
|
78
|
+
*/
|
|
79
|
+
abstract handleSuccessfullySubscribedFlow(message?: string): void;
|
|
80
|
+
getMainTenantKey(): string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Hook to handle subscription logic
|
|
85
|
+
* @param subscriptionFlow Instance of SubscriptionFlow that manages different subscription states and actions
|
|
86
|
+
*/
|
|
87
|
+
declare const useSubscriptionHandler: (subscriptionFlow: SubscriptionFlow) => {
|
|
88
|
+
handleSubscriptionCheck: () => Promise<void>;
|
|
89
|
+
handleIntervalSubscriptionCheck: () => (() => void) | undefined;
|
|
90
|
+
trialCounterStarted: boolean;
|
|
91
|
+
bannerButtonTriggerCallback: (trigger: string) => () => void;
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
declare const SUBSCRIPTION_TRIGGERS: {
|
|
95
|
+
PRICING_MODAL: string;
|
|
96
|
+
SUBSCRIBE_USER: string;
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
interface Tenant$1 {
|
|
100
|
+
key: string;
|
|
101
|
+
is_admin: boolean;
|
|
102
|
+
org: string;
|
|
103
|
+
is_advertising?: boolean;
|
|
104
|
+
}
|
|
105
|
+
interface SubscriptionFlowConfigV2 {
|
|
106
|
+
platformName: string;
|
|
107
|
+
currentTenantKey: string;
|
|
108
|
+
username: string;
|
|
109
|
+
currentTenantOrg: string;
|
|
110
|
+
userTenants: Tenant$1[];
|
|
111
|
+
isAdmin: boolean;
|
|
112
|
+
mainTenantKey: string;
|
|
113
|
+
userEmail: string;
|
|
114
|
+
mentorUrl: string;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* SubscriptionFlow class manages all subscription-related flows and user interactions
|
|
118
|
+
* Handles free trial, usage limits, and subscription management
|
|
119
|
+
*/
|
|
120
|
+
declare abstract class SubscriptionFlowV2 {
|
|
121
|
+
protected platformName: string;
|
|
122
|
+
protected currentTenantKey: string;
|
|
123
|
+
protected username: string;
|
|
124
|
+
protected currentTenantOrg: string;
|
|
125
|
+
protected userTenants: Tenant$1[];
|
|
126
|
+
protected isAdmin: boolean;
|
|
127
|
+
protected mainTenantKey: string;
|
|
128
|
+
protected userEmail: string;
|
|
129
|
+
protected mentorUrl: string;
|
|
130
|
+
constructor(config: SubscriptionFlowConfigV2);
|
|
131
|
+
getPlatformName(): string;
|
|
132
|
+
getCurrentTenantKey(): string;
|
|
133
|
+
getUsername(): string;
|
|
134
|
+
getCurrentTenantOrg(): string;
|
|
135
|
+
getUserTenants(): Tenant$1[];
|
|
136
|
+
isUserAdmin(): boolean;
|
|
137
|
+
getUserEmail(): string;
|
|
138
|
+
getMainTenantKey(): string;
|
|
139
|
+
getMentorUrl(): string;
|
|
140
|
+
abstract handleRedirectToBillingPageFlow(billingUrl: string): void;
|
|
141
|
+
handleBeforeTopUpCreditTriggerFlow(): void;
|
|
142
|
+
handleBeforeBillingPageTriggerFlow(): void;
|
|
143
|
+
/**
|
|
144
|
+
* Handles the flow when user reaches their free usage limit
|
|
145
|
+
* Updates banner with appropriate message based on remaining usage count
|
|
146
|
+
*/
|
|
147
|
+
abstract handleFreeUsageCountFlow(hasCredits: boolean, appExists: boolean): void;
|
|
148
|
+
/**
|
|
149
|
+
* Displays the pricing modal for subscription options
|
|
150
|
+
*/
|
|
151
|
+
abstract handlePricingPageDisplayFlow(stripeContext: StripeContextResponse, creditExhausted: boolean): void;
|
|
152
|
+
/**
|
|
153
|
+
* Displays error notification when payment flow fails
|
|
154
|
+
*/
|
|
155
|
+
handleFailureOnPaymentFlow(): void;
|
|
156
|
+
handleBeforePricingPageDisplayFlow(): void;
|
|
157
|
+
handleFailureOnTopUpCreditTriggerFlow(): void;
|
|
158
|
+
handlePaidPlanCreditExhaustedFlow(): void;
|
|
159
|
+
handleProPlanCreditExhaustedFlow(): void;
|
|
160
|
+
handleStudentOnPaidPlanCreditExhaustedFlow(): void;
|
|
161
|
+
abstract handleOpenContactAdminFlow(adminEmail: string): void;
|
|
162
|
+
abstract handleCreditExhaustedWithUserOnFreePackageFlow({ subscriptionId, expiryDate, }: {
|
|
163
|
+
subscriptionId: string;
|
|
164
|
+
expiryDate: string;
|
|
165
|
+
}): void;
|
|
166
|
+
abstract handleCreditExhaustedWithUserOnStarterPackageFlow({ subscriptionId, expiryDate, }: {
|
|
167
|
+
subscriptionId: string;
|
|
168
|
+
expiryDate: string;
|
|
169
|
+
}): void;
|
|
170
|
+
abstract handleCreditExhaustedWithUserOnProPackageFlow({ expiryDate, }: {
|
|
171
|
+
expiryDate: string;
|
|
172
|
+
}): void;
|
|
173
|
+
handleFailureOnBillingPageTriggerFlow(): void;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* Hook to handle subscription logic
|
|
178
|
+
* @param subscriptionFlow Instance of SubscriptionFlow that manages different subscription states and actions
|
|
179
|
+
*/
|
|
180
|
+
declare const useSubscriptionHandlerV2: (subscriptionFlow: SubscriptionFlowV2) => {
|
|
181
|
+
handleSubscriptionCheck: () => Promise<void>;
|
|
182
|
+
bannerButtonTriggerCallback: (trigger: string) => ((returnURL?: string) => Promise<void>) | (() => void);
|
|
183
|
+
CREDIT_INTERVAL_CHECK_COUNTER: number;
|
|
184
|
+
getBillingURL: ({ returnURL, includeSubscriptionIdIfNeeded, }: {
|
|
185
|
+
returnURL: string;
|
|
186
|
+
includeSubscriptionIdIfNeeded?: boolean;
|
|
187
|
+
}) => Promise<string | null | undefined>;
|
|
188
|
+
getTopUpURL: (obtainBillingPageURLIfNeeded?: boolean) => Promise<string | null | undefined>;
|
|
189
|
+
getUserSubscriptionPackage: () => Promise<string | null>;
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
declare const useExternalPricingPlan: ({ pricingModalData, userEmail, }: {
|
|
193
|
+
pricingModalData: PricingModalData$1;
|
|
194
|
+
userEmail: string;
|
|
195
|
+
}) => {
|
|
196
|
+
pricingBoxIframeRef: React$1.RefObject<null>;
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
declare const SUBSCRIPTION_V2_TRIGGERS: {
|
|
200
|
+
PRICING_MODAL: string;
|
|
201
|
+
TOP_UP_CREDIT: string;
|
|
202
|
+
CONTACT_ADMIN: string;
|
|
203
|
+
BILLING_PAGE: string;
|
|
204
|
+
};
|
|
205
|
+
declare const SUBSCRIPTION_MESSAGES: {
|
|
206
|
+
CREDIT_EXHAUSTED: {
|
|
207
|
+
FREE_PACKAGE: ({ expiryDate }: {
|
|
208
|
+
expiryDate: string;
|
|
209
|
+
}) => string;
|
|
210
|
+
STARTER_PACKAGE: ({ expiryDate }: {
|
|
211
|
+
expiryDate: string;
|
|
212
|
+
}) => string;
|
|
213
|
+
PRO_PACKAGE: ({ expiryDate }: {
|
|
214
|
+
expiryDate: string;
|
|
215
|
+
}) => string;
|
|
216
|
+
STUDENT_UNDER_PAID_PACKAGE_EMAIL_BODY: ({ currentTenantOrg, userEmail, }: {
|
|
217
|
+
currentTenantOrg: string;
|
|
218
|
+
userEmail: string;
|
|
219
|
+
}) => string;
|
|
220
|
+
STUDENT_UNDER_PAID_PACKAGE_EMAIL_SUBJECT: ({ currentTenantOrg, }: {
|
|
221
|
+
currentTenantOrg: string;
|
|
222
|
+
}) => string;
|
|
223
|
+
ADMIN: string;
|
|
224
|
+
STUDENT: string;
|
|
225
|
+
FREE_TRIAL_LIMIT: string;
|
|
226
|
+
NO_APP: string;
|
|
227
|
+
};
|
|
228
|
+
ACTION_BUTTONS: {
|
|
229
|
+
FREE_PACKAGE: string;
|
|
230
|
+
STARTER_PACKAGE: string;
|
|
231
|
+
PRO_PACKAGE: string;
|
|
232
|
+
UPGRADE: string;
|
|
233
|
+
TOP_UP: string;
|
|
234
|
+
CONTACT_ADMIN: string;
|
|
235
|
+
ADD_CREDITS: string;
|
|
236
|
+
};
|
|
237
|
+
TOAST_MESSAGES: {
|
|
238
|
+
PRICING_PAGE_LOAD_ERROR: string;
|
|
239
|
+
TOP_UP_CREDIT_TRIGGER_LOAD_ERROR: string;
|
|
240
|
+
REDIRECTING_BILLING_PAGE: string;
|
|
241
|
+
BILLING_PAGE_TRIGGER_LOAD_ERROR: string;
|
|
242
|
+
};
|
|
243
|
+
};
|
|
244
|
+
declare const SUBSCRIPTION_PACKAGES: {
|
|
245
|
+
PRE_FREE_PACKAGE: string;
|
|
246
|
+
FREE_PACKAGE: (productName: string) => string;
|
|
247
|
+
STARTER_PACKAGE: (productName: string) => string;
|
|
248
|
+
PRO_PACKAGE: (productName: string) => string;
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
declare const useDayJs: () => {
|
|
252
|
+
getTimeDifferenceBetweenTwoDates: (futureDate: string, pastDate: string, format?: OpUnitType) => number;
|
|
253
|
+
getDayJSDurationObjFromSeconds: (seconds: number) => duration.Duration;
|
|
254
|
+
generateFutureDateForNMinutes: (minute?: number) => string;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
declare const advancedTabsProperties: {
|
|
258
|
+
chat: {
|
|
259
|
+
display: string;
|
|
260
|
+
name: string;
|
|
261
|
+
tag: string;
|
|
262
|
+
showHeader: boolean;
|
|
263
|
+
prompts: {
|
|
264
|
+
type: string;
|
|
265
|
+
icon: string;
|
|
266
|
+
summary: string;
|
|
267
|
+
content: string;
|
|
268
|
+
}[];
|
|
269
|
+
};
|
|
270
|
+
summarize: {
|
|
271
|
+
display: string;
|
|
272
|
+
showHeader: boolean;
|
|
273
|
+
name: string;
|
|
274
|
+
tag: string;
|
|
275
|
+
prompts: {
|
|
276
|
+
type: string;
|
|
277
|
+
proactive: boolean;
|
|
278
|
+
hide: boolean;
|
|
279
|
+
content: string;
|
|
280
|
+
}[];
|
|
281
|
+
};
|
|
282
|
+
translate: {
|
|
283
|
+
display: string;
|
|
284
|
+
showHeader: boolean;
|
|
285
|
+
name: string;
|
|
286
|
+
tag: string;
|
|
287
|
+
description: string;
|
|
288
|
+
metaDescription: string;
|
|
289
|
+
prompts: ({
|
|
290
|
+
type: string;
|
|
291
|
+
hide: boolean;
|
|
292
|
+
tag: string;
|
|
293
|
+
summary: string;
|
|
294
|
+
content: string;
|
|
295
|
+
} | {
|
|
296
|
+
type: string;
|
|
297
|
+
summary: string;
|
|
298
|
+
content: string;
|
|
299
|
+
hide?: undefined;
|
|
300
|
+
tag?: undefined;
|
|
301
|
+
})[];
|
|
302
|
+
};
|
|
303
|
+
expand: {
|
|
304
|
+
display: string;
|
|
305
|
+
showHeader: boolean;
|
|
306
|
+
name: string;
|
|
307
|
+
tag: string;
|
|
308
|
+
prompts: {
|
|
309
|
+
type: string;
|
|
310
|
+
proactive: boolean;
|
|
311
|
+
hide: boolean;
|
|
312
|
+
content: string;
|
|
313
|
+
}[];
|
|
314
|
+
};
|
|
315
|
+
};
|
|
316
|
+
declare const advancedTabs: ("chat" | "summarize" | "translate" | "expand")[];
|
|
317
|
+
type AdvancedTab = keyof typeof advancedTabsProperties;
|
|
318
|
+
declare const translatePrompt: (language: string) => string;
|
|
319
|
+
|
|
320
|
+
type MessageActionTypes = "redirectToAuthSpaJoinTenant";
|
|
321
|
+
interface MessageAction {
|
|
322
|
+
text: string;
|
|
323
|
+
type: "primary" | "danger";
|
|
324
|
+
actionType: MessageActionTypes;
|
|
325
|
+
}
|
|
326
|
+
interface Message {
|
|
327
|
+
id: string;
|
|
328
|
+
role: "user" | "assistant" | "system";
|
|
329
|
+
content: string;
|
|
330
|
+
timestamp: string;
|
|
331
|
+
url?: string;
|
|
332
|
+
fileType?: string;
|
|
333
|
+
contentType?: string;
|
|
334
|
+
visible: boolean;
|
|
335
|
+
actions?: MessageAction[];
|
|
336
|
+
}
|
|
337
|
+
type SendMessageOptions = {
|
|
338
|
+
visible?: boolean;
|
|
339
|
+
} | undefined;
|
|
340
|
+
interface UseChatProps {
|
|
341
|
+
wsUrl: string;
|
|
342
|
+
wsToken: string;
|
|
343
|
+
flowConfig: {
|
|
344
|
+
name: string;
|
|
345
|
+
tenant: string;
|
|
346
|
+
username: string;
|
|
347
|
+
pathway: string;
|
|
348
|
+
};
|
|
349
|
+
sessionId: string;
|
|
350
|
+
stopGenerationWsUrl: string;
|
|
351
|
+
activeTab: AdvancedTab;
|
|
352
|
+
enableHaptics?: boolean;
|
|
353
|
+
hapticFeedback?: {
|
|
354
|
+
impactAsync: (style: any) => Promise<void>;
|
|
355
|
+
};
|
|
356
|
+
redirectToAuthSpa: () => void;
|
|
357
|
+
store?: {
|
|
358
|
+
sendMessage?: (text: string) => Promise<void>;
|
|
359
|
+
};
|
|
360
|
+
WebSocketImpl?: typeof WebSocket;
|
|
361
|
+
errorHandler?: (message: string, error?: any) => void;
|
|
362
|
+
onStatusChange: (status: ChatStatus$1) => void;
|
|
363
|
+
onStreamingChange: (streaming: boolean) => void;
|
|
364
|
+
onStreamingMessageUpdate: (message: {
|
|
365
|
+
id: string | null;
|
|
366
|
+
content: string;
|
|
367
|
+
}) => void;
|
|
368
|
+
onAddUserMessage?: (activeTab: AdvancedTab, message: Message) => void;
|
|
369
|
+
sendMessageToParentWebsite?: (payload: unknown) => void;
|
|
370
|
+
on402Error?: (message: Record<string, unknown>) => void;
|
|
371
|
+
}
|
|
372
|
+
interface UseChatReturn {
|
|
373
|
+
sendMessage: (tab: AdvancedTab, text: string, options?: SendMessageOptions) => Promise<void>;
|
|
374
|
+
ws: React.MutableRefObject<WebSocket | null>;
|
|
375
|
+
isConnected: React.MutableRefObject<boolean>;
|
|
376
|
+
messageQueue: React.MutableRefObject<any[]>;
|
|
377
|
+
stopGenerating: () => void;
|
|
378
|
+
resetConnection: () => void;
|
|
379
|
+
}
|
|
380
|
+
declare const useChat: ({ wsUrl, wsToken, flowConfig, sessionId, stopGenerationWsUrl, enableHaptics, hapticFeedback, store, errorHandler, onStatusChange, onStreamingChange, onStreamingMessageUpdate, WebSocketImpl, redirectToAuthSpa, sendMessageToParentWebsite, on402Error, }: UseChatProps) => UseChatReturn;
|
|
381
|
+
|
|
382
|
+
declare const MENTOR_CHAT_DOCUMENTS_EXTENSIONS: string[];
|
|
383
|
+
declare const ANONYMOUS_USERNAME = "anonymous";
|
|
384
|
+
declare const MAX_INITIAL_WEBSOCKET_CONNECTION_ATTEMPTS = 3;
|
|
385
|
+
declare const LOCAL_STORAGE_KEYS: {
|
|
386
|
+
CURRENT_TENANT: string;
|
|
387
|
+
TENANTS: string;
|
|
388
|
+
REDIRECT_TO: string;
|
|
389
|
+
AUTH_TOKEN: string;
|
|
390
|
+
TOKEN_EXPIRY: string;
|
|
391
|
+
USER_DATA: string;
|
|
392
|
+
USER_TENANTS: string;
|
|
393
|
+
EDX_TOKEN_KEY: string;
|
|
394
|
+
DM_TOKEN_KEY: string;
|
|
395
|
+
DM_TOKEN_EXPIRES: string;
|
|
396
|
+
};
|
|
397
|
+
declare const TOOLS: {
|
|
398
|
+
readonly WEB_SEARCH: "web-search";
|
|
399
|
+
readonly WIKIPEDIA_SEARCH: "wikipedia-search";
|
|
400
|
+
readonly COURSE_CREATION: "course-creation";
|
|
401
|
+
readonly MCP: "mcp";
|
|
402
|
+
readonly IMAGE_GENERATION: "image-generation";
|
|
403
|
+
readonly IBL_PATHWAY_DOCUMENTS_RETRIEVER: "ibl-pathway-documents-retriever";
|
|
404
|
+
readonly TRAINED_DOCUMENTS: "trained-documents";
|
|
405
|
+
readonly IBL_SESSION_DOCUMENTS_RETRIEVER: "ibl-session-documents-retriever";
|
|
406
|
+
readonly PLAYWRIGHT_BROWSER: "playwright-browser";
|
|
407
|
+
readonly HUMAN_SUPPORT: "human-support";
|
|
408
|
+
readonly CODE_INTERPRETER: "code-interpreter";
|
|
409
|
+
readonly DEEP_RESEARCH: "deep-research";
|
|
410
|
+
readonly MEMORY: "memory";
|
|
411
|
+
readonly SCREEN_SHARE: "screen-share";
|
|
412
|
+
readonly POWERPOINT: "powerpoint";
|
|
413
|
+
readonly PROMPT: "prompt";
|
|
414
|
+
readonly QUIZ: "quiz";
|
|
415
|
+
readonly RUBRIC: "rubric";
|
|
416
|
+
readonly RESOURCE: "resource";
|
|
417
|
+
readonly LESSON_PLAN: "lesson-plan";
|
|
418
|
+
readonly SYLLABUS: "syllabus";
|
|
419
|
+
readonly CANVAS: "canvas";
|
|
420
|
+
readonly GOOGLE_SLIDES: "google-slides";
|
|
421
|
+
readonly GOOGLE_DOCUMENT: "google-docs";
|
|
422
|
+
};
|
|
423
|
+
|
|
424
|
+
declare const isJSON: (text: string) => boolean;
|
|
425
|
+
declare const getInitials: (fullName: string) => string;
|
|
426
|
+
declare const ALPHANUMERIC_32_REGEX: RegExp;
|
|
427
|
+
declare const isAlphaNumeric32: (text: string) => boolean;
|
|
428
|
+
declare const addProtocolToUrl: (url: string) => string;
|
|
429
|
+
declare function getTimeAgo(createdAt: string): string;
|
|
430
|
+
declare const formatRelativeTime: (timestamp: string) => string;
|
|
431
|
+
|
|
432
|
+
type ChatState = Record<AdvancedTab, Message[]>;
|
|
433
|
+
interface SessionIds extends Record<AdvancedTab, string> {
|
|
434
|
+
}
|
|
435
|
+
type StreamingMessage = {
|
|
436
|
+
id: string;
|
|
437
|
+
content: string;
|
|
438
|
+
};
|
|
439
|
+
declare const defaultSessionIds: SessionIds;
|
|
440
|
+
type ChatStatus = "idle" | "pending" | "streaming" | "stopped" | "error";
|
|
441
|
+
type ChatSliceState = {
|
|
442
|
+
chats: ChatState;
|
|
443
|
+
isTyping: boolean;
|
|
444
|
+
streaming: boolean;
|
|
445
|
+
currentStreamingMessage: StreamingMessage;
|
|
446
|
+
activeTab: AdvancedTab;
|
|
447
|
+
sessionId: string;
|
|
448
|
+
sessionIds: SessionIds;
|
|
449
|
+
status: ChatStatus;
|
|
450
|
+
tools: string[];
|
|
451
|
+
token: string | null;
|
|
452
|
+
tokenEnabled: boolean;
|
|
453
|
+
iframeContext: {
|
|
454
|
+
hostInfo: {
|
|
455
|
+
title: string;
|
|
456
|
+
href: string;
|
|
457
|
+
};
|
|
458
|
+
pageContent: string;
|
|
459
|
+
};
|
|
460
|
+
documentFilter: Record<string, unknown> | null;
|
|
461
|
+
shouldStartNewChat: boolean;
|
|
462
|
+
showingSharedChat: boolean;
|
|
463
|
+
};
|
|
464
|
+
declare const chatActions: _reduxjs_toolkit.CaseReducerActions<_reduxjs_toolkit.SliceCaseReducers<ChatSliceState>, string>;
|
|
465
|
+
declare const chatSliceReducerShared: Reducer<State>;
|
|
466
|
+
declare const selectChats: (state: {
|
|
467
|
+
chatSliceShared: ChatSliceState;
|
|
468
|
+
}) => ChatState;
|
|
469
|
+
declare const selectIsTyping: (state: {
|
|
470
|
+
chatSliceShared: ChatSliceState;
|
|
471
|
+
}) => boolean;
|
|
472
|
+
declare const selectStreaming: (state: {
|
|
473
|
+
chatSliceShared: ChatSliceState;
|
|
474
|
+
}) => boolean;
|
|
475
|
+
declare const selectStatus: (state: {
|
|
476
|
+
chatSliceShared: ChatSliceState;
|
|
477
|
+
}) => ChatStatus;
|
|
478
|
+
declare const selectIsPending: (state: {
|
|
479
|
+
chatSliceShared: ChatSliceState;
|
|
480
|
+
}) => boolean;
|
|
481
|
+
declare const selectIsStopped: (state: {
|
|
482
|
+
chatSliceShared: ChatSliceState;
|
|
483
|
+
}) => boolean;
|
|
484
|
+
declare const selectIsError: (state: {
|
|
485
|
+
chatSliceShared: ChatSliceState;
|
|
486
|
+
}) => boolean;
|
|
487
|
+
declare const selectCurrentStreamingMessage: (state: {
|
|
488
|
+
chatSliceShared: ChatSliceState;
|
|
489
|
+
}) => StreamingMessage;
|
|
490
|
+
declare const selectActiveTab: (state: {
|
|
491
|
+
chatSliceShared: ChatSliceState;
|
|
492
|
+
}) => "chat" | "summarize" | "translate" | "expand";
|
|
493
|
+
declare const selectSessionId: (state: {
|
|
494
|
+
chatSliceShared: ChatSliceState;
|
|
495
|
+
}) => string;
|
|
496
|
+
declare const selectSessionIds: (state: {
|
|
497
|
+
chatSliceShared: ChatSliceState;
|
|
498
|
+
}) => SessionIds;
|
|
499
|
+
declare const selectIframeContext: (state: {
|
|
500
|
+
chatSliceShared: ChatSliceState;
|
|
501
|
+
}) => {
|
|
502
|
+
hostInfo: {
|
|
503
|
+
title: string;
|
|
504
|
+
href: string;
|
|
505
|
+
};
|
|
506
|
+
pageContent: string;
|
|
507
|
+
};
|
|
508
|
+
declare const selectDocumentFilter: (state: {
|
|
509
|
+
chatSliceShared: ChatSliceState;
|
|
510
|
+
}) => Record<string, unknown> | null;
|
|
511
|
+
declare const selectTools: (state: {
|
|
512
|
+
chatSliceShared: ChatSliceState;
|
|
513
|
+
}) => string[];
|
|
514
|
+
declare const selectToken: (state: {
|
|
515
|
+
chatSliceShared: ChatSliceState;
|
|
516
|
+
}) => string | null;
|
|
517
|
+
declare const selectTokenEnabled: (state: {
|
|
518
|
+
chatSliceShared: ChatSliceState;
|
|
519
|
+
}) => boolean;
|
|
520
|
+
declare const selectActiveChatMessages: (state: {
|
|
521
|
+
chatSliceShared: ChatSliceState;
|
|
522
|
+
}) => Message[];
|
|
523
|
+
declare const selectNumberOfActiveChatMessages: (state: {
|
|
524
|
+
chatSliceShared: ChatSliceState;
|
|
525
|
+
}) => number;
|
|
526
|
+
declare const selectShouldStartNewChat: (state: {
|
|
527
|
+
chatSliceShared: ChatSliceState;
|
|
528
|
+
}) => boolean;
|
|
529
|
+
declare const selectShowingSharedChat: (state: {
|
|
530
|
+
chatSliceShared: ChatSliceState;
|
|
531
|
+
}) => boolean;
|
|
532
|
+
|
|
533
|
+
type ChatMode = "advanced" | "default";
|
|
534
|
+
|
|
535
|
+
interface UseExternalPricingProps {
|
|
536
|
+
referenceId: string;
|
|
537
|
+
customerEmail: string;
|
|
538
|
+
publishableKey: string;
|
|
539
|
+
pricingId?: string;
|
|
540
|
+
}
|
|
541
|
+
interface PricingModalData {
|
|
542
|
+
referenceId: string;
|
|
543
|
+
customerEmail: string;
|
|
544
|
+
publishableKey: string;
|
|
545
|
+
pricingTableId: string;
|
|
546
|
+
}
|
|
547
|
+
interface CreateStripeCustomerPortalRequest {
|
|
548
|
+
org: string;
|
|
549
|
+
userId: string;
|
|
550
|
+
requestBody: StripeCustomerPortalRequest;
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
declare const userDataSchema: z.ZodObject<{
|
|
554
|
+
user_display_name: z.ZodString;
|
|
555
|
+
user_email: z.ZodString;
|
|
556
|
+
user_fullname: z.ZodString;
|
|
557
|
+
user_id: z.ZodNumber;
|
|
558
|
+
user_nicename: z.ZodString;
|
|
559
|
+
}, "strip", z.ZodTypeAny, {
|
|
560
|
+
user_display_name: string;
|
|
561
|
+
user_email: string;
|
|
562
|
+
user_fullname: string;
|
|
563
|
+
user_id: number;
|
|
564
|
+
user_nicename: string;
|
|
565
|
+
}, {
|
|
566
|
+
user_display_name: string;
|
|
567
|
+
user_email: string;
|
|
568
|
+
user_fullname: string;
|
|
569
|
+
user_id: number;
|
|
570
|
+
user_nicename: string;
|
|
571
|
+
}>;
|
|
572
|
+
declare const tenantSchema: z.ZodObject<{
|
|
573
|
+
key: z.ZodString;
|
|
574
|
+
is_admin: z.ZodBoolean;
|
|
575
|
+
org: z.ZodString;
|
|
576
|
+
}, "strip", z.ZodTypeAny, {
|
|
577
|
+
key: string;
|
|
578
|
+
is_admin: boolean;
|
|
579
|
+
org: string;
|
|
580
|
+
}, {
|
|
581
|
+
key: string;
|
|
582
|
+
is_admin: boolean;
|
|
583
|
+
org: string;
|
|
584
|
+
}>;
|
|
585
|
+
declare const tenantKeySchema: z.ZodString;
|
|
586
|
+
type TenantKeyMentorIdParams = {
|
|
587
|
+
tenantKey: string;
|
|
588
|
+
mentorId: string;
|
|
589
|
+
};
|
|
590
|
+
interface TopTrialBannerProps {
|
|
591
|
+
parentContainer: string;
|
|
592
|
+
bannerText?: string;
|
|
593
|
+
onUpgrade?: string;
|
|
594
|
+
loading?: boolean;
|
|
595
|
+
tooltipText?: string;
|
|
596
|
+
}
|
|
597
|
+
interface Prompt {
|
|
598
|
+
type: "static" | "human" | "ai";
|
|
599
|
+
icon?: string;
|
|
600
|
+
summary?: string;
|
|
601
|
+
content?: string;
|
|
602
|
+
proactive?: boolean;
|
|
603
|
+
hide?: boolean;
|
|
604
|
+
tag?: string;
|
|
605
|
+
}
|
|
606
|
+
interface Tenant {
|
|
607
|
+
key: string;
|
|
608
|
+
is_admin: boolean;
|
|
609
|
+
org: string;
|
|
610
|
+
name?: string;
|
|
611
|
+
platform_name: string;
|
|
612
|
+
is_advertising?: boolean;
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
type Props$5 = {
|
|
616
|
+
mode?: ChatMode;
|
|
617
|
+
tenantKey: string;
|
|
618
|
+
mentorId: string;
|
|
619
|
+
username: string;
|
|
620
|
+
token: string;
|
|
621
|
+
wsUrl: string;
|
|
622
|
+
redirectToAuthSpa: () => void;
|
|
623
|
+
stopGenerationWsUrl: string;
|
|
624
|
+
sendMessageToParentWebsite?: (payload: unknown) => void;
|
|
625
|
+
errorHandler?: (message: string, error?: any) => void;
|
|
626
|
+
isPreviewMode?: boolean;
|
|
627
|
+
mentorShareableToken?: string | null;
|
|
628
|
+
on402Error?: (message: Record<string, unknown>) => void;
|
|
629
|
+
};
|
|
630
|
+
declare function useAdvancedChat({ tenantKey, mentorId, username, token, wsUrl, stopGenerationWsUrl, redirectToAuthSpa, errorHandler, sendMessageToParentWebsite, isPreviewMode, mentorShareableToken, on402Error, }: Props$5): {
|
|
631
|
+
messages: Message[];
|
|
632
|
+
isStreaming: boolean;
|
|
633
|
+
status: ChatStatus;
|
|
634
|
+
isPending: boolean;
|
|
635
|
+
isStopped: boolean;
|
|
636
|
+
isError: boolean;
|
|
637
|
+
currentStreamingMessage: StreamingMessage;
|
|
638
|
+
activeTab: "chat" | "summarize" | "translate" | "expand";
|
|
639
|
+
uniqueMentorId: string;
|
|
640
|
+
mentorName: string;
|
|
641
|
+
profileImage: string;
|
|
642
|
+
enabledGuidedPrompts: boolean;
|
|
643
|
+
sendMessage: (tab: AdvancedTab, text: string, options?: SendMessageOptions) => Promise<void>;
|
|
644
|
+
stopGenerating: () => void;
|
|
645
|
+
setMessage: (message: Message) => void;
|
|
646
|
+
changeTab: (tab: AdvancedTab) => Promise<void>;
|
|
647
|
+
sessionId: string;
|
|
648
|
+
startNewChat: () => Promise<void>;
|
|
649
|
+
isLoadingSessionIds: boolean;
|
|
650
|
+
ws: React__default.MutableRefObject<WebSocket | null>;
|
|
651
|
+
isConnected: React__default.MutableRefObject<boolean>;
|
|
652
|
+
messageQueue: React__default.MutableRefObject<any[]>;
|
|
653
|
+
sessionIds: SessionIds;
|
|
654
|
+
enableSafetyDisclaimer: any;
|
|
655
|
+
resetConnection: () => void;
|
|
656
|
+
};
|
|
657
|
+
|
|
658
|
+
type Props$4 = {
|
|
659
|
+
tenantKey: string;
|
|
660
|
+
mentorId: string;
|
|
661
|
+
username: string;
|
|
662
|
+
errorHandler?: (message: string, error?: any) => void;
|
|
663
|
+
};
|
|
664
|
+
declare function useMentorTools({ tenantKey, mentorId, username, errorHandler, }: Props$4): {
|
|
665
|
+
tools: any;
|
|
666
|
+
activeTools: string[];
|
|
667
|
+
updateSessionTools: (tool: string) => Promise<void>;
|
|
668
|
+
setSessionTools: (tools: string[]) => Promise<void>;
|
|
669
|
+
enableWebBrowsing: boolean;
|
|
670
|
+
screenSharing: boolean;
|
|
671
|
+
deepResearch: boolean;
|
|
672
|
+
imageGeneration: boolean;
|
|
673
|
+
codeInterpreter: boolean;
|
|
674
|
+
promptsIsEnabled: boolean;
|
|
675
|
+
googleSlidesIsEnabled: boolean;
|
|
676
|
+
googleDocumentIsEnabled: boolean;
|
|
677
|
+
};
|
|
678
|
+
|
|
679
|
+
interface UserProfileUpdateData {
|
|
680
|
+
name?: string;
|
|
681
|
+
title?: string;
|
|
682
|
+
about?: string;
|
|
683
|
+
social_links?: {
|
|
684
|
+
platform: string;
|
|
685
|
+
social_link: string;
|
|
686
|
+
}[];
|
|
687
|
+
public_metadata?: {
|
|
688
|
+
bio?: string;
|
|
689
|
+
name?: string;
|
|
690
|
+
about?: string;
|
|
691
|
+
language?: string;
|
|
692
|
+
social_links?: {
|
|
693
|
+
platform: string;
|
|
694
|
+
social_link: string;
|
|
695
|
+
}[];
|
|
696
|
+
[key: string]: any;
|
|
697
|
+
};
|
|
698
|
+
enable_sidebar_ai_mentor_display?: boolean;
|
|
699
|
+
enable_skills_leaderboard_display?: boolean;
|
|
700
|
+
}
|
|
701
|
+
interface UseUserProfileUpdateResult {
|
|
702
|
+
updateProfile: (data: UserProfileUpdateData) => Promise<void>;
|
|
703
|
+
isLoading: boolean;
|
|
704
|
+
error: any;
|
|
705
|
+
}
|
|
706
|
+
declare function useUserProfileUpdate(username: string): UseUserProfileUpdateResult;
|
|
707
|
+
|
|
708
|
+
interface UseProfileImageUploadOptions {
|
|
709
|
+
onSuccess?: (imageUrl: string) => void;
|
|
710
|
+
onError?: (error: any) => void;
|
|
711
|
+
}
|
|
712
|
+
interface UseProfileImageUploadReturn {
|
|
713
|
+
uploadImage: (file: File, username: string) => Promise<UploadProfileImageResponse>;
|
|
714
|
+
removeImage: (username: string) => Promise<RemoveProfileImageResponse>;
|
|
715
|
+
isLoading: boolean;
|
|
716
|
+
isRemoving: boolean;
|
|
717
|
+
error: any;
|
|
718
|
+
}
|
|
719
|
+
declare function useProfileImageUpload(options?: UseProfileImageUploadOptions): UseProfileImageUploadReturn;
|
|
720
|
+
|
|
721
|
+
declare const useTenantMetadata: ({ org, spa, }: {
|
|
722
|
+
org: string;
|
|
723
|
+
spa?: string;
|
|
724
|
+
}) => {
|
|
725
|
+
metadata: any;
|
|
726
|
+
platformName: string | undefined;
|
|
727
|
+
isLoading: boolean;
|
|
728
|
+
isError: boolean;
|
|
729
|
+
isSkillsAssignmentsFeatureHidden: () => boolean;
|
|
730
|
+
isSkillsResumeFeatureHidden: () => boolean;
|
|
731
|
+
isMentorAIEnabled: () => boolean;
|
|
732
|
+
isSkillsLeaderBoardEnabled: () => boolean;
|
|
733
|
+
getEmbeddedMentorToUse: () => any;
|
|
734
|
+
metadataLoaded: any;
|
|
735
|
+
getAllMetadatas: () => {
|
|
736
|
+
value: any;
|
|
737
|
+
slug: string;
|
|
738
|
+
label: string;
|
|
739
|
+
defaultValue: any;
|
|
740
|
+
SPA?: string;
|
|
741
|
+
description?: string;
|
|
742
|
+
type?: "boolean" | "string" | "number";
|
|
743
|
+
}[];
|
|
744
|
+
getSupportEmail: () => any;
|
|
745
|
+
};
|
|
746
|
+
|
|
747
|
+
interface TenantMetadata$1 {
|
|
748
|
+
slug: string;
|
|
749
|
+
label: string;
|
|
750
|
+
defaultValue: any;
|
|
751
|
+
SPA?: string;
|
|
752
|
+
value?: any;
|
|
753
|
+
description?: string;
|
|
754
|
+
type?: "boolean" | "string" | "number";
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
/**
|
|
758
|
+
* Loads all metadata configurations for a given SPA
|
|
759
|
+
* @param spa - The SPA identifier (e.g., 'mentorAI', 'skillsAI', 'mentor', 'skills'). If not provided, returns all SPAs
|
|
760
|
+
* @returns Array of TenantMetadata objects
|
|
761
|
+
*/
|
|
762
|
+
declare function loadMetadataConfig(spa?: string): TenantMetadata$1[];
|
|
763
|
+
|
|
764
|
+
interface TenantMetadata {
|
|
765
|
+
slug: string;
|
|
766
|
+
label: string;
|
|
767
|
+
defaultValue: any;
|
|
768
|
+
SPA?: string;
|
|
769
|
+
value?: any;
|
|
770
|
+
}
|
|
771
|
+
declare const METADATAS: TenantMetadata$1[];
|
|
772
|
+
|
|
773
|
+
type Props$3 = {
|
|
774
|
+
mentorId: string;
|
|
775
|
+
tenantKey: string;
|
|
776
|
+
username: string;
|
|
777
|
+
};
|
|
778
|
+
declare function useMentorSettings({ mentorId, tenantKey, username }: Props$3): {
|
|
779
|
+
data: {
|
|
780
|
+
profileImage: string | null | undefined;
|
|
781
|
+
greetingMethod: string | undefined;
|
|
782
|
+
proactiveResponse: string | undefined;
|
|
783
|
+
llmProvider: any;
|
|
784
|
+
llmName: string | undefined;
|
|
785
|
+
mentorUniqueId: string | undefined;
|
|
786
|
+
mentorName: string | undefined;
|
|
787
|
+
enableGuidedPrompts: boolean | undefined;
|
|
788
|
+
mentorSlug: string | undefined;
|
|
789
|
+
safetyDisclaimer: any;
|
|
790
|
+
mentorTools: any;
|
|
791
|
+
allowAnonymous: boolean | undefined;
|
|
792
|
+
};
|
|
793
|
+
};
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* Sync authentication state to cookies (web only)
|
|
797
|
+
* Should be called on login, logout, and tenant switch
|
|
798
|
+
* On React Native, this is a no-op
|
|
799
|
+
*/
|
|
800
|
+
declare function syncAuthToCookies(storageService: StorageService): Promise<void>;
|
|
801
|
+
/**
|
|
802
|
+
* Clear all authentication cookies (web only)
|
|
803
|
+
* Should be called on logout
|
|
804
|
+
* On React Native, this is a no-op
|
|
805
|
+
*/
|
|
806
|
+
declare function clearAuthCookies(): void;
|
|
807
|
+
declare function getUserName(storageService: StorageService): Promise<any>;
|
|
808
|
+
declare function useAuthProvider({ middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, storageService, skipAuthCheck, token, }: Props$2): {
|
|
809
|
+
isAuthenticating: boolean;
|
|
810
|
+
userIsAccessingPublicRoute: boolean;
|
|
811
|
+
setUserIsAccessingPublicRoute: React__default.Dispatch<React__default.SetStateAction<boolean>>;
|
|
812
|
+
};
|
|
813
|
+
/**
|
|
814
|
+
* Type definition for the authentication context
|
|
815
|
+
* Tracks whether the user is accessing a public route and provides a setter
|
|
816
|
+
*/
|
|
817
|
+
type AuthContextType = {
|
|
818
|
+
userIsAccessingPublicRoute: boolean;
|
|
819
|
+
setUserIsAccessingPublicRoute: (iuserIsAccessingPublicRoute: boolean) => void;
|
|
820
|
+
};
|
|
821
|
+
declare const AuthContext: React__default.Context<AuthContextType | undefined>;
|
|
822
|
+
/**
|
|
823
|
+
* Hook to access the auth context
|
|
824
|
+
* @throws Error if used outside of AuthContextProvider
|
|
825
|
+
*/
|
|
826
|
+
declare const useAuthContext: () => AuthContextType;
|
|
827
|
+
/**
|
|
828
|
+
* Context Provider component that wraps children with auth context
|
|
829
|
+
*/
|
|
830
|
+
declare const AuthContextProvider: ({ value, children, }: {
|
|
831
|
+
value: AuthContextType;
|
|
832
|
+
children: React__default.ReactNode;
|
|
833
|
+
}) => react_jsx_runtime.JSX.Element;
|
|
834
|
+
/**
|
|
835
|
+
* Props for the AuthProvider component
|
|
836
|
+
*/
|
|
837
|
+
type Props$2 = {
|
|
838
|
+
children?: React__default.ReactNode;
|
|
839
|
+
fallback?: React__default.ReactNode;
|
|
840
|
+
middleware?: Map<string | RegExp, () => Promise<boolean>>;
|
|
841
|
+
onAuthSuccess?: () => void;
|
|
842
|
+
onAuthFailure?: (reason: string) => void;
|
|
843
|
+
redirectToAuthSpa: (redirectTo?: string, platformKey?: string, logout?: boolean) => void;
|
|
844
|
+
hasNonExpiredAuthToken: () => boolean;
|
|
845
|
+
username: string;
|
|
846
|
+
pathname: string;
|
|
847
|
+
skipAuthCheck?: boolean;
|
|
848
|
+
storageService?: StorageService;
|
|
849
|
+
token?: string;
|
|
850
|
+
};
|
|
851
|
+
/**
|
|
852
|
+
* AuthProvider Component
|
|
853
|
+
*
|
|
854
|
+
* Main authentication provider that:
|
|
855
|
+
* 1. Checks if the current route requires authentication
|
|
856
|
+
* 2. Validates the auth token
|
|
857
|
+
* 3. Fetches user metadata to verify authentication
|
|
858
|
+
* 4. Handles redirects to auth SPA when needed
|
|
859
|
+
* 5. Manages public route access state
|
|
860
|
+
*/
|
|
861
|
+
declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, skipAuthCheck, storageService, token, }: Props$2): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
862
|
+
|
|
863
|
+
/**
|
|
864
|
+
* MentorProvider Component
|
|
865
|
+
*
|
|
866
|
+
* Provider that manages AI mentor selection and redirection logic.
|
|
867
|
+
* It handles:
|
|
868
|
+
* - Mentor selection based on user preferences and history
|
|
869
|
+
* - Mentor seeding for new tenants
|
|
870
|
+
* - Redirection to appropriate mentor or creation flow
|
|
871
|
+
* - Integration with tenant context for access control
|
|
872
|
+
*/
|
|
873
|
+
|
|
874
|
+
/**
|
|
875
|
+
* Props for the MentorProvider component
|
|
876
|
+
*/
|
|
877
|
+
type Props$1 = {
|
|
878
|
+
children?: React__default.ReactNode;
|
|
879
|
+
fallback?: React__default.ReactNode;
|
|
880
|
+
onAuthSuccess?: () => void;
|
|
881
|
+
onAuthFailure?: (reason: string) => void;
|
|
882
|
+
redirectToAuthSpa: () => void;
|
|
883
|
+
redirectToMentor: (tenantKey: string, mentorId: string) => void;
|
|
884
|
+
onLoadMentorsPermissions?: (rbacPermissions: Record<string, unknown> | undefined) => void;
|
|
885
|
+
redirectToNoMentorsPage: () => void;
|
|
886
|
+
redirectToCreateMentor: () => void;
|
|
887
|
+
username: string;
|
|
888
|
+
isAdmin: boolean;
|
|
889
|
+
mainTenantKey: string;
|
|
890
|
+
requestedMentorId?: string;
|
|
891
|
+
handleMentorNotFound?: () => Promise<void>;
|
|
892
|
+
forceDetermineMentor?: boolean;
|
|
893
|
+
};
|
|
894
|
+
/**
|
|
895
|
+
* MentorProvider Component
|
|
896
|
+
*
|
|
897
|
+
* Main mentor provider that:
|
|
898
|
+
* 1. Determines the most appropriate mentor for the user
|
|
899
|
+
* 2. Handles mentor seeding for new tenants
|
|
900
|
+
* 3. Manages redirection based on mentor availability
|
|
901
|
+
* 4. Integrates with tenant context for access control
|
|
902
|
+
*/
|
|
903
|
+
declare function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redirectToAuthSpa, redirectToMentor, onLoadMentorsPermissions, redirectToNoMentorsPage, redirectToCreateMentor, username, isAdmin, mainTenantKey, requestedMentorId, handleMentorNotFound, forceDetermineMentor, }: Props$1): React__default.ReactNode;
|
|
904
|
+
|
|
905
|
+
/**
|
|
906
|
+
* Type definition for the tenant context
|
|
907
|
+
* Tracks whether the user's path needs to be determined and provides a setter
|
|
908
|
+
*/
|
|
909
|
+
type TenantContextType = {
|
|
910
|
+
determineUserPath: boolean;
|
|
911
|
+
setDetermineUserPath: (value: boolean) => void;
|
|
912
|
+
tenantKey: string;
|
|
913
|
+
metadata: Record<string, any>;
|
|
914
|
+
setMetadata: (metadata: Record<string, any>) => void;
|
|
915
|
+
};
|
|
916
|
+
declare const TenantContext: React__default.Context<TenantContextType | undefined>;
|
|
917
|
+
/**
|
|
918
|
+
* Context Provider component that wraps children with tenant context
|
|
919
|
+
*/
|
|
920
|
+
declare const TenantContextProvider: React__default.FC<{
|
|
921
|
+
value: TenantContextType;
|
|
922
|
+
children: React__default.ReactNode;
|
|
923
|
+
}>;
|
|
924
|
+
/**
|
|
925
|
+
* Hook to access the tenant context
|
|
926
|
+
* @returns TenantContextType
|
|
927
|
+
*/
|
|
928
|
+
declare const useTenantContext: () => TenantContextType;
|
|
929
|
+
/**
|
|
930
|
+
* Props for the TenantProvider component
|
|
931
|
+
*/
|
|
932
|
+
type Props = {
|
|
933
|
+
children?: React__default.ReactNode;
|
|
934
|
+
fallback?: React__default.ReactNode;
|
|
935
|
+
onAuthSuccess?: () => void;
|
|
936
|
+
onAuthFailure?: (reason: string) => void;
|
|
937
|
+
currentTenant: string;
|
|
938
|
+
requestedTenant: string;
|
|
939
|
+
handleTenantSwitch: (tenant: string, saveRedirect: boolean) => Promise<void>;
|
|
940
|
+
saveCurrentTenant: (tenant: Tenant$3) => void;
|
|
941
|
+
saveUserTenants: (tenants: Tenant$3[]) => void;
|
|
942
|
+
saveVisitingTenant?: (tenant: Tenant$3) => void;
|
|
943
|
+
removeVisitingTenant?: () => void;
|
|
944
|
+
saveUserTokens?: (tokens: TokenResponse) => void;
|
|
945
|
+
saveTenant?: (tenant: string) => void;
|
|
946
|
+
onAutoJoinUserToTenant?: (platformName: string) => void;
|
|
947
|
+
};
|
|
948
|
+
/**
|
|
949
|
+
* TenantProvider Component
|
|
950
|
+
*
|
|
951
|
+
* Main tenant provider that:
|
|
952
|
+
* 1. Validates user's access to requested tenant
|
|
953
|
+
* 2. Manages tenant switching
|
|
954
|
+
* 3. Retrieves and validates tenant metadata
|
|
955
|
+
* 4. Handles tenant-specific domain redirects
|
|
956
|
+
* 5. Maintains tenant access state
|
|
957
|
+
*/
|
|
958
|
+
declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, saveVisitingTenant, removeVisitingTenant, saveUserTokens, saveTenant, onAutoJoinUserToTenant, }: Props): string | number | bigint | boolean | Iterable<React__default.ReactNode> | Promise<string | number | bigint | boolean | React__default.ReactPortal | React__default.ReactElement<unknown, string | React__default.JSXElementConstructor<any>> | Iterable<React__default.ReactNode> | null | undefined> | react_jsx_runtime.JSX.Element | null | undefined;
|
|
959
|
+
|
|
960
|
+
interface TimeTrackerConfig {
|
|
961
|
+
intervalSeconds: number;
|
|
962
|
+
onTimeUpdate: (url: string, timeSpent: number) => void;
|
|
963
|
+
getCurrentUrl: () => string;
|
|
964
|
+
onRouteChange?: (callback: () => void) => () => void;
|
|
965
|
+
}
|
|
966
|
+
interface TimeTrackerState {
|
|
967
|
+
currentUrl: string;
|
|
968
|
+
startTime: number;
|
|
969
|
+
intervalId: number | null;
|
|
970
|
+
routeUnsubscribe: (() => void) | null;
|
|
971
|
+
}
|
|
972
|
+
declare class TimeTracker {
|
|
973
|
+
private state;
|
|
974
|
+
private config;
|
|
975
|
+
constructor(config: TimeTrackerConfig);
|
|
976
|
+
private initialize;
|
|
977
|
+
private startTracking;
|
|
978
|
+
private clearInterval;
|
|
979
|
+
private resetTimer;
|
|
980
|
+
private getTimeSpent;
|
|
981
|
+
private sendTimeUpdate;
|
|
982
|
+
private handleRouteChange;
|
|
983
|
+
pause(): void;
|
|
984
|
+
resume(): void;
|
|
985
|
+
destroy(): void;
|
|
986
|
+
getCurrentUrl(): string;
|
|
987
|
+
getTimeSpentSinceLastReset(): number;
|
|
988
|
+
}
|
|
989
|
+
|
|
990
|
+
interface UseTimeTrackerConfig {
|
|
991
|
+
intervalSeconds: number;
|
|
992
|
+
onTimeUpdate: (url: string, timeSpent: number) => void;
|
|
993
|
+
enabled?: boolean;
|
|
994
|
+
getCurrentUrl?: () => string;
|
|
995
|
+
onRouteChange?: (callback: () => void) => () => void;
|
|
996
|
+
}
|
|
997
|
+
interface UseTimeTrackerReturn {
|
|
998
|
+
pause: () => void;
|
|
999
|
+
resume: () => void;
|
|
1000
|
+
getCurrentUrl: () => string;
|
|
1001
|
+
getTimeSpentSinceLastReset: () => number;
|
|
1002
|
+
}
|
|
1003
|
+
declare function useTimeTracker(config: UseTimeTrackerConfig): UseTimeTrackerReturn;
|
|
1004
|
+
|
|
1005
|
+
interface UseTimeTrackerNativeConfig {
|
|
1006
|
+
intervalSeconds: number;
|
|
1007
|
+
onTimeUpdate: (url: string, timeSpent: number) => void;
|
|
1008
|
+
getCurrentRoute: () => string;
|
|
1009
|
+
onRouteChange?: (callback: () => void) => () => void;
|
|
1010
|
+
enabled?: boolean;
|
|
1011
|
+
}
|
|
1012
|
+
interface UseTimeTrackerNativeReturn {
|
|
1013
|
+
pause: () => void;
|
|
1014
|
+
resume: () => void;
|
|
1015
|
+
getCurrentUrl: () => string;
|
|
1016
|
+
getTimeSpentSinceLastReset: () => number;
|
|
1017
|
+
}
|
|
1018
|
+
declare function useTimeTrackerNative(config: UseTimeTrackerNativeConfig): UseTimeTrackerNativeReturn;
|
|
1019
|
+
|
|
1020
|
+
export { ALPHANUMERIC_32_REGEX, ANONYMOUS_USERNAME, AuthContext, AuthContextProvider, AuthProvider, LOCAL_STORAGE_KEYS, MAX_INITIAL_WEBSOCKET_CONNECTION_ATTEMPTS, MENTOR_CHAT_DOCUMENTS_EXTENSIONS, METADATAS, MentorProvider, SUBSCRIPTION_MESSAGES, SUBSCRIPTION_PACKAGES, SUBSCRIPTION_TRIGGERS, SUBSCRIPTION_V2_TRIGGERS, SubscriptionFlow, SubscriptionFlowV2, TOOLS, TenantContext, TenantContextProvider, TenantProvider, TimeTracker, addProtocolToUrl, advancedTabs, advancedTabsProperties, chatActions, chatSliceReducerShared, clearAuthCookies, defaultSessionIds, formatRelativeTime, getInitials, getTimeAgo, getUserName, isAlphaNumeric32, isJSON, loadMetadataConfig, selectActiveChatMessages, selectActiveTab, selectChats, selectCurrentStreamingMessage, selectDocumentFilter, selectIframeContext, selectIsError, selectIsPending, selectIsStopped, selectIsTyping, selectNumberOfActiveChatMessages, selectSessionId, selectSessionIds, selectShouldStartNewChat, selectShowingSharedChat, selectStatus, selectStreaming, selectToken, selectTokenEnabled, selectTools, syncAuthToCookies, tenantKeySchema, tenantSchema, translatePrompt, useAdvancedChat, useAuthContext, useAuthProvider, useChat, useDayJs, useExternalPricingPlan, useMentorSettings, useMentorTools, useProfileImageUpload, useSubscriptionHandler, useSubscriptionHandlerV2, useTenantContext, useTenantMetadata, useTimeTracker, useTimeTrackerNative, useUserProfileUpdate, userDataSchema };
|
|
1021
|
+
export type { AdvancedTab, AuthContextType, ChatMode, ChatState, ChatStatus, CreateStripeCustomerPortalRequest, Message, MessageAction, PricingModalData, Prompt, SendMessageOptions, SessionIds, StreamingMessage, SubscriptionFlowConfig, SubscriptionFlowConfigV2, Tenant, TenantContextType, TenantKeyMentorIdParams, TenantMetadata, TimeTrackerConfig, TimeTrackerState, TopTrialBannerProps, UseChatProps, UseChatReturn, UseExternalPricingProps, UseProfileImageUploadOptions, UseProfileImageUploadReturn, UseTimeTrackerConfig, UseTimeTrackerNativeConfig, UseTimeTrackerNativeReturn, UseTimeTrackerReturn, UseUserProfileUpdateResult, UserProfileUpdateData };
|