create-auto-app 0.1.0 → 0.1.2
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/index.js +189 -85
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/shopping-app/.context/auto-ia-scheme.json +175 -0
- package/templates/shopping-app/.context/design-system.md +118 -0
- package/templates/shopping-app/.context/figma-variables.json +14448 -0
- package/templates/shopping-app/.context/schema.graphql +46 -0
- package/templates/shopping-app/.context/schema.json +583 -0
- package/templates/shopping-app/.context/shadcn-filter.ts +31 -0
- package/templates/shopping-app/.env +8 -0
- package/templates/shopping-app/auto.config.ts +21 -0
- package/templates/shopping-app/client/auto-configure.ts +107 -0
- package/templates/shopping-app/client/codegen.ts +16 -0
- package/templates/shopping-app/client/components.json +20 -0
- package/templates/shopping-app/client/design-system-principles.md +19 -0
- package/templates/shopping-app/client/eslint.config.ts +57 -0
- package/templates/shopping-app/client/index.html +26 -0
- package/templates/shopping-app/client/package.json +100 -0
- package/templates/shopping-app/client/postcss.config.js +6 -0
- package/templates/shopping-app/client/public/favicon.ico +0 -0
- package/templates/shopping-app/client/schema.graphql +46 -0
- package/templates/shopping-app/client/src/App.css +42 -0
- package/templates/shopping-app/client/src/App.tsx +20 -0
- package/templates/shopping-app/client/src/apolloClient.ts +8 -0
- package/templates/shopping-app/client/src/components/atoms/accordion.tsx +51 -0
- package/templates/shopping-app/client/src/components/atoms/alert-dialog.tsx +111 -0
- package/templates/shopping-app/client/src/components/atoms/alert.tsx +49 -0
- package/templates/shopping-app/client/src/components/atoms/aspect-ratio.tsx +7 -0
- package/templates/shopping-app/client/src/components/atoms/avatar.tsx +32 -0
- package/templates/shopping-app/client/src/components/atoms/badge.tsx +36 -0
- package/templates/shopping-app/client/src/components/atoms/breadcrumb.tsx +92 -0
- package/templates/shopping-app/client/src/components/atoms/button.tsx +50 -0
- package/templates/shopping-app/client/src/components/atoms/calendar.tsx +156 -0
- package/templates/shopping-app/client/src/components/atoms/card.tsx +56 -0
- package/templates/shopping-app/client/src/components/atoms/carousel.tsx +214 -0
- package/templates/shopping-app/client/src/components/atoms/chart.tsx +290 -0
- package/templates/shopping-app/client/src/components/atoms/checkbox.tsx +27 -0
- package/templates/shopping-app/client/src/components/atoms/collapsible.tsx +15 -0
- package/templates/shopping-app/client/src/components/atoms/command.tsx +135 -0
- package/templates/shopping-app/client/src/components/atoms/context-menu.tsx +209 -0
- package/templates/shopping-app/client/src/components/atoms/dialog.tsx +123 -0
- package/templates/shopping-app/client/src/components/atoms/drawer.tsx +106 -0
- package/templates/shopping-app/client/src/components/atoms/dropdown-menu.tsx +217 -0
- package/templates/shopping-app/client/src/components/atoms/hover-card.tsx +36 -0
- package/templates/shopping-app/client/src/components/atoms/input-otp.tsx +66 -0
- package/templates/shopping-app/client/src/components/atoms/input.tsx +21 -0
- package/templates/shopping-app/client/src/components/atoms/label.tsx +19 -0
- package/templates/shopping-app/client/src/components/atoms/logo.tsx +33 -0
- package/templates/shopping-app/client/src/components/atoms/menubar.tsx +234 -0
- package/templates/shopping-app/client/src/components/atoms/navigation-menu.tsx +142 -0
- package/templates/shopping-app/client/src/components/atoms/pagination.tsx +100 -0
- package/templates/shopping-app/client/src/components/atoms/popover.tsx +40 -0
- package/templates/shopping-app/client/src/components/atoms/progress.tsx +22 -0
- package/templates/shopping-app/client/src/components/atoms/radio-group.tsx +31 -0
- package/templates/shopping-app/client/src/components/atoms/resizable.tsx +46 -0
- package/templates/shopping-app/client/src/components/atoms/scroll-area.tsx +46 -0
- package/templates/shopping-app/client/src/components/atoms/select.tsx +158 -0
- package/templates/shopping-app/client/src/components/atoms/separator.tsx +26 -0
- package/templates/shopping-app/client/src/components/atoms/sheet.tsx +101 -0
- package/templates/shopping-app/client/src/components/atoms/sidebar.tsx +675 -0
- package/templates/shopping-app/client/src/components/atoms/skeleton.tsx +7 -0
- package/templates/shopping-app/client/src/components/atoms/slider.tsx +54 -0
- package/templates/shopping-app/client/src/components/atoms/sonner.tsx +23 -0
- package/templates/shopping-app/client/src/components/atoms/switch.tsx +26 -0
- package/templates/shopping-app/client/src/components/atoms/table.tsx +73 -0
- package/templates/shopping-app/client/src/components/atoms/tabs.tsx +40 -0
- package/templates/shopping-app/client/src/components/atoms/textarea.tsx +18 -0
- package/templates/shopping-app/client/src/components/atoms/toggle-group.tsx +65 -0
- package/templates/shopping-app/client/src/components/atoms/toggle.tsx +39 -0
- package/templates/shopping-app/client/src/components/atoms/tooltip.tsx +48 -0
- package/templates/shopping-app/client/src/components/molecules/QuantitySelector.tsx +8 -0
- package/templates/shopping-app/client/src/components/molecules/ShoppingCriteriaForm.tsx +8 -0
- package/templates/shopping-app/client/src/components/molecules/SuggestedItemCard.tsx +10 -0
- package/templates/shopping-app/client/src/components/organisms/AssistantChatInterface.tsx +14 -0
- package/templates/shopping-app/client/src/components/organisms/PageHeader.tsx +6 -0
- package/templates/shopping-app/client/src/components/organisms/SuggestedItemsList.tsx +15 -0
- package/templates/shopping-app/client/src/gql/fragment-masking.ts +48 -0
- package/templates/shopping-app/client/src/gql/gql.ts +47 -0
- package/templates/shopping-app/client/src/gql/graphql.ts +106 -0
- package/templates/shopping-app/client/src/gql/index.ts +2 -0
- package/templates/shopping-app/client/src/graphql/mutations.ts +13 -0
- package/templates/shopping-app/client/src/graphql/queries.ts +14 -0
- package/templates/shopping-app/client/src/hooks/use-mobile.tsx +19 -0
- package/templates/shopping-app/client/src/hooks/use-toast.ts +186 -0
- package/templates/shopping-app/client/src/index.css +153 -0
- package/templates/shopping-app/client/src/lib/utils.ts +6 -0
- package/templates/shopping-app/client/src/main.tsx +5 -0
- package/templates/shopping-app/client/src/mockApolloClient.ts +93 -0
- package/templates/shopping-app/client/src/pages/AssistantChatPage.tsx +8 -0
- package/templates/shopping-app/client/src/pages/Index.tsx +10 -0
- package/templates/shopping-app/client/src/pages/NotFound.tsx +22 -0
- package/templates/shopping-app/client/src/pages/SuggestedItemsPage.tsx +8 -0
- package/templates/shopping-app/client/tailwind.config.ts +92 -0
- package/templates/shopping-app/client/tsconfig.json +49 -0
- package/templates/shopping-app/client/vite.config.ts +17 -0
- package/templates/shopping-app/flows/shopping-assistant.flow.ts +369 -0
- package/templates/shopping-app/package.json +25 -0
- package/templates/shopping-app/pnpm-workspace.yaml +2 -0
- package/templates/shopping-app/server/package.json +25 -0
- package/templates/shopping-app/server/scripts/generate-schema.ts +31 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/commands.ts +8 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/decide.specs.ts +46 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/decide.ts +36 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/events.ts +10 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/evolve.ts +28 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/handle.ts +31 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/mutation.resolver.ts +29 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/register.ts +10 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/accepts-items-and-adds-to-their-cart/state.ts +47 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/creates-a-chat-session-/react.specs.ts +63 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/creates-a-chat-session-/react.ts +49 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/creates-a-chat-session-/register.ts +31 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/commands.ts +8 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/decide.specs.ts +38 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/decide.ts +36 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/events.ts +10 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/evolve.ts +28 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/handle.ts +31 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/mutation.resolver.ts +30 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/register.ts +10 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/enters-shopping-criteria-into-assistant/state.ts +47 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/commands.ts +8 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/decide.specs.ts +61 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/decide.ts +45 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/events.ts +14 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/evolve.ts +28 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/handle.ts +59 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/mutation.resolver.ts +30 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/register.ts +10 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/selects-items-relevant-to-the-shopping-criteria-/state.ts +47 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/views-suggested-items/projection.specs.ts +94 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/views-suggested-items/projection.ts +40 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/views-suggested-items/query.resolver.ts +59 -0
- package/templates/shopping-app/server/src/domain/flows/seasonal-assistant/views-suggested-items/state.ts +9 -0
- package/templates/shopping-app/server/src/domain/shared/ReadModel.d.ts +10 -0
- package/templates/shopping-app/server/src/domain/shared/ReadModel.d.ts.map +1 -0
- package/templates/shopping-app/server/src/domain/shared/ReadModel.js +19 -0
- package/templates/shopping-app/server/src/domain/shared/ReadModel.js.map +1 -0
- package/templates/shopping-app/server/src/domain/shared/ReadModel.ts +26 -0
- package/templates/shopping-app/server/src/domain/shared/index.d.ts +5 -0
- package/templates/shopping-app/server/src/domain/shared/index.d.ts.map +1 -0
- package/templates/shopping-app/server/src/domain/shared/index.js +5 -0
- package/templates/shopping-app/server/src/domain/shared/index.js.map +1 -0
- package/templates/shopping-app/server/src/domain/shared/index.ts +4 -0
- package/templates/shopping-app/server/src/domain/shared/reactorSpecification.d.ts +35 -0
- package/templates/shopping-app/server/src/domain/shared/reactorSpecification.d.ts.map +1 -0
- package/templates/shopping-app/server/src/domain/shared/reactorSpecification.js +155 -0
- package/templates/shopping-app/server/src/domain/shared/reactorSpecification.js.map +1 -0
- package/templates/shopping-app/server/src/domain/shared/reactorSpecification.ts +257 -0
- package/templates/shopping-app/server/src/domain/shared/sendCommand.d.ts +4 -0
- package/templates/shopping-app/server/src/domain/shared/sendCommand.d.ts.map +1 -0
- package/templates/shopping-app/server/src/domain/shared/sendCommand.js +17 -0
- package/templates/shopping-app/server/src/domain/shared/sendCommand.js.map +1 -0
- package/templates/shopping-app/server/src/domain/shared/sendCommand.ts +21 -0
- package/templates/shopping-app/server/src/domain/shared/types.d.ts +19 -0
- package/templates/shopping-app/server/src/domain/shared/types.d.ts.map +1 -0
- package/templates/shopping-app/server/src/domain/shared/types.js +39 -0
- package/templates/shopping-app/server/src/domain/shared/types.js.map +1 -0
- package/templates/shopping-app/server/src/domain/shared/types.ts +31 -0
- package/templates/shopping-app/server/src/integrations/ai-integration.ts +76 -0
- package/templates/shopping-app/server/src/integrations/cart-integration.ts +178 -0
- package/templates/shopping-app/server/src/integrations/index.ts +3 -0
- package/templates/shopping-app/server/src/integrations/product-catalogue-integration.ts +363 -0
- package/templates/shopping-app/server/src/server.ts +43 -0
- package/templates/shopping-app/server/src/utils/index.d.ts +4 -0
- package/templates/shopping-app/server/src/utils/index.d.ts.map +1 -0
- package/templates/shopping-app/server/src/utils/index.js +4 -0
- package/templates/shopping-app/server/src/utils/index.js.map +1 -0
- package/templates/shopping-app/server/src/utils/index.ts +3 -0
- package/templates/shopping-app/server/src/utils/loadProjections.d.ts +3 -0
- package/templates/shopping-app/server/src/utils/loadProjections.d.ts.map +1 -0
- package/templates/shopping-app/server/src/utils/loadProjections.js +23 -0
- package/templates/shopping-app/server/src/utils/loadProjections.js.map +1 -0
- package/templates/shopping-app/server/src/utils/loadProjections.ts +30 -0
- package/templates/shopping-app/server/src/utils/loadRegisterFiles.d.ts +6 -0
- package/templates/shopping-app/server/src/utils/loadRegisterFiles.d.ts.map +1 -0
- package/templates/shopping-app/server/src/utils/loadRegisterFiles.js +28 -0
- package/templates/shopping-app/server/src/utils/loadRegisterFiles.js.map +1 -0
- package/templates/shopping-app/server/src/utils/loadRegisterFiles.ts +41 -0
- package/templates/shopping-app/server/src/utils/loadResolvers.d.ts +5 -0
- package/templates/shopping-app/server/src/utils/loadResolvers.d.ts.map +1 -0
- package/templates/shopping-app/server/src/utils/loadResolvers.js +27 -0
- package/templates/shopping-app/server/src/utils/loadResolvers.js.map +1 -0
- package/templates/shopping-app/server/src/utils/loadResolvers.ts +36 -0
- package/templates/shopping-app/server/tsconfig.json +19 -0
- package/templates/shopping-app/server/vitest.config.ts +7 -0
- package/templates/shopping-app/tsconfig.json +21 -0
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import { TypedDocumentNode as DocumentNode } from '@graphql-typed-document-node/core';
|
|
3
|
+
export type Maybe<T> = T | null;
|
|
4
|
+
export type InputMaybe<T> = Maybe<T>;
|
|
5
|
+
export type Exact<T extends { [key: string]: unknown }> = { [K in keyof T]: T[K] };
|
|
6
|
+
export type MakeOptional<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]?: Maybe<T[SubKey]> };
|
|
7
|
+
export type MakeMaybe<T, K extends keyof T> = Omit<T, K> & { [SubKey in K]: Maybe<T[SubKey]> };
|
|
8
|
+
/** All built-in and custom scalars, mapped to their actual values */
|
|
9
|
+
export type Scalars = {
|
|
10
|
+
ID: string;
|
|
11
|
+
String: string;
|
|
12
|
+
Boolean: boolean;
|
|
13
|
+
Int: number;
|
|
14
|
+
Float: number;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export type AddItemsToCartInput = {
|
|
18
|
+
items: Scalars['String'];
|
|
19
|
+
sessionId: Scalars['String'];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type EnterShoppingCriteriaInput = {
|
|
23
|
+
criteria: Scalars['String'];
|
|
24
|
+
sessionId: Scalars['String'];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type Mutation = {
|
|
28
|
+
__typename?: 'Mutation';
|
|
29
|
+
addItemsToCart: MutationResponse;
|
|
30
|
+
enterShoppingCriteria: MutationResponse;
|
|
31
|
+
suggestShoppingItems: MutationResponse;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
export type MutationAddItemsToCartArgs = {
|
|
36
|
+
input: AddItemsToCartInput;
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
export type MutationEnterShoppingCriteriaArgs = {
|
|
41
|
+
input: EnterShoppingCriteriaInput;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
export type MutationSuggestShoppingItemsArgs = {
|
|
46
|
+
input: SuggestShoppingItemsInput;
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export type MutationError = {
|
|
50
|
+
__typename?: 'MutationError';
|
|
51
|
+
message?: Maybe<Scalars['String']>;
|
|
52
|
+
type: Scalars['String'];
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
export type MutationResponse = {
|
|
56
|
+
__typename?: 'MutationResponse';
|
|
57
|
+
error?: Maybe<MutationError>;
|
|
58
|
+
success: Scalars['Boolean'];
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export type Query = {
|
|
62
|
+
__typename?: 'Query';
|
|
63
|
+
suggestedItems: Array<SuggestedItems>;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
|
|
67
|
+
export type QuerySuggestedItemsArgs = {
|
|
68
|
+
sessionId?: InputMaybe<Scalars['ID']>;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
export type SuggestShoppingItemsInput = {
|
|
72
|
+
prompt: Scalars['String'];
|
|
73
|
+
sessionId: Scalars['String'];
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
export type SuggestedItems = {
|
|
77
|
+
__typename?: 'SuggestedItems';
|
|
78
|
+
items: Array<SuggestedItemsItems>;
|
|
79
|
+
sessionId: Scalars['String'];
|
|
80
|
+
};
|
|
81
|
+
|
|
82
|
+
export type SuggestedItemsItems = {
|
|
83
|
+
__typename?: 'SuggestedItemsItems';
|
|
84
|
+
name: Scalars['String'];
|
|
85
|
+
productId: Scalars['String'];
|
|
86
|
+
quantity: Scalars['Float'];
|
|
87
|
+
reason: Scalars['String'];
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export type EnterShoppingCriteriaMutationVariables = Exact<{
|
|
91
|
+
input: EnterShoppingCriteriaInput;
|
|
92
|
+
}>;
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
export type EnterShoppingCriteriaMutation = { __typename?: 'Mutation', enterShoppingCriteria: { __typename?: 'MutationResponse', success: boolean, error?: { __typename?: 'MutationError', type: string, message?: string | null } | null } };
|
|
96
|
+
|
|
97
|
+
export type GetSuggestedItemsQueryVariables = Exact<{
|
|
98
|
+
sessionId: Scalars['ID'];
|
|
99
|
+
}>;
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
export type GetSuggestedItemsQuery = { __typename?: 'Query', suggestedItems: Array<{ __typename?: 'SuggestedItems', items: Array<{ __typename?: 'SuggestedItemsItems', productId: string, name: string, quantity: number, reason: string }> }> };
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
export const EnterShoppingCriteriaDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"mutation","name":{"kind":"Name","value":"EnterShoppingCriteria"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"input"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"EnterShoppingCriteriaInput"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"enterShoppingCriteria"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"input"},"value":{"kind":"Variable","name":{"kind":"Name","value":"input"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"success"}},{"kind":"Field","name":{"kind":"Name","value":"error"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"type"}},{"kind":"Field","name":{"kind":"Name","value":"message"}}]}}]}}]}}]} as unknown as DocumentNode<EnterShoppingCriteriaMutation, EnterShoppingCriteriaMutationVariables>;
|
|
106
|
+
export const GetSuggestedItemsDocument = {"kind":"Document","definitions":[{"kind":"OperationDefinition","operation":"query","name":{"kind":"Name","value":"GetSuggestedItems"},"variableDefinitions":[{"kind":"VariableDefinition","variable":{"kind":"Variable","name":{"kind":"Name","value":"sessionId"}},"type":{"kind":"NonNullType","type":{"kind":"NamedType","name":{"kind":"Name","value":"ID"}}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"suggestedItems"},"arguments":[{"kind":"Argument","name":{"kind":"Name","value":"sessionId"},"value":{"kind":"Variable","name":{"kind":"Name","value":"sessionId"}}}],"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"items"},"selectionSet":{"kind":"SelectionSet","selections":[{"kind":"Field","name":{"kind":"Name","value":"productId"}},{"kind":"Field","name":{"kind":"Name","value":"name"}},{"kind":"Field","name":{"kind":"Name","value":"quantity"}},{"kind":"Field","name":{"kind":"Name","value":"reason"}}]}}]}}]}}]} as unknown as DocumentNode<GetSuggestedItemsQuery, GetSuggestedItemsQueryVariables>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { graphql } from '../gql';
|
|
2
|
+
|
|
3
|
+
export const EnterShoppingCriteria = graphql(`
|
|
4
|
+
mutation EnterShoppingCriteria($input: EnterShoppingCriteriaInput!) {
|
|
5
|
+
enterShoppingCriteria(input: $input) {
|
|
6
|
+
success
|
|
7
|
+
error {
|
|
8
|
+
type
|
|
9
|
+
message
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
`);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
const MOBILE_BREAKPOINT = 768;
|
|
4
|
+
|
|
5
|
+
export function useIsMobile() {
|
|
6
|
+
const [isMobile, setIsMobile] = React.useState<boolean | undefined>(undefined);
|
|
7
|
+
|
|
8
|
+
React.useEffect(() => {
|
|
9
|
+
const mql = window.matchMedia(`(max-width: ${MOBILE_BREAKPOINT - 1}px)`);
|
|
10
|
+
const onChange = () => {
|
|
11
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
12
|
+
};
|
|
13
|
+
mql.addEventListener('change', onChange);
|
|
14
|
+
setIsMobile(window.innerWidth < MOBILE_BREAKPOINT);
|
|
15
|
+
return () => mql.removeEventListener('change', onChange);
|
|
16
|
+
}, []);
|
|
17
|
+
|
|
18
|
+
return !!isMobile;
|
|
19
|
+
}
|
|
@@ -0,0 +1,186 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
const TOAST_LIMIT = 1;
|
|
4
|
+
const TOAST_REMOVE_DELAY = 1000000;
|
|
5
|
+
|
|
6
|
+
type ToasterToast = any & {
|
|
7
|
+
id: string;
|
|
8
|
+
title?: React.ReactNode;
|
|
9
|
+
description?: React.ReactNode;
|
|
10
|
+
action?: any;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const actionTypes = {
|
|
14
|
+
ADD_TOAST: 'ADD_TOAST',
|
|
15
|
+
UPDATE_TOAST: 'UPDATE_TOAST',
|
|
16
|
+
DISMISS_TOAST: 'DISMISS_TOAST',
|
|
17
|
+
REMOVE_TOAST: 'REMOVE_TOAST',
|
|
18
|
+
} as const;
|
|
19
|
+
|
|
20
|
+
let count = 0;
|
|
21
|
+
|
|
22
|
+
function genId() {
|
|
23
|
+
count = (count + 1) % Number.MAX_SAFE_INTEGER;
|
|
24
|
+
return count.toString();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
type ActionType = typeof actionTypes;
|
|
28
|
+
|
|
29
|
+
type Action =
|
|
30
|
+
| {
|
|
31
|
+
type: ActionType['ADD_TOAST'];
|
|
32
|
+
toast: ToasterToast;
|
|
33
|
+
}
|
|
34
|
+
| {
|
|
35
|
+
type: ActionType['UPDATE_TOAST'];
|
|
36
|
+
toast: Partial<ToasterToast>;
|
|
37
|
+
}
|
|
38
|
+
| {
|
|
39
|
+
type: ActionType['DISMISS_TOAST'];
|
|
40
|
+
toastId?: ToasterToast['id'];
|
|
41
|
+
}
|
|
42
|
+
| {
|
|
43
|
+
type: ActionType['REMOVE_TOAST'];
|
|
44
|
+
toastId?: ToasterToast['id'];
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
interface State {
|
|
48
|
+
toasts: ToasterToast[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const toastTimeouts = new Map<string, ReturnType<typeof setTimeout>>();
|
|
52
|
+
|
|
53
|
+
const addToRemoveQueue = (toastId: string) => {
|
|
54
|
+
if (toastTimeouts.has(toastId)) {
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
const timeout = setTimeout(() => {
|
|
59
|
+
toastTimeouts.delete(toastId);
|
|
60
|
+
dispatch({
|
|
61
|
+
type: 'REMOVE_TOAST',
|
|
62
|
+
toastId: toastId,
|
|
63
|
+
});
|
|
64
|
+
}, TOAST_REMOVE_DELAY);
|
|
65
|
+
|
|
66
|
+
toastTimeouts.set(toastId, timeout);
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const reducer = (state: State, action: Action): State => {
|
|
70
|
+
switch (action.type) {
|
|
71
|
+
case 'ADD_TOAST':
|
|
72
|
+
return {
|
|
73
|
+
...state,
|
|
74
|
+
toasts: [action.toast, ...state.toasts].slice(0, TOAST_LIMIT),
|
|
75
|
+
};
|
|
76
|
+
|
|
77
|
+
case 'UPDATE_TOAST':
|
|
78
|
+
return {
|
|
79
|
+
...state,
|
|
80
|
+
toasts: state.toasts.map((t) => (t.id === action.toast.id ? { ...t, ...action.toast } : t)),
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
case 'DISMISS_TOAST': {
|
|
84
|
+
const { toastId } = action;
|
|
85
|
+
|
|
86
|
+
// ! Side effects ! - This could be extracted into a dismissToast() action,
|
|
87
|
+
// but I'll keep it here for simplicity
|
|
88
|
+
if (toastId) {
|
|
89
|
+
addToRemoveQueue(toastId);
|
|
90
|
+
} else {
|
|
91
|
+
state.toasts.forEach((toast) => {
|
|
92
|
+
addToRemoveQueue(toast.id);
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return {
|
|
97
|
+
...state,
|
|
98
|
+
toasts: state.toasts.map((t) =>
|
|
99
|
+
t.id === toastId || toastId === undefined
|
|
100
|
+
? {
|
|
101
|
+
...t,
|
|
102
|
+
open: false,
|
|
103
|
+
}
|
|
104
|
+
: t,
|
|
105
|
+
),
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
case 'REMOVE_TOAST':
|
|
109
|
+
if (action.toastId === undefined) {
|
|
110
|
+
return {
|
|
111
|
+
...state,
|
|
112
|
+
toasts: [],
|
|
113
|
+
};
|
|
114
|
+
}
|
|
115
|
+
return {
|
|
116
|
+
...state,
|
|
117
|
+
toasts: state.toasts.filter((t) => t.id !== action.toastId),
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
const listeners: Array<(state: State) => void> = [];
|
|
123
|
+
|
|
124
|
+
let memoryState: State = { toasts: [] };
|
|
125
|
+
|
|
126
|
+
function dispatch(action: Action) {
|
|
127
|
+
memoryState = reducer(memoryState, action);
|
|
128
|
+
listeners.forEach((listener) => {
|
|
129
|
+
listener(memoryState);
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
type Toast = Omit<ToasterToast, 'id'>;
|
|
134
|
+
|
|
135
|
+
function toast({ ...props }: Toast) {
|
|
136
|
+
const id = genId();
|
|
137
|
+
|
|
138
|
+
const update = (props: ToasterToast) =>
|
|
139
|
+
dispatch({
|
|
140
|
+
type: 'UPDATE_TOAST',
|
|
141
|
+
toast: { ...props, id },
|
|
142
|
+
});
|
|
143
|
+
const dismiss = () => dispatch({ type: 'DISMISS_TOAST', toastId: id });
|
|
144
|
+
|
|
145
|
+
dispatch({
|
|
146
|
+
type: 'ADD_TOAST',
|
|
147
|
+
toast: {
|
|
148
|
+
...props,
|
|
149
|
+
id,
|
|
150
|
+
open: true,
|
|
151
|
+
onOpenChange: (open) => {
|
|
152
|
+
if (!open) dismiss();
|
|
153
|
+
},
|
|
154
|
+
},
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
return {
|
|
158
|
+
id: id,
|
|
159
|
+
dismiss,
|
|
160
|
+
update,
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
function useToast() {
|
|
165
|
+
const [state, setState] = React.useState<State>(memoryState);
|
|
166
|
+
|
|
167
|
+
React.useEffect(() => {
|
|
168
|
+
listeners.push(setState);
|
|
169
|
+
return () => {
|
|
170
|
+
const index = listeners.indexOf(setState);
|
|
171
|
+
if (index > -1) {
|
|
172
|
+
listeners.splice(index, 1);
|
|
173
|
+
}
|
|
174
|
+
};
|
|
175
|
+
}, [state]);
|
|
176
|
+
|
|
177
|
+
return {
|
|
178
|
+
...state,
|
|
179
|
+
toast,
|
|
180
|
+
dismiss: (toastId?: string) => {
|
|
181
|
+
if (toastId) dispatch({ type: 'DISMISS_TOAST', toastId });
|
|
182
|
+
},
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
export { useToast, toast };
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
@tailwind base;
|
|
2
|
+
@tailwind components;
|
|
3
|
+
@tailwind utilities;
|
|
4
|
+
|
|
5
|
+
@layer base {
|
|
6
|
+
:root {
|
|
7
|
+
|
|
8
|
+
--radius: 0.5rem;
|
|
9
|
+
|
|
10
|
+
--background: 0 0% 100%;
|
|
11
|
+
|
|
12
|
+
--foreground: 240 6% 10%;
|
|
13
|
+
|
|
14
|
+
--card: 0 0% 100%;
|
|
15
|
+
|
|
16
|
+
--card-foreground: 240 10% 4%;
|
|
17
|
+
|
|
18
|
+
--popover: 0 0% 100%;
|
|
19
|
+
|
|
20
|
+
--popover-foreground: 240 10% 4%;
|
|
21
|
+
|
|
22
|
+
--primary: 216 100% 43%;
|
|
23
|
+
|
|
24
|
+
--primary-foreground: 208 57% 91%;
|
|
25
|
+
|
|
26
|
+
--secondary: 240 5% 96%;
|
|
27
|
+
|
|
28
|
+
--secondary-foreground: 240 6% 10%;
|
|
29
|
+
|
|
30
|
+
--muted: 240 5% 96%;
|
|
31
|
+
|
|
32
|
+
--muted-foreground: 240 4% 46%;
|
|
33
|
+
|
|
34
|
+
--accent: 240 5% 96%;
|
|
35
|
+
|
|
36
|
+
--accent-foreground: 0 0% 98%;
|
|
37
|
+
|
|
38
|
+
--destructive: 0 72% 51%;
|
|
39
|
+
|
|
40
|
+
--destructive-foreground: 0 86% 97%;
|
|
41
|
+
|
|
42
|
+
--border: 240 6% 90%;
|
|
43
|
+
|
|
44
|
+
--input: 240 6% 90%;
|
|
45
|
+
|
|
46
|
+
--ring: 240 6% 10%;
|
|
47
|
+
|
|
48
|
+
--chart-1: 0 0% 70%;
|
|
49
|
+
|
|
50
|
+
--chart-2: 0 0% 70%;
|
|
51
|
+
|
|
52
|
+
--chart-3: 0 0% 70%;
|
|
53
|
+
|
|
54
|
+
--chart-4: 0 0% 70%;
|
|
55
|
+
|
|
56
|
+
--chart-5: 0 0% 70%;
|
|
57
|
+
|
|
58
|
+
--sidebar: 0 0% 100%;
|
|
59
|
+
|
|
60
|
+
--sidebar-foreground: 240 4% 16%;
|
|
61
|
+
|
|
62
|
+
--sidebar-primary: 216 100% 43%;
|
|
63
|
+
|
|
64
|
+
--sidebar-primary-foreground: 208 57% 91%;
|
|
65
|
+
|
|
66
|
+
--sidebar-accent: 240 5% 96%;
|
|
67
|
+
|
|
68
|
+
--sidebar-accent-foreground: 0 0% 98%;
|
|
69
|
+
|
|
70
|
+
--sidebar-border: 240 6% 90%;
|
|
71
|
+
|
|
72
|
+
--sidebar-ring: 240 6% 10%;
|
|
73
|
+
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.dark {
|
|
77
|
+
|
|
78
|
+
--background: 240 6% 10%;
|
|
79
|
+
|
|
80
|
+
--foreground: 0 0% 98%;
|
|
81
|
+
|
|
82
|
+
--card: 240 10% 4%;
|
|
83
|
+
|
|
84
|
+
--card-foreground: 0 0% 98%;
|
|
85
|
+
|
|
86
|
+
--popover: 240 5% 26%;
|
|
87
|
+
|
|
88
|
+
--popover-foreground: 0 0% 98%;
|
|
89
|
+
|
|
90
|
+
--primary: 217 100% 68%;
|
|
91
|
+
|
|
92
|
+
--primary-foreground: 226 76% 27%;
|
|
93
|
+
|
|
94
|
+
--secondary: 240 5% 34%;
|
|
95
|
+
|
|
96
|
+
--secondary-foreground: 0 0% 98%;
|
|
97
|
+
|
|
98
|
+
--muted: 240 5% 34%;
|
|
99
|
+
|
|
100
|
+
--muted-foreground: 240 4% 46%;
|
|
101
|
+
|
|
102
|
+
--accent: 240 10% 4%;
|
|
103
|
+
|
|
104
|
+
--accent-foreground: 0 0% 98%;
|
|
105
|
+
|
|
106
|
+
--destructive: 0 91% 71%;
|
|
107
|
+
|
|
108
|
+
--destructive-foreground: 0 93% 94%;
|
|
109
|
+
|
|
110
|
+
--border: 240 5% 34%;
|
|
111
|
+
|
|
112
|
+
--input: 240 4% 46%;
|
|
113
|
+
|
|
114
|
+
--ring: 240 5% 84%;
|
|
115
|
+
|
|
116
|
+
--chart-1: 0 0% 70%;
|
|
117
|
+
|
|
118
|
+
--chart-2: 0 0% 70%;
|
|
119
|
+
|
|
120
|
+
--chart-3: 0 0% 70%;
|
|
121
|
+
|
|
122
|
+
--chart-4: 0 0% 70%;
|
|
123
|
+
|
|
124
|
+
--chart-5: 0 0% 70%;
|
|
125
|
+
|
|
126
|
+
--sidebar: 240 6% 10%;
|
|
127
|
+
|
|
128
|
+
--sidebar-foreground: 240 4% 16%;
|
|
129
|
+
|
|
130
|
+
--sidebar-primary: 217 100% 68%;
|
|
131
|
+
|
|
132
|
+
--sidebar-primary-foreground: 226 76% 27%;
|
|
133
|
+
|
|
134
|
+
--sidebar-accent: 240 10% 4%;
|
|
135
|
+
|
|
136
|
+
--sidebar-accent-foreground: 0 0% 98%;
|
|
137
|
+
|
|
138
|
+
--sidebar-border: 240 5% 34%;
|
|
139
|
+
|
|
140
|
+
--sidebar-ring: 240 5% 84%;
|
|
141
|
+
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
@layer base {
|
|
146
|
+
* {
|
|
147
|
+
@apply border-border;
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
body {
|
|
151
|
+
@apply bg-background text-foreground;
|
|
152
|
+
}
|
|
153
|
+
}
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
// import { ApolloClient, InMemoryCache, HttpLink } from "@apollo/client";
|
|
2
|
+
// import { MockedProvider } from "@apollo/client/testing";
|
|
3
|
+
// import { gql } from "@apollo/client";
|
|
4
|
+
|
|
5
|
+
// export const mocks = [
|
|
6
|
+
// {
|
|
7
|
+
// request: {
|
|
8
|
+
// query: gql`
|
|
9
|
+
// query GetTodo($id: ID!) {
|
|
10
|
+
// getTodo(id: $id) {
|
|
11
|
+
// id
|
|
12
|
+
// title
|
|
13
|
+
// description
|
|
14
|
+
// completed
|
|
15
|
+
// createdAt
|
|
16
|
+
// }
|
|
17
|
+
// }
|
|
18
|
+
// `,
|
|
19
|
+
// variables: { id: "1" },
|
|
20
|
+
// },
|
|
21
|
+
// result: {
|
|
22
|
+
// data: {
|
|
23
|
+
// getTodo: {
|
|
24
|
+
// id: "1",
|
|
25
|
+
// title: "Sample Todo",
|
|
26
|
+
// description: "This is a mock todo",
|
|
27
|
+
// completed: false,
|
|
28
|
+
// createdAt: "2025-06-16T15:22:00Z",
|
|
29
|
+
// },
|
|
30
|
+
// },
|
|
31
|
+
// },
|
|
32
|
+
// },
|
|
33
|
+
// {
|
|
34
|
+
// request: {
|
|
35
|
+
// query: gql`
|
|
36
|
+
// query GetAllTodos {
|
|
37
|
+
// getAllTodos {
|
|
38
|
+
// id
|
|
39
|
+
// title
|
|
40
|
+
// completed
|
|
41
|
+
// }
|
|
42
|
+
// }
|
|
43
|
+
// `,
|
|
44
|
+
// },
|
|
45
|
+
// result: {
|
|
46
|
+
// data: {
|
|
47
|
+
// getAllTodos: [
|
|
48
|
+
// { id: "1", title: "Todo 1", completed: false },
|
|
49
|
+
// { id: "2", title: "Todo 2", completed: true },
|
|
50
|
+
// ],
|
|
51
|
+
// },
|
|
52
|
+
// },
|
|
53
|
+
// },
|
|
54
|
+
// {
|
|
55
|
+
// request: {
|
|
56
|
+
// query: gql`
|
|
57
|
+
// mutation CreateTodo(
|
|
58
|
+
// $title: String!
|
|
59
|
+
// $description: String
|
|
60
|
+
// $userId: ID!
|
|
61
|
+
// ) {
|
|
62
|
+
// createTodo(
|
|
63
|
+
// title: $title
|
|
64
|
+
// description: $description
|
|
65
|
+
// userId: $userId
|
|
66
|
+
// ) {
|
|
67
|
+
// id
|
|
68
|
+
// title
|
|
69
|
+
// description
|
|
70
|
+
// completed
|
|
71
|
+
// createdAt
|
|
72
|
+
// }
|
|
73
|
+
// }
|
|
74
|
+
// `,
|
|
75
|
+
// variables: { title: "New Todo", description: null, userId: "1" },
|
|
76
|
+
// },
|
|
77
|
+
// result: {
|
|
78
|
+
// data: {
|
|
79
|
+
// createTodo: {
|
|
80
|
+
// id: "3",
|
|
81
|
+
// title: "New Todo",
|
|
82
|
+
// description: null,
|
|
83
|
+
// completed: false,
|
|
84
|
+
// createdAt: "2025-06-16T15:22:00Z",
|
|
85
|
+
// },
|
|
86
|
+
// },
|
|
87
|
+
// },
|
|
88
|
+
// },
|
|
89
|
+
// ];
|
|
90
|
+
|
|
91
|
+
// export const mockApolloClient = new ApolloClient({
|
|
92
|
+
// cache: new InMemoryCache(),
|
|
93
|
+
// });
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PageHeader } from "@/components/organisms/PageHeader";
|
|
2
|
+
import { AssistantChatInterface } from "@/components/organisms/AssistantChatInterface";
|
|
3
|
+
|
|
4
|
+
// Main page where users enter shopping criteria
|
|
5
|
+
|
|
6
|
+
export function AssistantChatPage() {
|
|
7
|
+
return <div />;
|
|
8
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export const Index = () => {
|
|
2
|
+
return (
|
|
3
|
+
<div className="min-h-screen flex items-center justify-center bg-background">
|
|
4
|
+
<div className="text-center">
|
|
5
|
+
<h1 className="text-4xl font-bold mb-4">Welcome to Your Blank App</h1>
|
|
6
|
+
<p className="text-xl text-muted-foreground">Start building your amazing project here!</p>
|
|
7
|
+
</div>
|
|
8
|
+
</div>
|
|
9
|
+
);
|
|
10
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { useLocation } from 'react-router-dom';
|
|
2
|
+
import { useEffect } from 'react';
|
|
3
|
+
|
|
4
|
+
export const NotFound = () => {
|
|
5
|
+
const location = useLocation();
|
|
6
|
+
|
|
7
|
+
useEffect(() => {
|
|
8
|
+
console.error('404 Error: User attempted to access non-existent route:', location.pathname);
|
|
9
|
+
}, [location.pathname]);
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<div className="min-h-screen flex items-center justify-center bg-gray-100">
|
|
13
|
+
<div className="text-center">
|
|
14
|
+
<h1 className="text-4xl font-bold mb-4">404</h1>
|
|
15
|
+
<p className="text-xl text-gray-600 mb-4">Oops! Page not found</p>
|
|
16
|
+
<a href="/" className="text-blue-500 hover:text-blue-700 underline">
|
|
17
|
+
Return to Home
|
|
18
|
+
</a>
|
|
19
|
+
</div>
|
|
20
|
+
</div>
|
|
21
|
+
);
|
|
22
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { PageHeader } from "@/components/organisms/PageHeader";
|
|
2
|
+
import { SuggestedItemsList } from "@/components/organisms/SuggestedItemsList";
|
|
3
|
+
|
|
4
|
+
// Page displaying AI-suggested items for the shopping criteria
|
|
5
|
+
|
|
6
|
+
export function SuggestedItemsPage() {
|
|
7
|
+
return <div />;
|
|
8
|
+
}
|