45 Commits

Author SHA1 Message Date
Junaid d9ec9cbf38 refactor(chat): migrate to new AI SDK packages
- Add @ai-sdk/mcp and @ai-sdk/react dependencies
- Switch from @ai-sdk/openai to @openrouter/ai-sdk-provider
- Use useChat hook instead of custom useChatSubmission
- Update completion API with convertToModelMessages and stepCountIs
- Simplify stream handling using toUIMessageStreamResponse
- Improve cookie handling in CookieAwareTransport with getSetCookie support
2026-02-09 08:44:05 +05:00
Junaid bfd129dfb0 Refactor: Remove console logs and improve OAuth state handling
- Removed unnecessary console logs from various functions to clean up the codebase.
- Updated `getProductFunction` and `oAuthFunction` in Shopify and Openfront integrations to use passed state for OAuth flow.
- Enhanced error handling in `createShop` and `handlePlatformActivation` functions with user-friendly messages.
- Adjusted the `CreatePlatform` component to provide feedback using toast notifications upon successful platform creation.
- Cleaned up webhook verification and other integration functions for better readability and maintainability.
2025-12-09 09:40:10 -06:00
Junaid fee4fce8ba feat: add AI chat functionality with empty and unactivated states
- Implemented ChatEmptyState component for displaying a friendly message when no chat is available.
- Created ChatUnactivatedState component to prompt users to activate the AI assistant.
- Developed use-ai-config hook for managing AI configuration settings, including local and shared key modes.
- Added use-chat-submission hook to handle message submissions and responses from the AI.
- Enhanced error handling and user feedback during chat interactions.
2025-09-01 23:55:29 -07:00
Junaid d0757a25ac refactor: Improve CreateChannelFromURL and CreateShopFromURL components for better readability and maintainability
- Enhanced conditional checks and removed unnecessary console logs.
- Updated capitalization for "Openfront" in various components.
- Improved handling of URL parameters after successful channel/shop creation.
- Refactored badge components to use a consistent style across PlatformTabs, StatusTabs, and MatchesTabs.
- Added delete functionality with confirmation dialog in OrderDetailsComponent.
- Enhanced logging in createShop action for better debugging.
2025-09-01 13:05:59 -07:00
Junaid a1a1be4c28 feat(api): add comprehensive webhook logging for order processing
Added detailed console logging throughout the webhook processing pipeline to improve debugging and monitoring capabilities. This includes logging of incoming webhook data, shop/platform information, order transformation steps, and final order creation results.

The logging covers:
- Webhook receipt with headers and body
- Shop lookup results and platform details
- Order data transformation process
- Final order creation with line items
- Error handling with full stack traces

This will help diagnose webhook processing issues and provide better visibility into the order creation flow.
2025-08-23 08:41:27 -07:00
Junaid 1f4daa39e3 refactor(openfront): remove debug logs and refactor token handling
Removes debug logs throughout the codebase and refactors OpenFront token handling to use OAuth 2.0 refresh tokens.
BREAKING CHANGE: OAuth reverse callback route removed and token refresh mechanism changed
2025-08-22 17:01:58 -07:00
Junaid 847b39ec0f feat(auth): add OpenFront OAuth flow and marketplace support
Implement OAuth callback handling for OpenFront, support marketplace flow, update channel creation to handle platform creation inline, add helper to fetch channel platform by client_id, and adjust UI components accordingly.
2025-08-19 13:30:46 -07:00
Junaid 4e6431c6bc feat(api): add OpenFront OAuth flow and marketplace support
Add support for OpenFront OAuth callback handling, including marketplace flow and token refresh logic. Introduce `refreshToken` and `tokenExpiresAt` fields to Shop and Channel models and update related actions and components. Remove legacy auto‑create flow and update `createShop` API to accept inline platform creation. Add migration to add new columns. This change is backward incompatible due to removed function and signature changes.

BREAKING CHANGE: removed `handleAutoCreateFlow` and changed `createShop` signature to support inline platform creation.
2025-08-18 14:28:54 -07:00
Junaid c9edbbb843 feat(integration): add Openfront OAuth flow 2025-08-16 16:28:58 -07:00
Junaid d5d725ad89 feat(platform): add OpenFront integration and OAuth flow support
- Add OpenFront channel and shop integration adapters with full GraphQL support
- Implement OAuth callback handling for both channels and shops
- Add dynamic platform detection for OAuth vs manual setup flows
- Create auto-opening dialogs for OAuth redirect completion
- Enhance platform models with appKey/appSecret fields for OAuth
- Add OpenFront to available platform templates
- Improve webhook handling with better topic matching
- Add password visibility toggle to sign-in form
- Increase right sidebar width for better chat experience
- Remove deprecated platform templates (Amazon, eBay, etc.)

BREAKING CHANGE: OAuth callback URLs now use dynamic base URL detection instead of virtual fields
2025-08-11 07:07:55 -07:00
Junaid 0429d0adee feat(db): add password reset token fields to user model
Added three new columns to the User table to support password reset functionality:
- passwordResetToken: stores the reset token
- passwordResetIssuedAt: tracks when the token was issued
- passwordResetRedeemedAt: tracks when the token was used

These fields enable secure password reset flow as implemented in the previous commit.
2025-08-05 18:55:17 -07:00
Junaid 3377053aa9 fix: rename OpenShip to Openship 2025-08-02 10:01:34 -07:00
Junaid 27b0227134 fix: update .gitignore to properly exclude node_modules and build artifacts
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-08-02 09:34:05 -07:00
Junaid 634147e4fe refactor: Clean up and optimize Keystone theme components
- Removed unused files and simplified component structures
- Fixed syntax and formatting issues across multiple files
- Cleaned up imports and removed unnecessary code
- Improved code consistency in Tailwind Orion theme components
- Removed commented-out code and simplified function returns
2025-02-24 19:23:07 -06:00
Junaid edb93e5b29 refactor: Enhance UI components and add sync inventory feature
- Added `syncNeeded` field to Match model for more precise inventory sync
- Updated SyncInventoryDialog to use new `syncNeeded` field for filtering matches
- Refined UI components across platform management pages
- Improved button styles, spacing, and overall component consistency
- Cleaned up unused imports and simplified component structures
2025-01-30 05:14:35 -06:00
Junaid (aider) 28872e6629 refactor: Update MatchList imports to match Orders page structure 2025-01-29 17:31:58 -06:00
Junaid 769c021dd0 refactor: Simplify MatchList UI and remove unused components 2025-01-29 17:31:57 -06:00
Junaid fbeda65efc Refactor UI components for channels and matches management
- Updated button styles to use 'outline' variant for better consistency.
- Replaced deprecated dropdown menu imports with updated paths.
- Adjusted layout margins for improved spacing in channels and matches pages.
- Enhanced button functionality by changing sizes and icons for better user experience.
- Cleaned up unused code and improved overall organization across multiple components.
2025-01-16 01:00:22 -06:00
Junaid bcccb13a51 Refactor and update UI components for platform management
- Updated paths in navigation to reflect new platform structure.
- Removed obsolete components related to order and shop management.
- Enhanced the UI by integrating the Orion theme across various components.
- Cleaned up unused code and improved overall code organization.
- Adjusted loading states and error handling for better user experience.
2025-01-13 01:24:39 -06:00
Junaid 3acfe8ec20 Remove next-view-transitions 2024-10-20 06:49:01 +05:00
Junaid 06d2f1d094 Implement using base path instead of hardcoding path 2024-10-11 01:14:16 +01:00
Junaid 1986566979 Fix order page 2024-10-06 16:56:49 +01:00
Junaid fa1eab1abe Remove unused code and fix OrderPage 2024-10-06 15:17:02 +01:00
Junaid 71f74c61f7 Fix OMS card href 2024-10-03 04:41:01 +01:00
Junaid 37a66a7b79 Refactor OMS UI components and improve homepage layout
- Update Channels, Shops, and Matches pages with responsive layouts
- Add tooltips and improve mobile view for tab navigation
- Refactor CartItem component for better responsiveness
- Enhance MultiSelect and Skeleton components
- Redesign homepage with new OMS section and improved data model cards
- Implement consistent styling and layout across components
2024-10-03 04:29:29 +01:00
Junaid d791688446 Refactor loading skeletons for channels and shops
- Update layout and styling of loading skeletons
- Simplify skeleton structure for better responsiveness
- Adjust platform card skeleton to match new design
- Add "Create platform" text for empty state
2024-10-01 14:45:03 +01:00
Junaid afc0b69a12 Refactor authentication and add sign-up functionality
- Add SignUpPage and ResetPage components
- Update middleware to handle sign-up routes and check for allowed sign-ups
- Reorder imports in fieldViews.js for better organization
- Update Prisma client version to 5.13.0
- Remove unused files (App.js, _document.js, channels.js, index.js, products.js, shops.js, signin.js)
- Implement environment variable NEXT_PUBLIC_ALLOW_SIGNUP to control sign-up access
2024-09-30 03:19:22 +01:00
Junaid 42b9225b91 Enhance order details and refactor filters
- Make order name clickable with external link
- Add orderLink field to ORDERS_QUERY
- Remove unused shops prop from StatusShopFilter component
- Clean up unnecessary code in OrderPage component
2024-09-27 21:41:46 +01:00
Junaid f826955e48 Enhance order management and UI improvements
- Add order link generation functionality
- Improve skeleton loading UI for Channels and Shops
- Update ShopPlatform model with orderLinkFunction
- Refactor order details component to use ProductDetailsCollapsible
- Optimize create-tracking API handler
- Add required scopes for Shopify OAuth
- Implement generateOrderLink function for Shopify adapter
2024-09-27 21:04:00 +01:00
Junaid 80de7acfea Enhance Links functionality and UI improvements
- Add link mode (sequential/simultaneous) to Shop model
- Update Links component to support link mode selection
- Refactor Links component to use useUpdateItem and useDeleteItem hooks
- Improve UI for Links, including better layout and delete button
- Update Webhooks styling in channels and shops components
- Remove Links tab from Channels component
- Minor code cleanup and optimization
2024-09-27 20:05:20 +01:00
Junaid f7f8a27fd8 Refactor and enhance order management system
- Update UI components for improved user experience
  - Add className to Channels.js
  - Refactor CreateChannelButton and CreateShopButton
  - Improve ChannelSearchAccordion, OrderDetailsComponent, and ProcessOrdersDialog
  - Enhance CartItemSelect and LineItemSelect functionality
  - Update ShopCollapsible and ProductDetailsCollapsible components

- Revise channel and shop adapters
  - Add Medusa and Stripe, remove Channelify, BigCommerce, Magento, and WooCommerce
  - Update Shopify adapter and API calls

- Improve API communication
  - Refactor external API calls to use POST method with JSON body
  - Update webhook creation and deletion functions

- Enhance Keystone models and queries
  - Add virtual fields for price changes and inventory sync
  - Update ORDERSCOUNT_QUERY and ORDERS_QUERY
  - Implement "readyToProcess" virtual field for Order model

- Optimize code and remove debug logs
  - Remove console.log statements across multiple files
  - Refactor and clean up unused code

- Update dependencies
  - Upgrade @apollo/client, @keystone-6/core, and @prisma/client
  - Add vaul dependency

- Improve security and data handling in API calls
2024-09-27 15:36:53 +01:00
Junaid 397d80f553 Update pagination UI 2024-09-10 13:06:15 +01:00
Junaid d8f243c932 Refactor order processing and UI improvements
- Update OrderDetailsComponent with new loading states and button rendering
- Modify ProcessOrdersDialog to improve order processing UI
- Enhance InitPage and SignInPage with updated styling
- Comment out order creation logic in shop API handler for debugging
2024-09-10 00:30:02 +01:00
Junaid 162f005112 Refactor order management and shop selection functionality
- Update SearchOrders component and UI layout in Shops.js
- Enhance product fetching logic in getProduct and createPurchase functions
- Improve shop selection handling in OrderDetailsDialog.js
- Refactor matchOrder.js with additional async functions and error handling
- Update getMatch.js with platform information and improved product search
- Implement custom hooks for delete and update operations in EditItemDrawer
- Enhance SortSelection component with new UI elements and reset functionality
- Update shopify adapter for better metafield and fulfillment order handling
- Remove deprecated files and clean up unused code
- Minor UI and styling adjustments across multiple components
2024-09-09 19:45:29 +01:00
Junaid 99686b13ab Update a lot of Order page 2024-08-19 17:28:29 +01:00
Junaid 195b790e6c Update a lot of code 2024-08-08 10:42:09 +01:00
Junaid 5ac05b0852 More progress towards V3 2024-06-26 03:26:00 -05:00
Junaid feb04f829f More changes 2024-06-09 08:52:06 -04:00
Junaid 2d8a4d56bf Remove unneeded pages and fields 2024-05-28 18:11:10 -04:00
Junaid 12d1f47564 Start upgrading to v3 2024-05-01 18:47:54 -04:00
Junaid 025580c71e Remove graphql2 API route 2023-12-13 10:27:57 -06:00
Junaid b03b11442b Add script to generate fieldViews 2023-12-13 09:38:43 -06:00
Junaid b651bc408e Update Tailwind theme 2023-12-07 04:04:14 -06:00
Junaid 3aee6f91b4 Replace .keystone/api with KeystoneContext 2023-09-02 13:48:49 +08:00
Junaid 0eee7fc049 Upgrade Keystone and Next 2023-09-02 13:23:27 +08:00