@iblai/web-containers 0.0.6 → 0.2.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.
Files changed (177) hide show
  1. package/dist/components/hooks/use-toast.d.ts +1 -1
  2. package/dist/components/index.d.ts +2 -0
  3. package/dist/components/loader.d.ts +1 -0
  4. package/dist/components/modals/user-profile-modal.d.ts +14 -0
  5. package/dist/components/profile/index.d.ts +5 -1
  6. package/dist/components/profile/security.d.ts +1 -1
  7. package/dist/components/profile/use-profile.d.ts +1 -1
  8. package/dist/components/ui/card.d.ts +8 -0
  9. package/dist/components/ui/pagination.d.ts +1 -1
  10. package/dist/components/ui/separator.d.ts +4 -0
  11. package/dist/components/ui/sonner.d.ts +4 -0
  12. package/dist/components/version.d.ts +6 -0
  13. package/dist/data-layer/src/config.d.ts +7 -0
  14. package/dist/data-layer/src/constants.d.ts +30 -0
  15. package/dist/data-layer/src/core/index.d.ts +4 -0
  16. package/dist/data-layer/src/features/analytics/api-slice.d.ts +1600 -0
  17. package/dist/data-layer/src/features/analytics/constants.d.ts +66 -0
  18. package/dist/data-layer/src/features/analytics/types.d.ts +100 -0
  19. package/dist/data-layer/src/features/api-keys/api-slice.d.ts +665 -0
  20. package/dist/data-layer/src/features/apps/api-slice.d.ts +683 -0
  21. package/dist/data-layer/src/features/auth/api-slice.d.ts +137 -0
  22. package/dist/data-layer/src/features/auth/constants.d.ts +8 -0
  23. package/dist/data-layer/src/features/auth/types.d.ts +13 -0
  24. package/dist/data-layer/src/features/billing/api-slice.d.ts +349 -0
  25. package/dist/data-layer/src/features/career/api-slice.d.ts +687 -0
  26. package/dist/data-layer/src/features/catalog/api-slice.d.ts +6602 -0
  27. package/dist/data-layer/src/features/chat/api-slice.d.ts +1832 -0
  28. package/dist/data-layer/src/features/chat-history/api-slice.d.ts +1386 -0
  29. package/dist/data-layer/src/features/constants.d.ts +3 -0
  30. package/dist/data-layer/src/features/core/api-slice.d.ts +653 -0
  31. package/dist/data-layer/src/features/core/constants.d.ts +4 -0
  32. package/dist/data-layer/src/features/credentials/api-slice.d.ts +2129 -0
  33. package/dist/data-layer/src/features/credentials/constants.d.ts +28 -0
  34. package/dist/data-layer/src/features/credentials/custom-api-slice.d.ts +1284 -0
  35. package/dist/data-layer/src/features/credentials/types.d.ts +16 -0
  36. package/dist/data-layer/src/features/datasets/api-slice.d.ts +576 -0
  37. package/dist/data-layer/src/features/llms/api-slice.d.ts +333 -0
  38. package/dist/data-layer/src/features/mentor/api-slice.d.ts +4298 -0
  39. package/dist/data-layer/src/features/mentor/constants.d.ts +31 -0
  40. package/dist/data-layer/src/features/mentor/custom-api-slice.d.ts +268 -0
  41. package/dist/data-layer/src/features/mentor/types.d.ts +38 -0
  42. package/dist/data-layer/src/features/mentor-categories/api-slice.d.ts +311 -0
  43. package/dist/data-layer/src/features/notifications/api-slice.d.ts +946 -0
  44. package/dist/data-layer/src/features/per-learner/api-slice.d.ts +1213 -0
  45. package/dist/data-layer/src/features/platform/api-slice.d.ts +1124 -0
  46. package/dist/data-layer/src/features/prompts/api-slice.d.ts +2276 -0
  47. package/dist/data-layer/src/features/search/api-slice.d.ts +1939 -0
  48. package/dist/data-layer/src/features/sessions/api-slice.d.ts +705 -0
  49. package/dist/data-layer/src/features/skills/api-slice.d.ts +1235 -0
  50. package/dist/data-layer/src/features/stripe/api-slice.d.ts +620 -0
  51. package/dist/data-layer/src/features/stripe/constants.d.ts +15 -0
  52. package/dist/data-layer/src/features/stripe/types.d.ts +9 -0
  53. package/dist/data-layer/src/features/tenant/api-slice.d.ts +759 -0
  54. package/dist/data-layer/src/features/tenant/constants.d.ts +11 -0
  55. package/dist/data-layer/src/features/tenant/types.d.ts +18 -0
  56. package/dist/data-layer/src/features/tenant-logo/api-slice.d.ts +349 -0
  57. package/dist/data-layer/src/features/tenant-logo/constants.d.ts +24 -0
  58. package/dist/data-layer/src/features/tools/api-slice.d.ts +333 -0
  59. package/dist/data-layer/src/features/training-documents/api-slice.d.ts +922 -0
  60. package/dist/data-layer/src/features/user/api-slice.d.ts +1703 -0
  61. package/dist/data-layer/src/features/user/constants.d.ts +40 -0
  62. package/dist/data-layer/src/features/user/types.d.ts +107 -0
  63. package/dist/data-layer/src/features/user-invitations/api-slice.d.ts +718 -0
  64. package/dist/data-layer/src/features/utils.d.ts +66 -0
  65. package/dist/data-layer/src/index.d.ts +47 -0
  66. package/dist/data-layer/src/reducers/index.d.ts +2 -0
  67. package/dist/data-layer/src/reducers/mentor.d.ts +2 -0
  68. package/dist/data-layer/src/reducers/skills.d.ts +1148 -0
  69. package/dist/data-layer/src/services/StorageService.d.ts +5 -0
  70. package/dist/data-layer/src/utils/index.d.ts +2 -0
  71. package/dist/index.esm.js +23491 -2086
  72. package/dist/index.esm.js.map +1 -1
  73. package/dist/index.js +23569 -2157
  74. package/dist/index.js.map +1 -1
  75. package/dist/package.json +98 -0
  76. package/dist/web-containers/src/components/advance-pagination.d.ts +8 -0
  77. package/dist/web-containers/src/components/error/client-error-page.d.ts +10 -0
  78. package/dist/web-containers/src/components/error/error-page.d.ts +18 -0
  79. package/dist/web-containers/src/components/hooks/use-copy-to-clipboard.d.ts +8 -0
  80. package/dist/web-containers/src/components/hooks/use-toast.d.ts +44 -0
  81. package/dist/web-containers/src/components/index.d.ts +13 -0
  82. package/dist/web-containers/src/components/loader.d.ts +1 -0
  83. package/dist/web-containers/src/components/modals/user-profile-modal.d.ts +23 -0
  84. package/dist/web-containers/src/components/notifications/index.d.ts +1 -0
  85. package/dist/web-containers/src/components/notifications/notification-dropdown.d.ts +6 -0
  86. package/dist/web-containers/src/components/profile/account.d.ts +19 -0
  87. package/dist/web-containers/src/components/profile/admin.d.ts +4 -0
  88. package/dist/web-containers/src/components/profile/advanced.d.ts +5 -0
  89. package/dist/web-containers/src/components/profile/billing.d.ts +5 -0
  90. package/dist/web-containers/src/components/profile/index.d.ts +16 -0
  91. package/dist/web-containers/src/components/profile/integration/api-tab/api-key-modal.d.ts +7 -0
  92. package/dist/web-containers/src/components/profile/integration/api-tab/constants.d.ts +2 -0
  93. package/dist/web-containers/src/components/profile/integration/api-tab/create-api-modal.d.ts +8 -0
  94. package/dist/web-containers/src/components/profile/integration/api-tab/delete-api-modal.d.ts +11 -0
  95. package/dist/web-containers/src/components/profile/integration/api-tab/integration-autogenerated-table.d.ts +3 -0
  96. package/dist/web-containers/src/components/profile/integration/data-sources-tab/create-data-source-modal.d.ts +8 -0
  97. package/dist/web-containers/src/components/profile/integration/data-sources-tab/integration-data-sources-tab.d.ts +3 -0
  98. package/dist/web-containers/src/components/profile/integration/index.d.ts +4 -0
  99. package/dist/web-containers/src/components/profile/integration/llms-tab/create-llm-modal.d.ts +8 -0
  100. package/dist/web-containers/src/components/profile/integration/llms-tab/integration-llms-tab.d.ts +3 -0
  101. package/dist/web-containers/src/components/profile/invite-user.d.ts +5 -0
  102. package/dist/web-containers/src/components/profile/invited-users.d.ts +4 -0
  103. package/dist/web-containers/src/components/profile/organization.d.ts +4 -0
  104. package/dist/web-containers/src/components/profile/security.d.ts +3 -0
  105. package/dist/web-containers/src/components/profile/use-profile.d.ts +44 -0
  106. package/dist/web-containers/src/components/spinner/index.d.ts +6 -0
  107. package/dist/web-containers/src/components/tenant-switch/index.d.ts +11 -0
  108. package/dist/web-containers/src/components/tenant-switch/types.d.ts +6 -0
  109. package/dist/web-containers/src/components/top-banner/index.d.ts +3 -0
  110. package/dist/web-containers/src/components/top-banner/types.d.ts +10 -0
  111. package/dist/web-containers/src/components/top-banner/use-top-banner.d.ts +11 -0
  112. package/dist/web-containers/src/components/ui/avatar.d.ts +13 -0
  113. package/dist/web-containers/src/components/ui/badge.d.ts +9 -0
  114. package/dist/web-containers/src/components/ui/button.d.ts +11 -0
  115. package/dist/web-containers/src/components/ui/calendar.d.ts +8 -0
  116. package/dist/web-containers/src/components/ui/card.d.ts +8 -0
  117. package/dist/web-containers/src/components/ui/checkbox.d.ts +4 -0
  118. package/dist/web-containers/src/components/ui/dialog.d.ts +19 -0
  119. package/dist/web-containers/src/components/ui/dropdown-menu.d.ts +25 -0
  120. package/dist/web-containers/src/components/ui/input.d.ts +3 -0
  121. package/dist/web-containers/src/components/ui/label.d.ts +5 -0
  122. package/dist/web-containers/src/components/ui/pagination.d.ts +28 -0
  123. package/dist/web-containers/src/components/ui/popover.d.ts +6 -0
  124. package/dist/web-containers/src/components/ui/select.d.ts +13 -0
  125. package/dist/web-containers/src/components/ui/separator.d.ts +4 -0
  126. package/dist/web-containers/src/components/ui/skeleton.d.ts +2 -0
  127. package/dist/web-containers/src/components/ui/sonner.d.ts +4 -0
  128. package/dist/web-containers/src/components/ui/switch.d.ts +4 -0
  129. package/dist/web-containers/src/components/ui/table.d.ts +10 -0
  130. package/dist/web-containers/src/components/ui/tabs.d.ts +7 -0
  131. package/dist/web-containers/src/components/ui/textarea.d.ts +3 -0
  132. package/dist/web-containers/src/components/ui/toast.d.ts +15 -0
  133. package/dist/web-containers/src/components/ui/toaster.d.ts +15 -0
  134. package/dist/web-containers/src/components/ui/tooltip.d.ts +7 -0
  135. package/dist/web-containers/src/components/ui/use-toast.d.ts +15 -0
  136. package/dist/web-containers/src/components/user-profile-dropdown/index.d.ts +52 -0
  137. package/dist/web-containers/src/components/version.d.ts +6 -0
  138. package/dist/web-containers/src/hooks/index.d.ts +1 -0
  139. package/dist/web-containers/src/hooks/use-iframe-message-handler.d.ts +8 -0
  140. package/dist/web-containers/src/index.d.ts +2 -0
  141. package/dist/web-containers/src/lib/error-utils.d.ts +15 -0
  142. package/dist/web-containers/src/lib/utils.d.ts +2 -0
  143. package/dist/web-containers/src/utils.d.ts +1 -0
  144. package/dist/web-utils/src/features/chat/slice.d.ts +91 -0
  145. package/dist/web-utils/src/features/index.d.ts +1 -0
  146. package/dist/web-utils/src/hooks/chat/use-advanced-chat.d.ts +48 -0
  147. package/dist/web-utils/src/hooks/chat/use-chat-v2.d.ts +56 -0
  148. package/dist/web-utils/src/hooks/chat/use-mentor-tools.d.ts +18 -0
  149. package/dist/web-utils/src/hooks/index.d.ts +15 -0
  150. package/dist/web-utils/src/hooks/profile/use-profile-image-upload.d.ts +13 -0
  151. package/dist/web-utils/src/hooks/profile/use-user-profile-update.d.ts +28 -0
  152. package/dist/web-utils/src/hooks/subscription/class-subscription-flow.d.ts +70 -0
  153. package/dist/web-utils/src/hooks/subscription/constants.d.ts +4 -0
  154. package/dist/web-utils/src/hooks/subscription/use-subscription-handler.d.ts +11 -0
  155. package/dist/web-utils/src/hooks/subscription-v2/class-subscription-flow.d.ts +77 -0
  156. package/dist/web-utils/src/hooks/subscription-v2/constants.d.ts +51 -0
  157. package/dist/web-utils/src/hooks/subscription-v2/use-external-pricing-plan.d.ts +7 -0
  158. package/dist/web-utils/src/hooks/subscription-v2/use-subscription-handler.d.ts +16 -0
  159. package/dist/web-utils/src/hooks/tenant-metadata/config-loader.d.ts +41 -0
  160. package/dist/web-utils/src/hooks/tenant-metadata/constants.d.ts +9 -0
  161. package/dist/web-utils/src/hooks/tenant-metadata/types.d.ts +9 -0
  162. package/dist/web-utils/src/hooks/tenant-metadata/use-tenant-metadata.d.ts +24 -0
  163. package/dist/web-utils/src/hooks/use-day-js.d.ts +7 -0
  164. package/dist/web-utils/src/hooks/use-mentor-settings.d.ts +21 -0
  165. package/dist/web-utils/src/index.d.ts +5 -0
  166. package/dist/web-utils/src/providers/auth-provider.d.ts +64 -0
  167. package/dist/web-utils/src/providers/index.d.ts +3 -0
  168. package/dist/web-utils/src/providers/mentor-provider.d.ts +40 -0
  169. package/dist/web-utils/src/providers/tenant-provider.d.ts +63 -0
  170. package/dist/web-utils/src/types/chat.d.ts +1 -0
  171. package/dist/web-utils/src/types/index.d.ts +55 -0
  172. package/dist/web-utils/src/types/subscription.d.ts +18 -0
  173. package/dist/web-utils/src/utils/constants.d.ts +37 -0
  174. package/dist/web-utils/src/utils/data/advanced-tab.d.ts +62 -0
  175. package/dist/web-utils/src/utils/helpers.d.ts +6 -0
  176. package/dist/web-utils/src/utils/index.d.ts +3 -0
  177. package/package.json +38 -21
@@ -0,0 +1,11 @@
1
+ import { SubscriptionFlow } from "./class-subscription-flow";
2
+ /**
3
+ * Hook to handle subscription logic
4
+ * @param subscriptionFlow Instance of SubscriptionFlow that manages different subscription states and actions
5
+ */
6
+ export declare const useSubscriptionHandler: (subscriptionFlow: SubscriptionFlow) => {
7
+ handleSubscriptionCheck: () => Promise<void>;
8
+ handleIntervalSubscriptionCheck: () => (() => void) | undefined;
9
+ trialCounterStarted: boolean;
10
+ bannerButtonTriggerCallback: (trigger: string) => () => void;
11
+ };
@@ -0,0 +1,77 @@
1
+ import { StripeContextResponse } from "@iblai/data-layer";
2
+ interface Tenant {
3
+ key: string;
4
+ is_admin: boolean;
5
+ org: string;
6
+ }
7
+ export interface SubscriptionFlowConfigV2 {
8
+ platformName: string;
9
+ currentTenantKey: string;
10
+ username: string;
11
+ currentTenantOrg: string;
12
+ userTenants: Tenant[];
13
+ isAdmin: boolean;
14
+ mainTenantKey: string;
15
+ userEmail: string;
16
+ mentorUrl: string;
17
+ }
18
+ /**
19
+ * SubscriptionFlow class manages all subscription-related flows and user interactions
20
+ * Handles free trial, usage limits, and subscription management
21
+ */
22
+ export declare class SubscriptionFlowV2 {
23
+ protected platformName: string;
24
+ protected currentTenantKey: string;
25
+ protected username: string;
26
+ protected currentTenantOrg: string;
27
+ protected userTenants: Tenant[];
28
+ protected isAdmin: boolean;
29
+ protected mainTenantKey: string;
30
+ protected userEmail: string;
31
+ protected mentorUrl: string;
32
+ constructor(config: SubscriptionFlowConfigV2);
33
+ getPlatformName(): string;
34
+ getCurrentTenantKey(): string;
35
+ getUsername(): string;
36
+ getCurrentTenantOrg(): string;
37
+ getUserTenants(): Tenant[];
38
+ isUserAdmin(): boolean;
39
+ getUserEmail(): string;
40
+ getMainTenantKey(): string;
41
+ getMentorUrl(): string;
42
+ handleRedirectToBillingPageFlow(billingUrl: string): void;
43
+ handleBeforeTopUpCreditTriggerFlow(): void;
44
+ handleBeforeBillingPageTriggerFlow(): void;
45
+ /**
46
+ * Handles the flow when user reaches their free usage limit
47
+ * Updates banner with appropriate message based on remaining usage count
48
+ */
49
+ handleFreeUsageCountFlow(hasCredits: boolean, appExists: boolean): void;
50
+ /**
51
+ * Displays the pricing modal for subscription options
52
+ */
53
+ handlePricingPageDisplayFlow(stripeContext: StripeContextResponse): void;
54
+ /**
55
+ * Displays error notification when payment flow fails
56
+ */
57
+ handleFailureOnPaymentFlow(): void;
58
+ handleBeforePricingPageDisplayFlow(): void;
59
+ handleFailureOnTopUpCreditTriggerFlow(): void;
60
+ handlePaidPlanCreditExhaustedFlow(): void;
61
+ handleProPlanCreditExhaustedFlow(): void;
62
+ handleStudentOnPaidPlanCreditExhaustedFlow(): void;
63
+ handleOpenContactAdminFlow(adminEmail: string): void;
64
+ handleCreditExhaustedWithUserOnFreePackageFlow({ subscriptionId, expiryDate }: {
65
+ subscriptionId: string;
66
+ expiryDate: string;
67
+ }): void;
68
+ handleCreditExhaustedWithUserOnStarterPackageFlow({ subscriptionId, expiryDate }: {
69
+ subscriptionId: string;
70
+ expiryDate: string;
71
+ }): void;
72
+ handleCreditExhaustedWithUserOnProPackageFlow({ expiryDate }: {
73
+ expiryDate: string;
74
+ }): void;
75
+ handleFailureOnBillingPageTriggerFlow(): void;
76
+ }
77
+ export {};
@@ -0,0 +1,51 @@
1
+ export declare const SUBSCRIPTION_V2_TRIGGERS: {
2
+ PRICING_MODAL: string;
3
+ TOP_UP_CREDIT: string;
4
+ CONTACT_ADMIN: string;
5
+ BILLING_PAGE: string;
6
+ };
7
+ export declare const SUBSCRIPTION_MESSAGES: {
8
+ CREDIT_EXHAUSTED: {
9
+ FREE_PACKAGE: ({ expiryDate }: {
10
+ expiryDate: string;
11
+ }) => string;
12
+ STARTER_PACKAGE: ({ expiryDate }: {
13
+ expiryDate: string;
14
+ }) => string;
15
+ PRO_PACKAGE: ({ expiryDate }: {
16
+ expiryDate: string;
17
+ }) => string;
18
+ STUDENT_UNDER_PAID_PACKAGE_EMAIL_BODY: ({ currentTenantOrg, userEmail, }: {
19
+ currentTenantOrg: string;
20
+ userEmail: string;
21
+ }) => string;
22
+ STUDENT_UNDER_PAID_PACKAGE_EMAIL_SUBJECT: ({ currentTenantOrg, }: {
23
+ currentTenantOrg: string;
24
+ }) => string;
25
+ ADMIN: string;
26
+ STUDENT: string;
27
+ FREE_TRIAL_LIMIT: string;
28
+ NO_APP: string;
29
+ };
30
+ ACTION_BUTTONS: {
31
+ FREE_PACKAGE: string;
32
+ STARTER_PACKAGE: string;
33
+ PRO_PACKAGE: string;
34
+ UPGRADE: string;
35
+ TOP_UP: string;
36
+ CONTACT_ADMIN: string;
37
+ ADD_CREDITS: string;
38
+ };
39
+ TOAST_MESSAGES: {
40
+ PRICING_PAGE_LOAD_ERROR: string;
41
+ TOP_UP_CREDIT_TRIGGER_LOAD_ERROR: string;
42
+ REDIRECTING_BILLING_PAGE: string;
43
+ BILLING_PAGE_TRIGGER_LOAD_ERROR: string;
44
+ };
45
+ };
46
+ export declare const SUBSCRIPTION_PACKAGES: {
47
+ PRE_FREE_PACKAGE: string;
48
+ FREE_PACKAGE: (productName: string) => string;
49
+ STARTER_PACKAGE: (productName: string) => string;
50
+ PRO_PACKAGE: (productName: string) => string;
51
+ };
@@ -0,0 +1,7 @@
1
+ import { PricingModalData } from "@web-utils/types/subscription";
2
+ export declare const useExternalPricingPlan: ({ pricingModalData, userEmail }: {
3
+ pricingModalData: PricingModalData;
4
+ userEmail: string;
5
+ }) => {
6
+ pricingBoxIframeRef: import("node_modules/@types/react").RefObject<null>;
7
+ };
@@ -0,0 +1,16 @@
1
+ import { SubscriptionFlowV2 } from "./class-subscription-flow";
2
+ /**
3
+ * Hook to handle subscription logic
4
+ * @param subscriptionFlow Instance of SubscriptionFlow that manages different subscription states and actions
5
+ */
6
+ export declare const useSubscriptionHandlerV2: (subscriptionFlow: SubscriptionFlowV2) => {
7
+ handleSubscriptionCheck: () => Promise<void>;
8
+ bannerButtonTriggerCallback: (trigger: string) => ((returnURL?: string) => Promise<void>) | (() => void);
9
+ CREDIT_INTERVAL_CHECK_COUNTER: number;
10
+ getBillingURL: ({ returnURL, includeSubscriptionIdIfNeeded, }: {
11
+ returnURL: string;
12
+ includeSubscriptionIdIfNeeded?: boolean;
13
+ }) => Promise<string | null | undefined>;
14
+ getTopUpURL: (obtainBillingPageURLIfNeeded?: boolean) => Promise<string | null | undefined>;
15
+ getUserSubscriptionPackage: () => Promise<string | null>;
16
+ };
@@ -0,0 +1,41 @@
1
+ import { TenantMetadata } from "./types";
2
+ declare const CONFIG_MAP: {
3
+ base: ConfigFile;
4
+ skillsAI: ConfigFile;
5
+ mentorAI: ConfigFile;
6
+ };
7
+ export interface ConfigSetting {
8
+ slug: string;
9
+ label: string;
10
+ defaultValue: any;
11
+ description: string;
12
+ type: "boolean" | "string" | "number";
13
+ SPA?: string;
14
+ }
15
+ export interface ConfigFile {
16
+ spa?: string;
17
+ settings: ConfigSetting[];
18
+ }
19
+ /**
20
+ * Loads all metadata configurations for a given SPA
21
+ * @param spa - The SPA identifier (e.g., 'mentorAI', 'skillsAI', 'mentor', 'skills'). If not provided, returns all SPAs
22
+ * @returns Array of TenantMetadata objects
23
+ */
24
+ export declare function loadMetadataConfig(spa?: string): TenantMetadata[];
25
+ /**
26
+ * Gets all available SPAs from the configuration
27
+ * @returns Array of SPA identifiers
28
+ */
29
+ export declare function getAvailableSPAs(): string[];
30
+ /**
31
+ * Gets configuration for a specific SPA
32
+ * @param spa - The SPA identifier
33
+ * @returns ConfigFile object or null if not found
34
+ */
35
+ export declare function getSPAConfig(spa: string): ConfigFile | null;
36
+ /**
37
+ * Gets all configurations
38
+ * @returns Object with all configurations
39
+ */
40
+ export declare function getAllConfigs(): typeof CONFIG_MAP;
41
+ export {};
@@ -0,0 +1,9 @@
1
+ export interface TenantMetadata {
2
+ slug: string;
3
+ label: string;
4
+ defaultValue: any;
5
+ SPA?: string;
6
+ value?: any;
7
+ }
8
+ export declare const METADATAS: import("./types").TenantMetadata[];
9
+ export { loadMetadataConfig } from './config-loader';
@@ -0,0 +1,9 @@
1
+ export interface TenantMetadata {
2
+ slug: string;
3
+ label: string;
4
+ defaultValue: any;
5
+ SPA?: string;
6
+ value?: any;
7
+ description?: string;
8
+ type?: "boolean" | "string" | "number";
9
+ }
@@ -0,0 +1,24 @@
1
+ export declare const useTenantMetadata: ({ org, spa }: {
2
+ org: string;
3
+ spa?: string;
4
+ }) => {
5
+ metadata: any;
6
+ isLoading: boolean;
7
+ isError: boolean;
8
+ isSkillsAssignmentsFeatureHidden: () => boolean;
9
+ isSkillsResumeFeatureHidden: () => boolean;
10
+ isMentorAIEnabled: () => boolean;
11
+ isSkillsLeaderBoardEnabled: () => boolean;
12
+ getEmbeddedMentorToUse: () => any;
13
+ metadataLoaded: any;
14
+ getAllMetadatas: () => {
15
+ value: any;
16
+ slug: string;
17
+ label: string;
18
+ defaultValue: any;
19
+ SPA?: string;
20
+ description?: string;
21
+ type?: "boolean" | "string" | "number";
22
+ }[];
23
+ getSupportEmail: () => any;
24
+ };
@@ -0,0 +1,7 @@
1
+ import type { OpUnitType } from "dayjs";
2
+ import duration from "dayjs/plugin/duration";
3
+ export declare const useDayJs: () => {
4
+ getTimeDifferenceBetweenTwoDates: (futureDate: string, pastDate: string, format?: OpUnitType) => number;
5
+ getDayJSDurationObjFromSeconds: (seconds: number) => duration.Duration;
6
+ generateFutureDateForNMinutes: (minute?: number) => string;
7
+ };
@@ -0,0 +1,21 @@
1
+ type Props = {
2
+ mentorId: string;
3
+ tenantKey: string;
4
+ username: string;
5
+ };
6
+ export declare function useMentorSettings({ mentorId, tenantKey, username }: Props): {
7
+ data: {
8
+ profileImage: string | null | undefined;
9
+ greetingMethod: string | undefined;
10
+ proactiveResponse: string | undefined;
11
+ llmProvider: any;
12
+ llmName: string | undefined;
13
+ mentorUniqueId: string | undefined;
14
+ mentorName: string | undefined;
15
+ enableGuidedPrompts: boolean | undefined;
16
+ mentorSlug: string | undefined;
17
+ safetyDisclaimer: any;
18
+ mentorTools: any;
19
+ };
20
+ };
21
+ export {};
@@ -0,0 +1,5 @@
1
+ export * from "./hooks";
2
+ export * from "./providers";
3
+ export * from "./utils";
4
+ export * from "./types";
5
+ export * from "./features";
@@ -0,0 +1,64 @@
1
+ /**
2
+ * AuthProvider Component
3
+ *
4
+ * Provider that handles authentication state and route protection.
5
+ * It manages authentication checks, public route access, and redirects to auth SPA when needed.
6
+ */
7
+ import React from "react";
8
+ import { StorageService } from "@iblai/data-layer";
9
+ export declare function getUserName(storageService: StorageService): Promise<any>;
10
+ export declare function useAuthProvider({ middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, storageService, skipAuthCheck, token, }: Props): {
11
+ isAuthenticating: boolean;
12
+ userIsAccessingPublicRoute: boolean;
13
+ setUserIsAccessingPublicRoute: React.Dispatch<React.SetStateAction<boolean>>;
14
+ };
15
+ /**
16
+ * Type definition for the authentication context
17
+ * Tracks whether the user is accessing a public route and provides a setter
18
+ */
19
+ export type AuthContextType = {
20
+ userIsAccessingPublicRoute: boolean;
21
+ setUserIsAccessingPublicRoute: (iuserIsAccessingPublicRoute: boolean) => void;
22
+ };
23
+ export declare const AuthContext: React.Context<AuthContextType | undefined>;
24
+ /**
25
+ * Hook to access the auth context
26
+ * @throws Error if used outside of AuthContextProvider
27
+ */
28
+ export declare const useAuthContext: () => AuthContextType;
29
+ /**
30
+ * Context Provider component that wraps children with auth context
31
+ */
32
+ export declare const AuthContextProvider: ({ value, children, }: {
33
+ value: AuthContextType;
34
+ children: React.ReactNode;
35
+ }) => import("node_modules/@types/react/jsx-runtime").JSX.Element;
36
+ /**
37
+ * Props for the AuthProvider component
38
+ */
39
+ type Props = {
40
+ children?: React.ReactNode;
41
+ fallback?: React.ReactNode;
42
+ middleware?: Map<string | RegExp, () => Promise<boolean>>;
43
+ onAuthSuccess?: () => void;
44
+ onAuthFailure?: (reason: string) => void;
45
+ redirectToAuthSpa: () => void;
46
+ hasNonExpiredAuthToken: () => boolean;
47
+ username: string;
48
+ pathname: string;
49
+ skipAuthCheck?: boolean;
50
+ storageService?: StorageService;
51
+ token?: string;
52
+ };
53
+ /**
54
+ * AuthProvider Component
55
+ *
56
+ * Main authentication provider that:
57
+ * 1. Checks if the current route requires authentication
58
+ * 2. Validates the auth token
59
+ * 3. Fetches user metadata to verify authentication
60
+ * 4. Handles redirects to auth SPA when needed
61
+ * 5. Manages public route access state
62
+ */
63
+ export declare function AuthProvider({ children, fallback, middleware, onAuthSuccess, onAuthFailure, redirectToAuthSpa, hasNonExpiredAuthToken, username, pathname, skipAuthCheck, storageService, token, }: Props): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("node_modules/@types/react/jsx-runtime").JSX.Element | null | undefined;
64
+ export {};
@@ -0,0 +1,3 @@
1
+ export * from "./auth-provider";
2
+ export * from "./mentor-provider";
3
+ export * from "./tenant-provider";
@@ -0,0 +1,40 @@
1
+ /**
2
+ * MentorProvider Component
3
+ *
4
+ * Provider that manages AI mentor selection and redirection logic.
5
+ * It handles:
6
+ * - Mentor selection based on user preferences and history
7
+ * - Mentor seeding for new tenants
8
+ * - Redirection to appropriate mentor or creation flow
9
+ * - Integration with tenant context for access control
10
+ */
11
+ import React from "react";
12
+ /**
13
+ * Props for the MentorProvider component
14
+ */
15
+ type Props = {
16
+ children?: React.ReactNode;
17
+ fallback?: React.ReactNode;
18
+ onAuthSuccess?: () => void;
19
+ onAuthFailure?: (reason: string) => void;
20
+ redirectToAuthSpa: () => void;
21
+ redirectToMentor: (tenantKey: string, mentorId: string) => void;
22
+ redirectToNoMentorsPage: () => void;
23
+ redirectToCreateMentor: () => void;
24
+ username: string;
25
+ isAdmin: boolean;
26
+ mainTenantKey: string;
27
+ requestedMentorId?: string;
28
+ handleMentorNotFound?: () => Promise<void>;
29
+ };
30
+ /**
31
+ * MentorProvider Component
32
+ *
33
+ * Main mentor provider that:
34
+ * 1. Determines the most appropriate mentor for the user
35
+ * 2. Handles mentor seeding for new tenants
36
+ * 3. Manages redirection based on mentor availability
37
+ * 4. Integrates with tenant context for access control
38
+ */
39
+ export declare function MentorProvider({ children, fallback, onAuthSuccess, onAuthFailure, redirectToAuthSpa, redirectToMentor, redirectToNoMentorsPage, redirectToCreateMentor, username, isAdmin, mainTenantKey, requestedMentorId, handleMentorNotFound, }: Props): React.ReactNode;
40
+ export {};
@@ -0,0 +1,63 @@
1
+ /**
2
+ * TenantProvider
3
+ *
4
+ * Provider that manages tenant-related state and access control.
5
+ * It handles:
6
+ * - Tenant validation and access control
7
+ * - Tenant switching logic
8
+ * - Tenant metadata retrieval
9
+ * - User-tenant relationship verification
10
+ */
11
+ import React from "react";
12
+ import { z } from "zod";
13
+ import { tenantSchema } from "@web-utils/types";
14
+ /**
15
+ * Type definition for the tenant context
16
+ * Tracks whether the user's path needs to be determined and provides a setter
17
+ */
18
+ export type TenantContextType = {
19
+ determineUserPath: boolean;
20
+ setDetermineUserPath: (value: boolean) => void;
21
+ tenantKey: string;
22
+ metadata: Record<string, any>;
23
+ setMetadata: (metadata: Record<string, any>) => void;
24
+ };
25
+ export declare const TenantContext: React.Context<TenantContextType | undefined>;
26
+ /**
27
+ * Context Provider component that wraps children with tenant context
28
+ */
29
+ export declare const TenantContextProvider: React.FC<{
30
+ value: TenantContextType;
31
+ children: React.ReactNode;
32
+ }>;
33
+ /**
34
+ * Hook to access the tenant context
35
+ * @returns TenantContextType
36
+ */
37
+ export declare const useTenantContext: () => TenantContextType;
38
+ /**
39
+ * Props for the TenantProvider component
40
+ */
41
+ type Props = {
42
+ children?: React.ReactNode;
43
+ fallback?: React.ReactNode;
44
+ onAuthSuccess?: () => void;
45
+ onAuthFailure?: (reason: string) => void;
46
+ currentTenant: string;
47
+ requestedTenant: string;
48
+ handleTenantSwitch: (tenant: string, saveRedirect: boolean) => Promise<void>;
49
+ saveCurrentTenant: (tenant: z.infer<typeof tenantSchema>) => void;
50
+ saveUserTenants: (tenants: z.infer<typeof tenantSchema>[]) => void;
51
+ };
52
+ /**
53
+ * TenantProvider Component
54
+ *
55
+ * Main tenant provider that:
56
+ * 1. Validates user's access to requested tenant
57
+ * 2. Manages tenant switching
58
+ * 3. Retrieves and validates tenant metadata
59
+ * 4. Handles tenant-specific domain redirects
60
+ * 5. Maintains tenant access state
61
+ */
62
+ export declare function TenantProvider({ children, fallback, onAuthSuccess, onAuthFailure, currentTenant, requestedTenant, saveCurrentTenant, saveUserTenants, handleTenantSwitch, }: Props): string | number | bigint | boolean | Iterable<React.ReactNode> | Promise<string | number | bigint | boolean | React.ReactPortal | React.ReactElement<unknown, string | React.JSXElementConstructor<any>> | Iterable<React.ReactNode> | null | undefined> | import("node_modules/@types/react/jsx-runtime").JSX.Element | null | undefined;
63
+ export {};
@@ -0,0 +1 @@
1
+ export type ChatMode = "advanced" | "default";
@@ -0,0 +1,55 @@
1
+ import { z } from "zod";
2
+ export declare const userDataSchema: z.ZodObject<{
3
+ user_display_name: z.ZodString;
4
+ user_email: z.ZodString;
5
+ user_fullname: z.ZodString;
6
+ user_id: z.ZodNumber;
7
+ user_nicename: z.ZodString;
8
+ }, "strip", z.ZodTypeAny, {
9
+ user_display_name: string;
10
+ user_email: string;
11
+ user_fullname: string;
12
+ user_id: number;
13
+ user_nicename: string;
14
+ }, {
15
+ user_display_name: string;
16
+ user_email: string;
17
+ user_fullname: string;
18
+ user_id: number;
19
+ user_nicename: string;
20
+ }>;
21
+ export declare const tenantSchema: z.ZodObject<{
22
+ key: z.ZodString;
23
+ is_admin: z.ZodBoolean;
24
+ org: z.ZodString;
25
+ }, "strip", z.ZodTypeAny, {
26
+ key: string;
27
+ is_admin: boolean;
28
+ org: string;
29
+ }, {
30
+ key: string;
31
+ is_admin: boolean;
32
+ org: string;
33
+ }>;
34
+ export declare const tenantKeySchema: z.ZodString;
35
+ export type TenantKeyMentorIdParams = {
36
+ tenantKey: string;
37
+ mentorId: string;
38
+ };
39
+ export interface TopTrialBannerProps {
40
+ parentContainer: string;
41
+ bannerText?: string;
42
+ onUpgrade?: string;
43
+ loading?: boolean;
44
+ tooltipText?: string;
45
+ }
46
+ export interface Prompt {
47
+ type: "static" | "human" | "ai";
48
+ icon?: string;
49
+ summary?: string;
50
+ content?: string;
51
+ proactive?: boolean;
52
+ hide?: boolean;
53
+ tag?: string;
54
+ }
55
+ export * from "./chat";
@@ -0,0 +1,18 @@
1
+ import { StripeCustomerPortalRequest } from "@iblai/iblai-api";
2
+ export interface UseExternalPricingProps {
3
+ referenceId: string;
4
+ customerEmail: string;
5
+ publishableKey: string;
6
+ pricingId?: string;
7
+ }
8
+ export interface PricingModalData {
9
+ referenceId: string;
10
+ customerEmail: string;
11
+ publishableKey: string;
12
+ pricingTableId: string;
13
+ }
14
+ export interface CreateStripeCustomerPortalRequest {
15
+ org: string;
16
+ userId: string;
17
+ requestBody: StripeCustomerPortalRequest;
18
+ }
@@ -0,0 +1,37 @@
1
+ export declare const MENTOR_CHAT_DOCUMENTS_EXTENSIONS: string[];
2
+ export declare const ANONYMOUS_USERNAME = "anonymous";
3
+ export declare const LOCAL_STORAGE_KEYS: {
4
+ CURRENT_TENANT: string;
5
+ TENANTS: string;
6
+ REDIRECT_TO: string;
7
+ AUTH_TOKEN: string;
8
+ TOKEN_EXPIRY: string;
9
+ USER_DATA: string;
10
+ USER_TENANTS: string;
11
+ EDX_TOKEN_KEY: string;
12
+ DM_TOKEN_KEY: string;
13
+ };
14
+ export declare const TOOLS: {
15
+ readonly WEB_SEARCH: "web-search";
16
+ readonly WIKIPEDIA_SEARCH: "wikipedia-search";
17
+ readonly COURSE_CREATION: "course-creation";
18
+ readonly MCP: "mcp";
19
+ readonly IMAGE_GENERATION: "image-generation";
20
+ readonly IBL_PATHWAY_DOCUMENTS_RETRIEVER: "ibl-pathway-documents-retriever";
21
+ readonly TRAINED_DOCUMENTS: "trained-documents";
22
+ readonly IBL_SESSION_DOCUMENTS_RETRIEVER: "ibl-session-documents-retriever";
23
+ readonly PLAYWRIGHT_BROWSER: "playwright-browser";
24
+ readonly HUMAN_SUPPORT: "human-support";
25
+ readonly CODE_INTERPRETER: "code-interpreter";
26
+ readonly DEEP_RESEARCH: "deep-research";
27
+ readonly MEMORY: "memory";
28
+ readonly SCREEN_SHARE: "screen-share";
29
+ readonly POWERPOINT: "powerpoint";
30
+ readonly PROMPT: "prompt";
31
+ readonly QUIZ: "quiz";
32
+ readonly RUBRIC: "rubric";
33
+ readonly RESOURCE: "resource";
34
+ readonly LESSON_PLAN: "lesson-plan";
35
+ readonly SYLLABUS: "syllabus";
36
+ readonly CANVAS: "canvas";
37
+ };
@@ -0,0 +1,62 @@
1
+ export declare const advancedTabsProperties: {
2
+ chat: {
3
+ display: string;
4
+ name: string;
5
+ tag: string;
6
+ showHeader: boolean;
7
+ prompts: {
8
+ type: string;
9
+ icon: string;
10
+ summary: string;
11
+ content: string;
12
+ }[];
13
+ };
14
+ summarize: {
15
+ display: string;
16
+ showHeader: boolean;
17
+ name: string;
18
+ tag: string;
19
+ prompts: {
20
+ type: string;
21
+ proactive: boolean;
22
+ hide: boolean;
23
+ content: string;
24
+ }[];
25
+ };
26
+ translate: {
27
+ display: string;
28
+ showHeader: boolean;
29
+ name: string;
30
+ tag: string;
31
+ description: string;
32
+ metaDescription: string;
33
+ prompts: ({
34
+ type: string;
35
+ hide: boolean;
36
+ tag: string;
37
+ summary: string;
38
+ content: string;
39
+ } | {
40
+ type: string;
41
+ summary: string;
42
+ content: string;
43
+ hide?: undefined;
44
+ tag?: undefined;
45
+ })[];
46
+ };
47
+ expand: {
48
+ display: string;
49
+ showHeader: boolean;
50
+ name: string;
51
+ tag: string;
52
+ prompts: {
53
+ type: string;
54
+ proactive: boolean;
55
+ hide: boolean;
56
+ content: string;
57
+ }[];
58
+ };
59
+ };
60
+ export declare const advancedTabs: ("chat" | "summarize" | "translate" | "expand")[];
61
+ export type AdvancedTab = keyof typeof advancedTabsProperties;
62
+ export declare const translatePrompt: (language: string) => string;
@@ -0,0 +1,6 @@
1
+ export declare const isJSON: (text: string) => boolean;
2
+ export declare const getInitials: (fullName: string) => string;
3
+ export declare const ALPHANUMERIC_32_REGEX: RegExp;
4
+ export declare const isAlphaNumeric32: (text: string) => boolean;
5
+ export declare const addProtocolToUrl: (url: string) => string;
6
+ export declare function getTimeAgo(createdAt: string): string;
@@ -0,0 +1,3 @@
1
+ export * from "./data/advanced-tab";
2
+ export * from "./constants";
3
+ export * from "./helpers";