@iblai/iblai-js 1.11.7 → 1.12.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.
@@ -198824,9 +198824,9 @@ const createDynamicSchema = (schemaFields) => {
198824
198824
  provider: z$3.string().min(1, 'Provider is required'),
198825
198825
  };
198826
198826
  schemaFields.forEach((field) => {
198827
- schemaObj[field] = z$3
198827
+ schemaObj[field.name] = z$3
198828
198828
  .string()
198829
- .min(1, `${field.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase())} is required`);
198829
+ .min(1, `${field.name.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase())} is required`);
198830
198830
  });
198831
198831
  return z$3.object(schemaObj);
198832
198832
  };
@@ -198852,7 +198852,14 @@ function CreateDataSourceModal({ isOpen, onClose, tenantKey, onSuccess }) {
198852
198852
  if (selectedProvider && availableProviders.length > 0) {
198853
198853
  const providerSchema = availableProviders.find((p) => p.name === selectedProvider);
198854
198854
  if (providerSchema) {
198855
- const fields = Object.keys(providerSchema.schema);
198855
+ const fields = Object.entries(providerSchema.schema).map(([name, meta]) => {
198856
+ var _a;
198857
+ return ({
198858
+ name,
198859
+ type: (_a = meta === null || meta === void 0 ? void 0 : meta.type) !== null && _a !== void 0 ? _a : 'string',
198860
+ isSensitive: Boolean(meta === null || meta === void 0 ? void 0 : meta.is_sensitive),
198861
+ });
198862
+ });
198856
198863
  setSchemaFields(fields);
198857
198864
  setShowProviderForm(true);
198858
198865
  }
@@ -198867,8 +198874,8 @@ function CreateDataSourceModal({ isOpen, onClose, tenantKey, onSuccess }) {
198867
198874
  try {
198868
198875
  const requestValue = {};
198869
198876
  schemaFields.forEach((field) => {
198870
- if (value[field]) {
198871
- requestValue[field] = value[field];
198877
+ if (value[field.name]) {
198878
+ requestValue[field.name] = value[field.name];
198872
198879
  }
198873
198880
  });
198874
198881
  await createIntegrationCredential({
@@ -198919,13 +198926,16 @@ function CreateDataSourceModal({ isOpen, onClose, tenantKey, onSuccess }) {
198919
198926
  provider.name;
198920
198927
  return (jsx(SelectItem, { value: provider.name, children: jsxs("div", { className: "flex items-center gap-2", children: [providerLogo ? (jsx("img", { src: providerLogo, alt: provider.name, className: "w-4 h-4 rounded-sm object-contain" })) : (jsx("span", { children: "\uD83D\uDD11" })), providerName || provider.name] }) }, provider.name));
198921
198928
  }) })] }), shouldShowError && (jsx("p", { className: "text-red-500 text-xs", children: (_b = field.state.meta.errors[0]) === null || _b === void 0 ? void 0 : _b.message }))] }));
198922
- } })), isIntegrationSchemaLoading && (jsxs("div", { className: "flex items-center justify-center py-4", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin mr-2" }), jsx("span", { className: "text-sm text-gray-600", children: "Loading provider configurations..." })] })), showProviderForm && !isIntegrationSchemaLoading && (jsx(Fragment$1, { children: schemaFields.map((fieldName) => (jsx(form.Field, { name: fieldName, children: (field) => {
198929
+ } })), isIntegrationSchemaLoading && (jsxs("div", { className: "flex items-center justify-center py-4", children: [jsx(LoaderCircle, { className: "h-4 w-4 animate-spin mr-2" }), jsx("span", { className: "text-sm text-gray-600", children: "Loading provider configurations..." })] })), showProviderForm && !isIntegrationSchemaLoading && (jsx(Fragment$1, { children: schemaFields.map((schemaField) => (jsx(form.Field, { name: schemaField.name, children: (field) => {
198923
198930
  var _a, _b;
198924
198931
  const hasError = ((_a = field.state.meta.errors) === null || _a === void 0 ? void 0 : _a.length) > 0;
198925
198932
  const isTouched = field.state.meta.isTouched;
198926
198933
  const shouldShowError = hasError && isTouched;
198927
- return (jsxs("div", { className: "space-y-1.5", children: [jsxs(Label, { className: "flex items-center text-sm font-medium text-[#646464]", children: [fieldName.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase()), jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsx(Input, { placeholder: `Enter ${fieldName.replace(/_/g, ' ').replace(/\b\w/g, (l) => l.toUpperCase())}`, value: field.state.value || '', onChange: (event) => field.handleChange(event.target.value), onBlur: () => field.handleBlur(), autoComplete: "off" }), shouldShowError && (jsx("p", { className: "text-red-500 text-xs", children: ((_b = field.state.meta.errors[0]) === null || _b === void 0 ? void 0 : _b.message) || 'This field is required' }))] }));
198928
- } }, fieldName))) })), jsx(DialogFooter, { className: "justify-end", children: jsx(form.Subscribe, { selector: (state) => ({ canSubmit: state.canSubmit }), children: ({ canSubmit }) => (jsx(Button$1, { type: "submit", disabled: !canSubmit || isLoading || isIntegrationSchemaLoading, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isLoading ? 'Submitting...' : 'Submit' })) }) })] })] }) }));
198934
+ const formattedLabel = schemaField.name
198935
+ .replace(/_/g, ' ')
198936
+ .replace(/\b\w/g, (l) => l.toUpperCase());
198937
+ return (jsxs("div", { className: "space-y-1.5", children: [jsxs(Label, { className: "flex items-center text-sm font-medium text-[#646464]", children: [formattedLabel, jsx("span", { className: "ml-1 text-red-500", children: "*" })] }), jsx(Input, { type: schemaField.isSensitive ? 'password' : 'text', placeholder: `Enter ${formattedLabel}`, value: field.state.value || '', onChange: (event) => field.handleChange(event.target.value), onBlur: () => field.handleBlur(), autoComplete: schemaField.isSensitive ? 'new-password' : 'off' }), shouldShowError && (jsx("p", { className: "text-red-500 text-xs", children: ((_b = field.state.meta.errors[0]) === null || _b === void 0 ? void 0 : _b.message) || 'This field is required' }))] }));
198938
+ } }, schemaField.name))) })), jsx(DialogFooter, { className: "justify-end", children: jsx(form.Subscribe, { selector: (state) => ({ canSubmit: state.canSubmit }), children: ({ canSubmit }) => (jsx(Button$1, { type: "submit", disabled: !canSubmit || isLoading || isIntegrationSchemaLoading, className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] text-white hover:opacity-90", children: isLoading ? 'Submitting...' : 'Submit' })) }) })] })] }) }));
198929
198939
  }
198930
198940
 
198931
198941
  function IntegrationDataSourcesTab({ tenantKey, }) {
@@ -219068,7 +219078,7 @@ function Chat({ mode = 'default', isPreviewMode = false, hasBorder = true, isInC
219068
219078
  }
219069
219079
 
219070
219080
  function TasksTabToolbar({ taskDate, setTaskDate, setIsScheduleTaskDialogOpen, searchQuery, setSearchQuery, labels, }) {
219071
- return (jsxs("div", { className: "flex flex-col sm:flex-row items-center gap-4", children: [jsxs("div", { className: "relative flex-1 w-full", children: [jsx(Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-500" }), jsx(Input, { className: "pl-10 w-full", placeholder: labels.toolbar.searchPlaceholder, value: searchQuery, onChange: (e) => setSearchQuery(e.target.value) })] }), jsxs(Popover, { children: [jsx(PopoverTrigger, { asChild: true, children: jsxs(Button$1, { variant: "outline", className: "flex items-center gap-2 justify-start w-full sm:w-auto bg-transparent", children: [jsx(Calendar$1, { className: "h-4 w-4" }), jsx("span", { children: taskDate ? format(taskDate, 'MM/dd/yyyy') : labels.toolbar.selectDate })] }) }), jsx(PopoverContent, { className: "w-auto p-0", align: "start", portalled: false, children: jsx(Calendar, { mode: "single", selected: taskDate, onSelect: setTaskDate, classNames: {
219081
+ return (jsxs("div", { className: "flex flex-col sm:flex-row items-center gap-4", children: [jsxs("div", { className: "relative flex-1 w-full", children: [jsx(Search, { className: "absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-gray-500" }), jsx(Input, { className: "pl-10 w-full", placeholder: labels.toolbar.searchPlaceholder, value: searchQuery, onChange: (e) => setSearchQuery(e.target.value) })] }), jsxs(Popover, { children: [jsx(PopoverTrigger, { asChild: true, children: jsxs(Button$1, { variant: "outline", className: "flex items-center gap-2 justify-start w-full sm:w-auto bg-transparent border-[#2563EB] text-[#2563EB]", children: [jsx(Calendar$1, { className: "h-4 w-4" }), jsx("span", { children: taskDate ? format(taskDate, 'MM/dd/yyyy') : labels.toolbar.selectDate })] }) }), jsx(PopoverContent, { className: "w-auto p-0", align: "start", portalled: false, children: jsx(Calendar, { mode: "single", selected: taskDate, onSelect: setTaskDate, classNames: {
219072
219082
  day_button: 'data-[selected-single=true]:bg-[#2563EB] data-[selected-single=true]:text-white data-[range-start=true]:bg-[#2563EB] data-[range-start=true]:text-white data-[range-end=true]:bg-[#2563EB] data-[range-end=true]:text-white',
219073
219083
  today: 'bg-blue-50 text-[#2563EB] data-[selected=true]:bg-[#2563EB] data-[selected=true]:text-white',
219074
219084
  }, initialFocus: true }) })] }), jsxs(Button$1, { className: "bg-gradient-to-r from-[#2563EB] to-[#93C5FD] hover:opacity-90 text-white font-medium w-full sm:w-auto", onClick: () => setIsScheduleTaskDialogOpen(true), children: [jsx(Plus, { className: "h-4 w-4 mr-2" }), labels.toolbar.scheduleTask] })] }));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iblai/iblai-js",
3
- "version": "1.11.7",
3
+ "version": "1.12.0",
4
4
  "description": "Unified JavaScript SDK for IBL.ai — re-exports data-layer, web-containers, and web-utils under a single package",
5
5
  "type": "module",
6
6
  "engines": {
@@ -61,10 +61,10 @@
61
61
  "axios": "1.13.6",
62
62
  "dotenv": "16.6.1",
63
63
  "winston": "3.19.0",
64
- "@iblai/web-containers": "1.7.7",
64
+ "@iblai/data-layer": "1.6.0",
65
65
  "@iblai/web-utils": "1.7.1",
66
- "@iblai/data-layer": "1.5.11",
67
- "@iblai/mcp": "1.4.14"
66
+ "@iblai/web-containers": "1.8.0",
67
+ "@iblai/mcp": "1.5.0"
68
68
  },
69
69
  "peerDependencies": {
70
70
  "@radix-ui/react-dialog": "^1.1.7",