From f81250a7c10e26765627592356fb8493e4c21508 Mon Sep 17 00:00:00 2001 From: robin Date: Thu, 2 Oct 2025 08:18:37 +0000 Subject: [PATCH] strip v1 --- .drone.yml.bak | 151 ---- .env | 10 +- README.md | 126 --- ai.md | 1 - api/collections/Challenge.yml | 253 ------ api/collections/OrderReturnRequest.yml | 360 -------- api/collections/OrderRevokeRequest.yml | 183 ---- api/collections/QRCode.yml | 68 -- api/collections/bigCommerceCustomer.yml | 278 ------- api/collections/bigCommerceOrder.yml | 281 ------- api/collections/bigCommerceProduct.yml | 273 ------ api/collections/dummyCartEndpoint.yml | 38 - .../fieldLists/completeYourLook.yml | 74 -- .../fieldLists/formular/checkboxGroup.yml | 33 - .../fieldLists/formular/dateInput.yml | 17 - .../fieldLists/formular/datePicker.yml | 46 - api/collections/fieldLists/formular/form.yml | 192 ----- .../fieldLists/formular/labelNumberInput.yml | 79 -- .../fieldLists/formular/multiSelectInput.yml | 50 -- .../fieldLists/formular/numberInput.yml | 14 - .../formular/standardInputProperties.yml | 71 -- .../fieldLists/formular/standardSelect.yml | 58 -- .../fieldLists/formular/textInputs.yml | 52 -- .../fieldLists/formular/timeSelect.yml | 45 - .../fieldLists/formular/timesInput.yml | 60 -- api/collections/fieldLists/orderViews.yml | 12 - api/collections/helpcenterChapter.yml | 143 ---- api/collections/login.yml | 61 -- api/collections/lookCombination.yml | 24 - api/collections/productBackgroundImage.yml | 75 -- api/collections/productBenefit.yml | 54 -- api/collections/rating.yml | 301 ------- api/collections/selfImprovementChapter.yml | 196 ----- api/collections/shopStatus.yml | 74 -- api/collections/sizingDetails.yml | 24 - api/collections/webhook.yml | 92 -- api/collections/wishlistEntry.yml | 36 - api/config.yml | 21 +- api/hooks/cart/get_read.js | 46 - api/hooks/cart/helper.js | 53 -- api/hooks/cart/post_validate.js | 25 - api/hooks/customer/get_read.js | 55 -- api/hooks/customer/post_create.js | 0 api/hooks/customer/put_update.js | 250 ------ api/hooks/order/get_read.js | 56 -- api/hooks/order/put_update.js | 5 - api/hooks/orderReturnRequest/delete_delete.js | 47 -- api/hooks/orderReturnRequest/delete_return.js | 33 - api/hooks/orderReturnRequest/get_read.js | 41 - api/hooks/orderReturnRequest/post_create.js | 81 -- api/hooks/orderReturnRequest/post_return.js | 30 - api/hooks/orderReturnRequest/put_update.js | 51 -- api/hooks/orderRevokeRequest/get_read.js | 35 - api/hooks/orderRevokeRequest/post_create.js | 45 - api/hooks/orderRevokeRequest/post_return.js | 36 - api/hooks/orderRevokeRequest/put_update.js | 43 - api/hooks/product/get_read.js | 23 - api/hooks/product/get_return.js | 12 - api/hooks/product/helper.js | 26 - api/hooks/product/post_create.js | 36 - api/hooks/product/put_update.js | 13 - api/hooks/rating/delete_delete.js | 15 - api/hooks/rating/delete_return.js | 7 - api/hooks/rating/get_read.js | 46 - api/hooks/rating/post_create.js | 17 - api/hooks/rating/post_return.js | 41 - api/hooks/rating/post_validate.js | 5 - api/hooks/rating/put_return.js | 42 - api/hooks/rating/put_update.js | 16 - api/hooks/rating/put_validate.js | 5 - chatgptpromps.md | 1 - docker-compose-playwright.yml | 71 -- frontend/src/App.svelte | 127 +-- frontend/src/api.ts | 14 - frontend/src/lib/components/Review.svelte | 0 .../src/lib/components/krasskraft/Blog.svelte | 122 --- .../krasskraft/ChallengeDetailed.svelte | 133 --- .../krasskraft/ChallengePreview.svelte | 70 -- .../krasskraft/ChallengePreviewList.svelte | 67 -- .../krasskraft/ChallengesOverview.svelte | 0 .../krasskraft/KrassKraftHomepage.svelte | 99 --- .../ChapterPreview/ChapterPreview.svelte | 105 --- .../blocks/ChapterPreview/Item.svelte | 350 -------- .../blocks/RatingPreview/PreviewCard.svelte | 261 ------ .../pagebuilder/cart/CartProducts.svelte | 70 -- .../pagebuilder/cart/OverlayCart.svelte | 200 ----- .../cart/OverlayCartRecommendations.svelte | 86 -- .../favorite/FavoriteListItems.svelte | 60 -- .../favorite/OverlayFavoriteList.svelte | 44 - .../pagebuilder/helpCenter/Chapter.svelte | 134 --- .../helpCenter/ChapterDetailed.svelte | 182 ---- .../helpCenter/ChapterQuestionDetailed.svelte | 51 -- .../helpCenter/ChapterQuestionPreview.svelte | 47 -- .../pagebuilder/product/ActionRow.svelte | 89 -- .../pagebuilder/product/AddToCart.svelte | 37 - .../product/CompleteTheLook.svelte | 3 - .../pagebuilder/product/DynamicRows.svelte | 31 - .../pagebuilder/product/Filter.svelte | 71 -- .../pagebuilder/product/Informations.svelte | 0 .../product/MagnifyableProductImage.svelte | 141 ---- .../pagebuilder/product/Options.svelte | 0 .../product/ProductBenefitsSlider.svelte | 92 -- .../product/ProductColorPreviewList.svelte | 101 --- .../product/ProductConfigurator.svelte | 165 ---- .../product/ProductExtendableBoxes.svelte | 202 ----- .../product/ProductImagePreview.svelte | 99 --- .../product/ProductInCartPreview.svelte | 155 ---- .../pagebuilder/product/ProductItems.svelte | 0 .../product/ProductListPreviewWidget.svelte | 142 ---- .../product/ProductPageDesktop.svelte | 135 --- .../product/ProductPageMobile.svelte | 106 --- .../pagebuilder/product/ProductPreview.svelte | 326 -------- .../product/ProductPreviewList.svelte | 67 -- .../product/ProductSizesPreviewList.svelte | 183 ---- .../pagebuilder/product/ProductSummary.svelte | 104 --- .../pagebuilder/product/RatingOverview.svelte | 0 .../product/RecommendedProducts.svelte | 43 - .../pagebuilder/product/ToggleFavorite.svelte | 77 -- .../product/widgets/FilterBlock.svelte | 123 --- .../product/widgets/ProductBenefits.svelte | 131 --- .../product/widgets/ProductPricetags.svelte | 35 - .../product/widgets/ProductQuantity.svelte | 56 -- .../product/widgets/ProductRatings.svelte | 254 ------ .../product/widgets/ShareButton.svelte | 3 - .../product/widgets/SizeChart.svelte | 90 -- .../pagebuilder/profile/Account.svelte | 82 -- .../pagebuilder/profile/AddressForm.svelte | 93 --- .../pagebuilder/profile/CardWrapper.svelte | 137 --- .../pagebuilder/profile/Login.svelte | 107 --- .../pagebuilder/profile/Orders.svelte | 184 ---- .../pagebuilder/profile/PasswordReset.svelte | 95 --- .../profile/PasswordResetRequest.svelte | 113 --- .../pagebuilder/profile/Profile.svelte | 95 --- .../pagebuilder/profile/Register.svelte | 280 ------- .../profile/account/Address.svelte | 94 --- .../profile/account/Addresses.svelte | 213 ----- .../profile/account/IndentifyingData.svelte | 384 --------- .../profile/account/PersonalData.svelte | 225 ----- .../components/pagebuilder/profile/helper.ts | 191 ----- .../profile/order/OrderDetailedView.svelte | 229 ----- .../pagebuilder/profile/order/helper.ts | 145 ---- .../profile/order/list/OrderCard.svelte | 97 --- .../profile/order/list/OrderTableRow.svelte | 94 --- .../order/overview/OrderDetails.svelte | 54 -- .../order/overview/OrderOverview.svelte | 162 ---- .../order/overview/OriginalCartPreview.svelte | 84 -- .../order/overview/ShippingOverview.svelte | 139 ---- .../order/overview/StateLogPreview.svelte | 181 ---- .../profile/order/rating/OrderRating.svelte | 101 --- .../profile/order/rating/ProductRating.svelte | 222 ----- .../order/return/OrderReturnView.svelte | 208 ----- .../order/return/ReturnOverview.svelte | 330 -------- .../order/return/ReturnProductLine.svelte | 218 ----- .../order/widgets/OrderCancelledBanner.svelte | 61 -- .../order/widgets/OrderProblemBanner.svelte | 55 -- .../order/widgets/ProductImages.svelte | 119 --- .../profile/order/widgets/orderStatus.svelte | 68 -- .../profile/profile/EditableRecords.svelte | 263 ------ .../profile/profile/RecordEditMask.svelte | 325 -------- .../profile/profile/Records.svelte | 121 --- .../profile/profile/SocialMediaRow.svelte | 315 ------- .../profile/profile/VideoPreview.svelte | 265 ------ .../lib/components/widgets/Pricetag.svelte | 77 -- .../imageUpload/ImageFieldLibrary.svelte | 135 --- .../inputs/imageUpload/ImagePreviewRow.svelte | 114 --- .../inputs/imageUpload/ImageUpload.svelte | 299 ------- .../inputs/imageUpload/ImagesRow.svelte | 154 ---- .../imageUpload/UploadImageWidget.svelte | 47 -- .../widgets/inputs/imageUpload/helper.ts | 41 - .../inputs/imageUpload/imagePreview.svelte | 21 - .../CommerceAPIs/bigCommerce/cart.ts | 139 ---- .../CommerceAPIs/bigCommerce/categories.ts | 50 -- .../CommerceAPIs/bigCommerce/customer.ts | 24 - .../CommerceAPIs/bigCommerce/errors.ts | 14 - .../bigCommerce/fragments/cart.ts | 187 ----- .../bigCommerce/fragments/categories.ts | 8 - .../bigCommerce/fragments/customer.ts | 23 - .../bigCommerce/fragments/product.ts | 207 ----- .../CommerceAPIs/bigCommerce/index.ts | 89 -- .../CommerceAPIs/bigCommerce/mapper.ts | 306 ------- .../bigCommerce/mutations/cart.ts | 26 - .../bigCommerce/mutations/customer.ts | 153 ---- .../bigCommerce/mutations/wishlist.ts | 94 --- .../CommerceAPIs/bigCommerce/product.ts | 124 --- .../CommerceAPIs/bigCommerce/queries/cart.ts | 53 -- .../bigCommerce/queries/category.ts | 39 - .../bigCommerce/queries/checkout.ts | 20 - .../bigCommerce/queries/customer.ts | 32 - .../CommerceAPIs/bigCommerce/queries/menu.ts | 21 - .../bigCommerce/queries/product.ts | 141 ---- .../bigCommerce/queries/wishlist.ts | 25 - .../CommerceAPIs/bigCommerce/wishlist.ts | 93 --- .../CommerceAPIs/tibiEndpoints/actions.ts | 80 -- .../CommerceAPIs/tibiEndpoints/customer.ts | 415 --------- .../CommerceAPIs/tibiEndpoints/helpCenter.ts | 30 - .../CommerceAPIs/tibiEndpoints/orders.ts | 68 -- .../CommerceAPIs/tibiEndpoints/product.ts | 12 - .../CommerceAPIs/tibiEndpoints/rating.ts | 34 - .../CommerceAPIs/tibiEndpoints/store.ts | 8 - .../CommerceAPIs/tibiEndpoints/wishlist.ts | 43 - frontend/src/lib/functions/helper/SEO.ts | 3 - frontend/src/lib/functions/helper/product.ts | 192 ----- frontend/src/lib/functions/type-guards.ts | 27 - frontend/src/lib/functions/uploadProcess.ts | 0 frontend/src/lib/store.ts | 9 +- frontend/src/routes/Cart.svelte | 0 frontend/src/routes/HelpCenter.svelte | 89 -- frontend/src/routes/KrassKraftChapter.svelte | 27 - frontend/src/routes/Product.svelte | 75 -- frontend/src/routes/Products.svelte | 119 --- frontend/src/routes/Profile.svelte | 7 - frontend/src/routes/PublicProfile.svelte | 135 --- frontend/src/routes/RatingConfirm.svelte | 26 - .../src/routes/RedirectToPublicProfile.svelte | 14 - package.json | 112 ++- playwright.config.ts | 78 -- playwright/example.test.js | 7 - printfulguide.md | 9 - svelte.config.js | 2 - tests-examples/demo-todo-app.spec.ts | 437 ---------- tests/ui/example.spec.ts | 18 - types/bigCommerceRestAPITypes.d.ts | 620 -------------- types/bigCommerceTypes.d.ts | 786 ------------------ types/global.d.ts | 6 - types/tibiCommerceRelated.d.ts | 168 ---- 225 files changed, 76 insertions(+), 23002 deletions(-) delete mode 100644 .drone.yml.bak delete mode 100644 README.md delete mode 100644 ai.md delete mode 100644 api/collections/Challenge.yml delete mode 100644 api/collections/OrderReturnRequest.yml delete mode 100644 api/collections/OrderRevokeRequest.yml delete mode 100644 api/collections/QRCode.yml delete mode 100644 api/collections/bigCommerceCustomer.yml delete mode 100644 api/collections/bigCommerceOrder.yml delete mode 100644 api/collections/bigCommerceProduct.yml delete mode 100644 api/collections/dummyCartEndpoint.yml delete mode 100644 api/collections/fieldLists/completeYourLook.yml delete mode 100644 api/collections/fieldLists/formular/checkboxGroup.yml delete mode 100644 api/collections/fieldLists/formular/dateInput.yml delete mode 100644 api/collections/fieldLists/formular/datePicker.yml delete mode 100644 api/collections/fieldLists/formular/form.yml delete mode 100644 api/collections/fieldLists/formular/labelNumberInput.yml delete mode 100644 api/collections/fieldLists/formular/multiSelectInput.yml delete mode 100644 api/collections/fieldLists/formular/numberInput.yml delete mode 100644 api/collections/fieldLists/formular/standardInputProperties.yml delete mode 100644 api/collections/fieldLists/formular/standardSelect.yml delete mode 100644 api/collections/fieldLists/formular/textInputs.yml delete mode 100644 api/collections/fieldLists/formular/timeSelect.yml delete mode 100644 api/collections/fieldLists/formular/timesInput.yml delete mode 100644 api/collections/fieldLists/orderViews.yml delete mode 100644 api/collections/helpcenterChapter.yml delete mode 100644 api/collections/login.yml delete mode 100644 api/collections/lookCombination.yml delete mode 100644 api/collections/productBackgroundImage.yml delete mode 100644 api/collections/productBenefit.yml delete mode 100644 api/collections/rating.yml delete mode 100644 api/collections/selfImprovementChapter.yml delete mode 100644 api/collections/shopStatus.yml delete mode 100644 api/collections/sizingDetails.yml delete mode 100644 api/collections/webhook.yml delete mode 100644 api/collections/wishlistEntry.yml delete mode 100644 api/hooks/cart/get_read.js delete mode 100644 api/hooks/cart/helper.js delete mode 100644 api/hooks/cart/post_validate.js delete mode 100644 api/hooks/customer/get_read.js delete mode 100644 api/hooks/customer/post_create.js delete mode 100644 api/hooks/customer/put_update.js delete mode 100644 api/hooks/order/get_read.js delete mode 100644 api/hooks/order/put_update.js delete mode 100644 api/hooks/orderReturnRequest/delete_delete.js delete mode 100644 api/hooks/orderReturnRequest/delete_return.js delete mode 100644 api/hooks/orderReturnRequest/get_read.js delete mode 100644 api/hooks/orderReturnRequest/post_create.js delete mode 100644 api/hooks/orderReturnRequest/post_return.js delete mode 100644 api/hooks/orderReturnRequest/put_update.js delete mode 100644 api/hooks/orderRevokeRequest/get_read.js delete mode 100644 api/hooks/orderRevokeRequest/post_create.js delete mode 100644 api/hooks/orderRevokeRequest/post_return.js delete mode 100644 api/hooks/orderRevokeRequest/put_update.js delete mode 100644 api/hooks/product/get_read.js delete mode 100644 api/hooks/product/get_return.js delete mode 100644 api/hooks/product/helper.js delete mode 100644 api/hooks/product/post_create.js delete mode 100644 api/hooks/product/put_update.js delete mode 100644 api/hooks/rating/delete_delete.js delete mode 100644 api/hooks/rating/delete_return.js delete mode 100644 api/hooks/rating/get_read.js delete mode 100644 api/hooks/rating/post_create.js delete mode 100644 api/hooks/rating/post_return.js delete mode 100644 api/hooks/rating/post_validate.js delete mode 100644 api/hooks/rating/put_return.js delete mode 100644 api/hooks/rating/put_update.js delete mode 100644 api/hooks/rating/put_validate.js delete mode 100644 chatgptpromps.md delete mode 100644 docker-compose-playwright.yml delete mode 100644 frontend/src/lib/components/Review.svelte delete mode 100644 frontend/src/lib/components/krasskraft/Blog.svelte delete mode 100644 frontend/src/lib/components/krasskraft/ChallengeDetailed.svelte delete mode 100644 frontend/src/lib/components/krasskraft/ChallengePreview.svelte delete mode 100644 frontend/src/lib/components/krasskraft/ChallengePreviewList.svelte delete mode 100644 frontend/src/lib/components/krasskraft/ChallengesOverview.svelte delete mode 100644 frontend/src/lib/components/krasskraft/KrassKraftHomepage.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/blocks/ChapterPreview/ChapterPreview.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/blocks/ChapterPreview/Item.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/blocks/RatingPreview/PreviewCard.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/cart/CartProducts.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/cart/OverlayCart.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/cart/OverlayCartRecommendations.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/favorite/FavoriteListItems.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/favorite/OverlayFavoriteList.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/helpCenter/Chapter.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/helpCenter/ChapterDetailed.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/helpCenter/ChapterQuestionDetailed.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/helpCenter/ChapterQuestionPreview.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ActionRow.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/AddToCart.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/CompleteTheLook.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/DynamicRows.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/Filter.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/Informations.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/MagnifyableProductImage.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/Options.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ProductBenefitsSlider.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ProductColorPreviewList.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ProductConfigurator.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ProductExtendableBoxes.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ProductImagePreview.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ProductInCartPreview.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ProductItems.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ProductListPreviewWidget.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ProductPageDesktop.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ProductPageMobile.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ProductPreview.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ProductPreviewList.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ProductSizesPreviewList.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ProductSummary.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/RatingOverview.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/RecommendedProducts.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/ToggleFavorite.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/widgets/FilterBlock.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/widgets/ProductBenefits.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/widgets/ProductPricetags.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/widgets/ProductQuantity.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/widgets/ProductRatings.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/widgets/ShareButton.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/product/widgets/SizeChart.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/Account.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/AddressForm.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/CardWrapper.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/Login.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/Orders.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/PasswordReset.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/PasswordResetRequest.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/Profile.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/Register.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/account/Address.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/account/Addresses.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/account/IndentifyingData.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/account/PersonalData.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/helper.ts delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/OrderDetailedView.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/helper.ts delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/list/OrderCard.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/list/OrderTableRow.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/overview/OrderDetails.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/overview/OrderOverview.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/overview/OriginalCartPreview.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/overview/ShippingOverview.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/overview/StateLogPreview.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/rating/OrderRating.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/rating/ProductRating.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/return/OrderReturnView.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/return/ReturnOverview.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/return/ReturnProductLine.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/widgets/OrderCancelledBanner.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/widgets/OrderProblemBanner.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/widgets/ProductImages.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/order/widgets/orderStatus.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/profile/EditableRecords.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/profile/RecordEditMask.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/profile/Records.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/profile/SocialMediaRow.svelte delete mode 100644 frontend/src/lib/components/pagebuilder/profile/profile/VideoPreview.svelte delete mode 100644 frontend/src/lib/components/widgets/Pricetag.svelte delete mode 100644 frontend/src/lib/components/widgets/inputs/imageUpload/ImageFieldLibrary.svelte delete mode 100644 frontend/src/lib/components/widgets/inputs/imageUpload/ImagePreviewRow.svelte delete mode 100644 frontend/src/lib/components/widgets/inputs/imageUpload/ImageUpload.svelte delete mode 100644 frontend/src/lib/components/widgets/inputs/imageUpload/ImagesRow.svelte delete mode 100644 frontend/src/lib/components/widgets/inputs/imageUpload/UploadImageWidget.svelte delete mode 100644 frontend/src/lib/components/widgets/inputs/imageUpload/helper.ts delete mode 100644 frontend/src/lib/components/widgets/inputs/imageUpload/imagePreview.svelte delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/cart.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/categories.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/customer.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/errors.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/cart.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/categories.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/customer.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/product.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/index.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/mapper.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/mutations/cart.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/mutations/customer.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/mutations/wishlist.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/product.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/cart.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/category.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/checkout.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/customer.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/menu.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/product.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/wishlist.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/bigCommerce/wishlist.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/actions.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/customer.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/helpCenter.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/orders.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/product.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/rating.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/store.ts delete mode 100644 frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/wishlist.ts delete mode 100644 frontend/src/lib/functions/helper/SEO.ts delete mode 100644 frontend/src/lib/functions/helper/product.ts delete mode 100644 frontend/src/lib/functions/type-guards.ts delete mode 100644 frontend/src/lib/functions/uploadProcess.ts delete mode 100644 frontend/src/routes/Cart.svelte delete mode 100644 frontend/src/routes/HelpCenter.svelte delete mode 100644 frontend/src/routes/KrassKraftChapter.svelte delete mode 100644 frontend/src/routes/Product.svelte delete mode 100644 frontend/src/routes/Products.svelte delete mode 100644 frontend/src/routes/Profile.svelte delete mode 100644 frontend/src/routes/PublicProfile.svelte delete mode 100644 frontend/src/routes/RatingConfirm.svelte delete mode 100644 frontend/src/routes/RedirectToPublicProfile.svelte delete mode 100644 playwright.config.ts delete mode 100644 playwright/example.test.js delete mode 100644 printfulguide.md delete mode 100644 tests-examples/demo-todo-app.spec.ts delete mode 100644 tests/ui/example.spec.ts delete mode 100644 types/bigCommerceRestAPITypes.d.ts delete mode 100644 types/bigCommerceTypes.d.ts delete mode 100644 types/tibiCommerceRelated.d.ts diff --git a/.drone.yml.bak b/.drone.yml.bak deleted file mode 100644 index d5cffab..0000000 --- a/.drone.yml.bak +++ /dev/null @@ -1,151 +0,0 @@ -kind: pipeline -type: docker -name: default - -steps: - ############################## - # Build and deploy docs - ############################## - - name: build docs - image: node:18 - pull: if-not-exists - environment: - FORCE_COLOR: "true" - commands: - - cd docs - - yarn install - - yarn docpress:build - when: - branch: [master] - event: [push] - - - name: deploy docs - image: instrumentisto/rsync-ssh - pull: if-not-exists - environment: - RSYNC_HOST: ftp1.webmakers.de - RSYNC_PORT: 22222 - RSYNC_USER: webmakers_tibi_docs_rsync_master - RSYNC_PASS: - from_secret: rsync_master - commands: - - cd docs - - > - rsync -rlcgD --perms -i -u -v --stats --progress - --delete - -e "sshpass -p $${RSYNC_PASS} ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -p $${RSYNC_PORT}" - _docpress/ - $${RSYNC_USER}@$${RSYNC_HOST}:./ - when: - branch: [master] - event: [push] - - ############################## - # Demo project - ############################## - - name: yarn install - image: node:18 - pull: if-not-exists - environment: - FORCE_COLOR: "true" - commands: - - yarn install - - - name: modify config - image: alpine/git - commands: - - sed -i 's#\(sentryEnvironment.*\)".*"#\1"${DRONE_BRANCH}"#g' frontend/src/config.ts - - sed -i 's#//\( sentry\\.init.*\)#\1#g' frontend/src/config.ts - - export $(cat .env | xargs) - - echo "PROJECT_RELEASE=$${RELEASE_PROJECT_SLUG}.r`git rev-list HEAD --count`-`git describe --all --long | sed 's+/+-+'`" >> .env - - export $(cat .env | xargs) - - cat .env - - sed -i 's#\(const release = \).*#\1"'$${PROJECT_RELEASE}'"#g' api/hooks/config-client.js - - - name: build - image: node:18 - commands: - - yarn build - - - name: build ssr - image: node:18 - commands: - - yarn build:server - - - name: build legacy - image: node:18 - commands: - - yarn build:legacy - - - name: modify html - image: bash - commands: - - bash scripts/preload-meta.sh frontend/spa.html - - bash scripts/preload-meta.sh frontend/spa.html > frontend/_spa.html - - cp frontend/_spa.html frontend/spa.html - - export stamp=`date +%s` - - echo $$stamp - - sed -i s/__TIMESTAMP__/$$stamp/g frontend/spa.html - #- sed -i s/__TIMESTAMP__/$$stamp/g frontend/serviceworker.js - #- cat frontend/serviceworker.js - - cp frontend/spa.html api/templates/spa.html - - cat frontend/spa.html - - # staging - - name: copy api config to staging - image: instrumentisto/rsync-ssh - volumes: - - name: data - path: /data - commands: - - rsync -av api /data/ - - mkdir -p /data/frontend/dist - - rsync -av frontend/dist/ /data/frontend/dist/ - when: - branch: [dev] - event: [push] - - - name: review in staging - image: docker/compose:1.22.0 - commands: - - docker-compose -p ${DRONE_BRANCH}-${DRONE_REPO_NAME}-${DRONE_REPO_OWNER} up -d --build --remove-orphans - volumes: - - name: docker - path: /var/run/docker.sock - when: - branch: [dev] - event: [push] - - # live - - name: deploy master - image: instrumentisto/rsync-ssh - environment: - RSYNC_USER: "" - RSYNC_PASS: - from_secret: rsync_master - # remove if user and pass is set - failure: ignore - commands: - - apk add --no-cache sshpass curl - - scripts/deploy.sh ftp1.webmakers.de $${RSYNC_USER} $${RSYNC_PASS} - # - curl -X POST "https://www....de/api/ssr?token=TowendQhi&clear=1" - when: - branch: [master] - event: [push] - - # - name: upload sourcemaps for glitchtip - # image: node - # environment: - # GLITCHTIP_TOKEN: - # from_secret: glitchtip_token - # commands: - # - yarn upload:sourcemaps - -######## -volumes: - - name: data - host: - path: /data/${DRONE_REPO_OWNER}/${DRONE_REPO_NAME}/${DRONE_BRANCH} - - name: docker - host: - path: /var/run/docker.sock diff --git a/.env b/.env index 7f049b7..c7cd784 100644 --- a/.env +++ b/.env @@ -1,14 +1,14 @@ -PROJECT_NAME=bkdf-tibi-2024 -TIBI_PREFIX=bkdf_tibi_2024 -TIBI_NAMESPACE=bkdf_tibi_2024 +PROJECT_NAME=kontextwerk +TIBI_PREFIX=kontextwerk +TIBI_NAMESPACE=kontextwerk CODER_UID=100 CODER_GID=101 START_SCRIPT=:ssr RSYNC_HOST=ftp1.webmakers.de RSYNC_PORT=22222 RSYNC_USER=BinKrassDuFass_rsync_master -LIVE_URL=https://www.binkrassdufass.de +LIVE_URL=https://www.kontextwerk.de SENTRY_URL=https://sentry.basehosts.de SENTRY_ORG=webmakers -SENTRY_PROJECT=binkrassdufass-tibi-2024 +SENTRY_PROJECT=kontextwerk-tibi-2024 diff --git a/README.md b/README.md deleted file mode 100644 index c8fce4f..0000000 --- a/README.md +++ /dev/null @@ -1,126 +0,0 @@ -# Tibi Docs und Demo Projekt - -Diese Repo enthält die Dokumentation zum TibiCMS und eine Demo-Projekt welches die Dokumentation begleitet und als Projetstarter fungiert. - -## neues Projekt - Checkliste - -- [x] neues Projekt im gitbase.de anlegen (cms/tibi_starter) als Vorlage verwenden -- [ ] klonen -- [ ] bereinigen - -```sh -git filter-branch -f --index-filter 'git rm -rf --cached --ignore-unmatch .yarn/cache' HEAD -git filter-branch -f --index-filter 'git rm -rf --cached --ignore-unmatch docs' HEAD -git push --force -``` - -- [ ] anpassen - - - `.env` - - `docker-compose-local.yml` -> `TIBI_API_NAMESPACE: & PROJECT_NAME` - - `.gitea/workflows/deploy.yaml` -> `name:` - - `./api/hooks/config.js` -> `name:` - - `api/...` - -- [ ] upgraden - -```sh -mkdir tmp -# evtl. zuvor: yarn install -make yarn-upgrade -make docker-pull - -# falls Fehler auftreten, evtl. Berechtigungen fixen -make fix-permissions -``` - -- [ ] los programmieren - -```sh -make docker-start - -# bei erstem fehlerhaften Start, evtl. Berechtigungen fixen: -make fix-permissions -``` - -- [ ] Projekt in Tibi bekannt machen: - - - - Pfad der API-Konfig: `/data/api/config.yml` -- [ ] Website im Browser ansehen: - - -- [ ] Testmails checken: - - - - -- [ ] deploy - 1. [ ] Subdomain im basispanel anlegen auf `../frontend/` - 2. [ ] rsync-Account in basispanel anlegen auf `htdocs/` - 3. [ ] Passwort in Secrets eintragen: - 4. [ ] `deploy.yaml` deploy rsync user anpassen - 5. [ ] pushen - -## SSR Aktivierung - -Per se ist alles vorbereitet damit SSR aktiviert werden kann, hier muss nur START_SCRIPT=:ssr in der .env datei einkommentiert werden. -Es ist jedoch anzunehmen, dass während der entwicklung Dinge eingebaut wurden, dass die kompilierung schief geht. Um dies zu kontrollieren, muss man zunächst prüfen, ob Einträge in der SSR collection vorhanden sind. Gibt es keine Einträge, sollte man in die "/" Anfrage in den Netzwerkeinstellungen schauen. Hier ist in der Server Antwort im HTML template ein fehler zum debuggen zu finden! - -# Git prozess - WICHTIG! - -Der git Ablauf wurde mittels eines pre push Hooks modifiziert. Hier wird der aktuelle gepushte commit modifiziert, indem ein mongodump der aktuellen datenbank vor genommen wird und die kopie in ".gitea/actions/init-db/mongo-dump" abgespeichert wird. -Der pre-push hook liegt in .git und sieht wie folgt aus: - -```sh -#!/bin/bash - -ENV_FILE="$(git rev-parse --show-toplevel)/.env" -echo "PRE-PUSH HOOK: Running mongodump and adding it to the commit..." -# Check if the .env file exists -if [ ! -f "$ENV_FILE" ]; then - echo ".env file not found. Push cancelled." - exit 1 -fi - -# Source the .env file -source "$ENV_FILE" - -# Name of the Docker container running MongoDB -CONTAINER_NAME="${PROJECT_NAME}-mongo-1" - -# Directory to store the mongodump -OUTPUT_DIR=".gitea/actions/init-db/mongo-dump" -DUMP_DIR_NAME="tmp/mongo-dump" - -# Message to append to the commit -APPEND_MSG="made a mongodump on current local database for tests to have data" - -# Check if the container is running -if ! docker ps | grep -q "$CONTAINER_NAME"; then - echo "MongoDB container '$CONTAINER_NAME' is not running. Push cancelled." - exit 1 -fi - -# Perform mongodump -docker exec "$CONTAINER_NAME" mongodump --out /$DUMP_DIR_NAME && \ -docker cp "$CONTAINER_NAME":/$DUMP_DIR_NAME "$OUTPUT_DIR" - -# Check for successful mongodump -if [ $? -ne 0 ]; then - echo "Mongodump failed. Push cancelled. Make sure that the mongo container is up and running, necessary for the Workflow, because it needs a seeded database, wich needs a mongodump beforehand." - exit 1 -fi - -# Add the output to the current commit -git add "$OUTPUT_DIR" - -# Amend the commit with a modified message -CURRENT_MSG=$(git log -1 --pretty=%B) -NEW_MSG="$CURRENT_MSG $APPEND_MSG" -git commit -m "$NEW_MSG" - -# Continue with the push -exit 0 -``` - -Diese Kopie wird gebraucht, um im Workflow unsere Lokale entwicklungsumgebung zu booten. Dieser workflow ist unter dem Namen lighthouse-evaluation in der deploy.yaml Datei zu finden. Es ist anzumerken, dass der Code funktioniert, er wurde in github getestet, jedoch in gitea das feature der Services noch nicht funktionsfähig ist, da Stand Februar 2024 das noch nicht unterstützt wird! Es wird jedoch sehr hilfreich sein, da -a) bei jedem Push eine lighthouse analyse durchgeführt wird und das Ergebnis davon in nextcloud hochgeladen wird. Bei bedarf kann natürlich auch die Funktion hinzugefügt werden, dass das Ergebnis direkt an seine Email gesandt wird oder ähnliches. -b) Man kann die Umgebung auch für Test zwecke verwenden. Wenn man also bspw. Cypress einbaut, so hat man direkt eine Umgebung um dies laufen zu lassen. diff --git a/ai.md b/ai.md deleted file mode 100644 index 92ab989..0000000 --- a/ai.md +++ /dev/null @@ -1 +0,0 @@ -LMStudio?! \ No newline at end of file diff --git a/api/collections/Challenge.yml b/api/collections/Challenge.yml deleted file mode 100644 index d575a9a..0000000 --- a/api/collections/Challenge.yml +++ /dev/null @@ -1,253 +0,0 @@ -name: selfImprovementChallenge - -meta: - allowExportAll: true - label: - de: SelfImp. Challenge - en: SelfImp. Challenge - muiIcon: label - backup: - active: true - collectionName: backups - defaultSort: - field: name - order: ASC - - views: &views - - type: table - columns: - - source: title - label: - de: Titel - en: Title - filter: true - - - source: type - label: - de: Typ - en: Type - filter: true - - - source: slug - label: - de: Slug - en: Slug - filter: true - tablist: - activeTab: generalDetails - tabs: - - name: generalDetails - label: - de: Allgemeine Details - en: General Details - subFields: - - source: activeAt - - source: type - - source: title - - source: images - - source: slug - - name: introduction - label: - de: Kurzbeschreibung - en: Short Description - subFields: - - source: introduction - - source: howItWorks - - source: blog - - subNavigation: - - name: modalForeign - defaultSort: - field: name - order: ASC - views: *views - - defaultCallback: - eval: | - (entry) => { - parent.selectEntry(entry) - } - -permissions: - public: - methods: - get: true - post: false - put: false - delete: false - user: - methods: - get: true - post: true - put: true - delete: true - -fields: - - name: slug - type: string - meta: - label: - de: Slug - en: Slug - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: activeAt - type: date - meta: - label: - de: Aktiv ab - en: Active at - widget: date - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: type - type: number - meta: - label: - de: Typ - en: Type - widget: select - choices: - - name: Krass Kraft - id: 1 - - name: Crazy Calm - id: 2 - - name: Crazy Crave Control - id: 3 - - name: Krass Kreativ - id: 4 - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: images - type: object - meta: - label: - de: Bilder - en: Images - subFields: - - name: preview - type: string - meta: - label: - de: Mobile - en: Mobile - widget: foreignKey - foreign: - collection: medialib - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - - name: detailed - type: string - meta: - label: - de: Desktop - en: Desktop - widget: foreignKey - foreign: - collection: medialib - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - - - name: title - type: string - meta: - label: - de: Titel - en: Title - - - name: introduction - type: string[] - meta: - label: - de: Kurzbeschreibung - en: Short Description - useDefaultArray: true - widget: richtext - - - name: howItWorks - type: object - meta: - label: - de: Wie es funktioniert - en: How it works - subFields: - - name: invitation - type: string - meta: - label: - de: Einladung - en: Invitation - - - !include fields/contentBlocks/stepNr.yml - - - name: blog - type: object - meta: - label: - de: Blog - en: Blog - subFields: - - name: blogId - type: string - meta: - label: - de: Blog ID - en: Blog ID - widget: foreignKey - foreign: - collection: content - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - - - name: thumbnail - type: string - meta: - label: - de: Thumbnail - en: Thumbnail - widget: foreignKey - foreign: - collection: medialib - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - - - name: sources - type: object[] - meta: - label: - de: Quellen - en: Sources - subFields: - - name: source - type: string - meta: - label: - de: Quelle - en: Source - - - name: url - type: string - meta: - label: - de: URL - en: URL diff --git a/api/collections/OrderReturnRequest.yml b/api/collections/OrderReturnRequest.yml deleted file mode 100644 index 944bff0..0000000 --- a/api/collections/OrderReturnRequest.yml +++ /dev/null @@ -1,360 +0,0 @@ -name: orderReturnRequest - -meta: - allowExportAll: true - label: - de: Retourenanfrage - en: Order Return Request - muiIcon: label - backup: - active: true - collectionName: backups - defaultSort: - field: insertTime - order: DESC - tablist: - activeTab: generalDetails - tabs: - - name: generalDetails - label: - de: Allgemeine Details - en: General Details - subFields: - - source: status - - source: notes - - name: customerDetails - label: - de: Kunden Details - en: Customer Details - subFields: - - source: email - - source: bigCommerceId - - name: products - label: - de: Produkte - en: Products - subFields: - - source: products - - name: returnShppingLabels - label: - de: Retourenlabels - en: Return Shipping Labels - subFields: - - source: returnShppingLabels - views: &views - - type: table - columns: - - source: status - filter: true - - source: email - filter: true - - source: bigCommerceId - filter: - type: foreignKey - - source: insertTime - filter: true - subNavigation: - - name: modalForeign - defaultSort: - field: "path" - order: "ASC" - views: *views - defaultCallback: - eval: | - //js - (entry) => { - parent.selectEntry(entry) - } - //!js - - - name: new - label: - de: Neu - en: New - muiIcon: new - defaultSort: - field: insertTime - order: DESC - views: *views - filter: - status: pending - - - name: inProgress - label: - de: In Bearbeitung - en: In Progress - muiIcon: inProgress - defaultSort: - field: insertTime - order: DESC - views: *views - filter: - status: approved - - - name: done - label: - de: Abgeschlossen - en: Done - muiIcon: done - defaultSort: - field: insertTime - order: DESC - views: *views - filter: - status: refunded - - name: failed - label: - de: Fehlgeschlagen - en: Failed - muiIcon: error - defaultSort: - field: insertTime - order: DESC - views: *views - filter: - status: failed - - name: rejected - label: - de: Abgelehnt - en: Rejected - muiIcon: error - defaultSort: - field: insertTime - order: DESC - views: *views - filter: - status: rejected - -permissions: - public: - methods: - get: true - post: true - put: false - delete: true - user: - methods: - get: true - post: true - put: true - delete: true - -hooks: - get: - read: - type: javascript - file: hooks/orderReturnRequest/get_read.js - post: - create: - type: javascript - file: hooks/orderReturnRequest/post_create.js - return: - type: javascript - file: hooks/orderReturnRequest/post_return.js - put: - update: - type: javascript - file: hooks/orderReturnRequest/put_update.js - - delete: - delete: - type: javascript - file: hooks/orderReturnRequest/delete_delete.js - return: - type: javascript - file: hooks/orderReturnRequest/delete_return.js - -fields: - - name: status - type: string - meta: - label: - de: Status - en: Status - widget: select - choices: - - name: pending - id: pending - - - name: approved - id: approved - - - name: rejected - id: rejected - - - name: refunded - id: refunded - - - name: failed - id: failed - - - name: email - type: string - meta: - label: - de: E-Mail - en: E-Mail - - - name: bigCommerceId - type: number - meta: - label: - de: Bestellnummer - en: Order ID - widget: foreignKey - filter: - type: foreignKey - foreign: - collection: bigCommerceOrder - id: bigCommerceId - subNavigation: 0 - render: - defaultCollectionViews: true - - - name: returnShppingLabels - type: object[] - meta: - label: - de: Retourenlabels - en: Return Shipping Labels - subFields: - - name: cost - type: number - meta: - label: - de: Kosten - en: Cost - - name: label - type: file - meta: - label: - de: Label - en: Label - widget: file - - - name: products - type: object[] - meta: - widget: containerLessObjectArray - label: - de: Produkte - en: Products - subFields: - - name: baseProductId - type: number - meta: - label: - de: Produkt ID - en: Product ID - widget: foreignKey - foreign: - collection: bigCommerceProduct - id: bigCommerceId - subNavigation: 0 - render: - defaultCollectionViews: true - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: attachedImages - type: string[] - meta: - label: - de: Angehängte Bilder - en: Attached Images - widget: foreignKey - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - foreign: - collection: medialib - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - filter: - type: foreignKey - - - name: quantity - type: number - meta: - label: - de: Menge - en: Quantity - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-4" - - name: productId - type: number - meta: - label: - de: Produkt ID in Bestellung - en: Product ID in Order - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-4" - - - name: returnReason - type: string - meta: - label: - de: Retourengrund - en: Return Reason - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-4" - - widget: select - choices: - - name: falsche Größe - id: wrongSize - - name: falsche Farbe - id: wrongColor - - name: falsches Produkt - id: wrongProduct - - name: beschädigt - id: damaged - - name: zu Groß - id: tooLarge - - name: zu Klein - id: tooSmall - - name: nicht Wie Beschrieben - id: notAsDescribed - - name: schlechte Qualität - id: poorQuality - - name: sieht Anders Aus - id: looksDifferent - - name: nicht Mehr Benötigt - id: noLongerNeeded - - name: schlechtes Preis Leistungs Verhältnis - id: poorValue - - name: andere - id: other - - name: notes - type: string - meta: - label: - de: Notizen - en: Notes - widget: textarea - containerProps: - layout: - size: - default: "col-12" - small: "col-12" - large: "col-12" diff --git a/api/collections/OrderRevokeRequest.yml b/api/collections/OrderRevokeRequest.yml deleted file mode 100644 index d3b8fc8..0000000 --- a/api/collections/OrderRevokeRequest.yml +++ /dev/null @@ -1,183 +0,0 @@ -name: orderRevokeRequest - -meta: - allowExportAll: true - label: - de: Bestellung Abbruch - en: Revoke Order - muiIcon: label - backup: - active: true - collectionName: backups - defaultSort: - field: name - order: ASC - - views: &views - - type: table - columns: - - source: status - filter: true - - source: email - filter: true - - source: bigCommerceId - filter: - type: foreignKey - - source: insertTime - filter: true - tablist: - activeTab: generalDetails - tabs: - - name: generalDetails - label: - de: Allgemeine Details - en: General Details - subFields: - - source: email - - source: bigCommerceId - - source: printfulId - - name: editable - label: - de: Bearbeitbar - en: Editable - - subFields: - - source: status - - source: notes - subNavigation: - - name: modalForeign - defaultSort: - field: "path" - order: "ASC" - views: *views - defaultCallback: - eval: | - //js - (entry) => { - parent.selectEntry(entry) - } - //!js - - - name: new - label: - de: Neu - en: New - muiIcon: new - defaultSort: - field: insertTime - order: DESC - views: *views - filter: - status: pending - - - name: inProgress - label: - de: In Bearbeitung - en: In Progress - muiIcon: inProgress - defaultSort: - field: insertTime - order: DESC - views: *views - filter: - status: refunded -permissions: - public: - methods: - get: true - post: true - put: false - delete: false - user: - methods: - get: true - post: true - put: true - delete: true - -hooks: - get: - read: - type: javascript - file: hooks/orderRevokeRequest/get_read.js - post: - create: - type: javascript - file: hooks/orderRevokeRequest/post_create.js - return: - type: javascript - file: hooks/orderRevokeRequest/post_return.js - -fields: - - name: status - type: string - meta: - label: - de: Status - en: Status - widget: select - choices: - - name: - de: Wartend - en: pending - id: pending - - name: - de: Zurückgezahlt - en: Refunded - id: refunded - - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: email - type: string - meta: - label: - de: E-Mail - en: E-Mail - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: printfulId - type: number - meta: - label: - de: Printful Bestellungs-ID - en: Printful Order-ID - - - name: bigCommerceId - type: number - meta: - label: - de: Bestellnummer - en: Order ID - widget: foreignKey - filter: - type: foreignKey - foreign: - collection: bigCommerceOrder - id: bigCommerceId - subNavigation: 0 - render: - defaultCollectionViews: true - - name: notes - type: string - meta: - label: - de: Notizen - en: Notes - widget: string - inputProps: - multiline: true - containerProps: - layout: - size: - default: "col-12" - small: "col-12" - large: "col-12" diff --git a/api/collections/QRCode.yml b/api/collections/QRCode.yml deleted file mode 100644 index ac9c36d..0000000 --- a/api/collections/QRCode.yml +++ /dev/null @@ -1,68 +0,0 @@ -name: qrCode - -meta: - allowExportAll: true - label: - de: QR Codes - en: QR Codes - - muiIcon: label - - defaultSort: - field: name - order: ASC - backup: - active: true - collectionName: backups - views: &views - - type: table - columns: - - source: customer - filter: - type: foreignKey - - source: createdAt - filter: true - - - source: id - renderValue: - raw: true - eval: | - (function(){ - const id = $.id; - return `` })() - -permissions: - public: - methods: - get: true - post: false - put: false - delete: false - user: - methods: - get: true - post: true - put: true - delete: true - -fields: - - name: customer - type: string - index: [single] - meta: - label: - de: Kunde - en: Customer - widget: foreignKey - foreign: - collection: bigCommerceCustomer - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - filter: - type: foreignKey -indexes: - - name: fulltext # Ein eindeutiger Name für den Index. Es ist optional, wird jedoch empfohlen, um den Index später leicht identifizieren zu können. - key: # Bestimmt, auf welche Felder der Index angewendet werden soll. Dies kann ein einfacher String sein, wenn der Index nur ein Feld umfasst, oder ein Array von Strings, wenn der Index mehrere Felder umfasst. - - $text:$** diff --git a/api/collections/bigCommerceCustomer.yml b/api/collections/bigCommerceCustomer.yml deleted file mode 100644 index 5b865b6..0000000 --- a/api/collections/bigCommerceCustomer.yml +++ /dev/null @@ -1,278 +0,0 @@ -name: bigCommerceCustomer -# This is just so its easier to reference BigCommerce customer, -# its not intended to be used as a actual reference, -# just so its easier to reference customer in TibiCMS -meta: - label: - de: Kunde - en: Customer - views: - - type: table - columns: - - source: email - filter: true - - - source: username - filter: true - - - source: bigCommerceId - filter: true - - source: personalRecords.recording - filter: - type: foreignKey - - tablist: - activeTab: generalDetails - tabs: - - name: generalDetails - label: - de: Allgemeine Details - en: General Details - subFields: - - source: email - - source: username - - source: bigCommerceId - - - name: socialMedia - label: - de: Soziale Medien - en: Social Media - subFields: - - source: socialMediaAccounts - - - name: personalRecords - label: - de: Persönliche Daten - en: Personal Records - subFields: - - source: personalRecords - - name: admin - label: - de: Admin - en: Admin - subFields: - - source: currentToken - - source: locked - - backup: - active: true - collectionName: backups - subNavigation: - - name: modal - views: - - type: table - columns: - - source: email - defaultCallback: # Standard-Callback-Funktion, die ausgeführt wird, wenn keine andere spezifiziert ist. - eval: | # Der Code wird als JavaScript evaluiert. - //js - (entry) => { // Diese Funktion nimmt den Eintrag (entry) als Argument. - parent.selectEntry(entry) // Die Funktion selectEntry auf dem übergeordneten Objekt wird mit dem Eintrag als Argument aufgerufen. - } - //!js -hooks: - put: - # check and return jwt - update: - type: javascript - file: hooks/customer/put_update.js - get: - read: - type: javascript - file: hooks/customer/get_read.js - -permissions: - public: - methods: - get: true - post: false - put: true - delete: false - user: - methods: - get: true - post: false - put: false - delete: false - - token:${BIGCOMMERCE_WEBHOOK_TOKEN}: - methods: - get: true - post: true - put: true - delete: true - -fields: - - name: bigCommerceId - type: number - meta: - label: - de: BigCommerce ID - en: BigCommerce ID - helperText: - de: Die ID des Kunden in BigCommerce - en: The ID of the customer in BigCommerce - - - name: email - type: string - meta: - label: - de: Angehängte E-Mail - en: Attached Email - helperText: - de: Die E-Mail-Adresse des Kunden - en: The email address of the customer - - - name: username - type: string - index: [single, unique] - meta: - label: - de: Benutzername - en: Username - helperText: - de: Der Benutzername des Kunden - en: The username of the customer - - - name: locked - type: boolean - meta: - label: - de: Gesperrt - en: Locked - helperText: - de: Ob der Kunde gesperrt ist - en: Whether the customer is locked - - - name: currentToken - type: string - meta: - label: - de: Aktueller Token - en: Current Token - inputProps: - disabled: true - helperText: - de: Der aktuelle Token des Kunden - en: The current token of the customer - - - name: socialMediaAccounts - type: object - meta: - label: - de: Soziale Medien - en: Social Media - helperText: - de: Die sozialen Medien des Kunden - en: The social media of the customer - widget: containerLessObject - subFields: - - name: instagramLink - type: string - meta: - label: - de: Instagram Link - en: Instagram Link - helperText: - de: Der Instagram-Link des Kunden - en: The Instagram link of the customer - - name: facebookLink - type: string - meta: - label: - de: Facebook Link - en: Facebook Link - helperText: - de: Der Facebook-Link des Kunden - en: The Facebook link of the customer - - name: twitterLink - type: string - meta: - label: - de: Twitter Link - en: Twitter Link - helperText: - de: Der Twitter-Link des Kunden - en: The Twitter link of the customer - - name: tiktokLink - type: string - meta: - label: - de: TikTok Link - en: TikTok Link - helperText: - de: Der TikTok-Link des Kunden - en: The TikTok link of the customer - - name: youtubeLink - type: string - meta: - label: - de: YouTube Link - en: YouTube Link - helperText: - de: Der YouTube-Link des Kunden - en: The YouTube link of the customer - - - name: personalRecords - type: object[] - meta: - label: - de: Persönliche Daten - en: Personal Records - helperText: - de: Die persönlichen Daten des Kunden - en: The personal records of the customer - subFields: - - name: title - type: string - meta: - label: - de: Titel - en: Title - - name: description - type: string - meta: - label: - de: Beschreibung - en: Description - - name: ageAtRecording - type: number - meta: - label: - de: Alter bei Aufnahme - en: Age at Recording - - name: priority - type: number - meta: - label: - de: Priorität - en: Priority - - name: recording - type: string - meta: - label: - de: Aufnahme - en: Recording - widget: foreignKey - filter: - type: foreignKey - foreign: - collection: medialib - subNavigation: 0 - id: id - render: - defaultCollectionViews: true - - - name: thumbnail - type: string - meta: - label: - de: Vorschaubild - en: Thumbnail - widget: foreignKey - foreign: - collection: medialib - subNavigation: 0 - id: id - render: - defaultCollectionViews: true diff --git a/api/collections/bigCommerceOrder.yml b/api/collections/bigCommerceOrder.yml deleted file mode 100644 index 372b90a..0000000 --- a/api/collections/bigCommerceOrder.yml +++ /dev/null @@ -1,281 +0,0 @@ -name: bigCommerceOrder -# This is just so its easier to reference BigCommerce order, -# its not intended to be used as a actual reference, -# just so its easier to reference order in TibiCMS -meta: - label: - de: Bestellung - en: Order - views: !include fieldLists/orderViews.yml - backup: - active: true - collectionName: backups - subNavigation: - - name: modal - views: !include fieldLists/orderViews.yml - defaultCallback: # Standard-Callback-Funktion, die ausgeführt wird, wenn keine andere spezifiziert ist. - eval: | # Der Code wird als JavaScript evaluiert. - //js - (entry) => { // Diese Funktion nimmt den Eintrag (entry) als Argument. - parent.selectEntry(entry) // Die Funktion selectEntry auf dem übergeordneten Objekt wird mit dem Eintrag als Argument aufgerufen. - } - //!js - -permissions: - public: - methods: - get: true - post: false - put: false - delete: false - user: - methods: - get: true - post: true - put: true - delete: false - - token:${BIGCOMMERCE_WEBHOOK_TOKEN}: - methods: - get: true - post: true - put: true - delete: true - -hooks: - get: - read: - type: javascript - file: hooks/order/get_read.js - -fields: - - name: status - type: string - meta: - label: - de: Status - en: Status - widget: select - choices: - - id: draft - name: - de: Entwurf - en: Draft - - id: pending - name: - de: Ausstehend - en: Pending - - id: failed - name: - de: Fehlgeschlagen - en: Failed - - id: completed - name: - de: Abgeschlossen - en: Completed - - id: cancelled - name: - de: Storniert - en: Cancelled - - id: inprocess - name: - de: In Bearbeitung - en: In Process - - id: onhold - name: - de: Zurückgehalten - en: On Hold - - id: partial - name: - de: Teilweise - en: Partial - - id: fulfilled - name: - de: Erfüllt - en: Fulfilled - - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: statusSetAt - type: date - meta: - label: - de: Status gesetzt am - en: Status set at - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: bigCommerceId - type: number - meta: - label: - de: BigCommerce ID - en: BigCommerce ID - helperText: - de: Die ID der Bestellung in BigCommerce - en: The ID of the Order in BigCommerce - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: customerBigCommerceId - type: number - meta: - label: - de: Kunde BigCommerce ID - en: Customer BigCommerce ID - helperText: - de: Die ID des Kunden in BigCommerce - en: The ID of the customer in BigCommerce - - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: customerTibiId - type: string - meta: - label: - de: Kunde - en: Customer - filter: - type: foreignKey - widget: foreignKey - foreign: - collection: bigCommerceCustomer - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - - - name: products - type: object[] - meta: - label: - de: Produkte - en: Producte - widget: containerLessObjectArray - subFields: - - name: bigCommerceId - type: number - meta: - label: - de: BigCommerce ID - en: BigCommerce ID - helperText: - de: Die ID des Produkts in BigCommerce - en: The ID of the product in BigCommerce - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: tibiId - type: string - meta: - label: - de: Tibi ID - en: Tibi ID - widget: foreignKey - filter: - type: foreignKey - foreign: - collection: bigCommerceProduct - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: quantity - type: number - meta: - label: - de: Menge - en: Quantity - - - name: shipments - type: object[] - meta: - label: - de: Lieferungen - en: Shipments - subFields: - - name: trackingUrl - type: string - meta: - label: - de: Tracking URL - en: Tracking URL - helperText: - de: Die URL, um das Paket zu verfolgen - en: The URL to track the package - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: trackingNumber - type: string - meta: - label: - de: Tracking Nummer - en: Tracking Number - helperText: - de: Die Tracking Nummer des Pakets - en: The tracking number of the package - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: carrier - type: string - meta: - label: - de: Carrier - en: Carrier - helperText: - de: Der Carrier des Pakets - en: The carrier of the package - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: sentAt - type: date - meta: - label: - de: Versendet am - en: Sent at - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" diff --git a/api/collections/bigCommerceProduct.yml b/api/collections/bigCommerceProduct.yml deleted file mode 100644 index f9b382a..0000000 --- a/api/collections/bigCommerceProduct.yml +++ /dev/null @@ -1,273 +0,0 @@ -name: bigCommerceProduct -# This is just so its easier to reference BigCommerce products, -# its not intended to be used as a actual reference, -# just so its easier to reference products in TibiCMS -meta: - label: - de: Produkt - en: Product - views: &views - - type: cardList - mediaQuery: "(min-width: 1200px)" - selectionPriority: 1 - fields: - - source: productName - filter: true - name: - de: Produktname - en: Product Name - - - source: previewImage - filter: true - name: - de: Vorschaubild - en: Preview Image - - - source: printfulProductId - filter: true - name: - de: Printful Produkt ID - en: Printful Product ID - - - source: forcedWarning - filter: true - name: - de: Warnungsanzeige - en: Warning Display - - - type: table - mediaQuery: "(min-width: 600px)" - columns: - - source: productName - - source: previewImage - - source: bigCommerceSKU - - source: printfulProductId - - source: forcedWarning - - - type: simpleList - primaryText: previewImage - secondaryText: productName - tertiaryText: printfulProductId - tablist: - activeTab: generalDetails - tabs: - - name: generalDetails - label: - de: Allgemeine Details - en: General Details - subFields: - - source: productName - - source: previewImage - - source: bigCommerceSKU - - source: bigCommerceId - - name: edit - label: - de: Bearbeitbar - en: Editable - subFields: - - source: forcedWarning - - source: printfulProductId - - name: sizingChart - label: - de: Größentabelle - en: Sizing Chart - subFields: - - source: sizingChart - - subNavigation: - - name: modal - views: *views - - defaultCallback: # Standard-Callback-Funktion, die ausgeführt wird, wenn keine andere spezifiziert ist. - eval: | # Der Code wird als JavaScript evaluiert. - //js - (entry) => { // Diese Funktion nimmt den Eintrag (entry) als Argument. - parent.selectEntry(entry) // Die Funktion selectEntry auf dem übergeordneten Objekt wird mit dem Eintrag als Argument aufgerufen. - } - //!js - -permissions: - public: - methods: - get: true - post: false - put: false - delete: false - user: - methods: - get: true - post: true - put: false - delete: false - - token:${BIGCOMMERCE_WEBHOOK_TOKEN}: - methods: - get: true - post: true - put: true - delete: true -hooks: - put: - update: - type: javascript - file: hooks/product/put_update.js - post: - create: - type: javascript - file: hooks/product/post_create.js - get: - read: - type: javascript - file: hooks/product/get_read.js - - return: - type: javascript - file: hooks/product/get_return.js -fields: - - name: bigCommerceSKU - type: string - meta: - label: - de: BigCommerce SKU - en: BigCommerce SKU - helperText: - de: Die SKU des Produkts in BigCommerce - en: The SKU of the product in BigCommerce - - - name: bigCommerceId - type: number - meta: - label: - de: BigCommerce ID - en: BigCommerce ID - helperText: - de: Die ID des Produkts in BigCommerce - en: The ID of the product in BigCommerce - - name: printfulProductId - type: string - meta: - label: - de: Printful Produkt ID - en: Printful Product ID - helperText: - de: Die ID des Produkts in Printful - en: The ID of the product in Printful - - - name: previewImage - type: string - meta: - label: - de: Vorschaubild - en: Preview Image - widget: imageURL - - - name: productName - type: string - meta: - label: - de: Produktname - en: Product Name - - - name: forcedWarning - type: string - meta: - label: - de: Warnungsanzeige - en: Warning Display - - - name: sizingChart - type: object - meta: - label: - de: Größentabelle - en: Sizing Chart - subFields: - - name: imageURL - type: string - meta: - label: - de: Bild - en: Image - widget: imageURL - - - name: imageDescription - type: string - meta: - label: - de: Bildbeschreibung - en: Image Description - widget: richtext - - - name: generalDescription - type: string - meta: - label: - de: Allgemeine Beschreibung - en: General Description - widget: richtext - - - name: availableSizes - type: string[] - meta: - label: - de: Verfügbare Größen - en: Available Sizes - widget: select - choices: - - name: XS - id: XS - - name: S - id: S - - name: M - id: M - - name: L - id: L - - name: XL - id: XL - - name: 2XL - id: 2XL - - name: 3XL - id: 3XL - - name: 4XL - id: 4XL - - name: 5XL - id: 5XL - - name: 6XL - id: 6XL - - name: columns - type: object[] - meta: - label: - de: Spalten - en: Columns - subFields: - - name: label - type: string - meta: - label: - de: Label ID - en: Label ID - widget: foreignKey - foreign: - collection: module - id: label - subNavigation: 0 - render: - defaultCollectionViews: true - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: sizes - type: string[] - meta: - label: - de: Größen - en: Sizes - useDefaultArray: true - widget: string - helperText: - de: In CM, selbe reihenfolge wie in der availableSizes - en: In CM, same order as in availableSizes diff --git a/api/collections/dummyCartEndpoint.yml b/api/collections/dummyCartEndpoint.yml deleted file mode 100644 index b6ac34a..0000000 --- a/api/collections/dummyCartEndpoint.yml +++ /dev/null @@ -1,38 +0,0 @@ -# just here since bgicommerces graphql api regarding cart and checkout isnt working (only cart create is possible, otherwise it always says cart is not existant) - -######################################################################## -# cart -######################################################################## - -name: dummyCartEndpoint -meta: - hideInNavigation: true - openapi: - disabled: true - -permissions: - public: - methods: - get: true - post: true - put: false - delete: false - - user: - methods: - get: false - post: false - put: false - delete: false - -hooks: - get: - read: - type: javascript - file: hooks/cart/get_read.js - post: - validate: - type: javascript - file: hooks/cart/post_validate.js - -fields: diff --git a/api/collections/fieldLists/completeYourLook.yml b/api/collections/fieldLists/completeYourLook.yml deleted file mode 100644 index 0777970..0000000 --- a/api/collections/fieldLists/completeYourLook.yml +++ /dev/null @@ -1,74 +0,0 @@ -- name: products - type: object[] - meta: - label: - de: Produkte - en: Products - subFields: - - name: productImage - type: string - meta: - label: - de: Produktbild - en: Product Image - widget: foreignKey - foreign: - collection: medialib - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - - - name: productReference - type: string - meta: - label: - de: Produktreferenz - en: Product Reference - widget: foreignKey - foreign: - collection: bigCommerceProduct - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - - - name: imageWidth - type: number - meta: - label: - de: Bildbreite - en: Image Width - helperText: - de: "Höhe des Bildes in Prozent." - en: "Height of the image in percent." - - - name: imageHeight - type: number - meta: - label: - de: Bildhöhe - en: Image Height - helperText: - de: "Höhe des Bildes in Prozent." - en: "Height of the image in percent." - - - name: imageTop - type: number - meta: - label: - de: Bildabstand oben - en: Image Top - helperText: - de: "Abstand des Bildes zum oberen Rand in Prozent." - en: "Distance of the image to the top edge in percent." - - - name: imageLeft - type: number - meta: - label: - de: Bildabstand links - en: Image Left - helperText: - de: "Abstand des Bildes zum linken Rand in Prozent." - en: "Distance of the image to the left edge in percent." diff --git a/api/collections/fieldLists/formular/checkboxGroup.yml b/api/collections/fieldLists/formular/checkboxGroup.yml deleted file mode 100644 index 2f9d955..0000000 --- a/api/collections/fieldLists/formular/checkboxGroup.yml +++ /dev/null @@ -1,33 +0,0 @@ -name: checkboxGroupInput -type: object -meta: - label: - de: Checkbox Gruppe - en: Checkbox Group - dependsOn: - eval: $parent?.inputWidgets?.includes('checkboxGroup') - helperText: - de: Ansammlung von Checkboxen - en: Collection of checkboxes -subFields: - - name: groupTitle - type: string - meta: - label: - de: Gruppe Titel - en: Group title - - - name: checkboxes - type: object[] - meta: - label: - - de: Checkbox Gruppe - en: Checkbox Group - direction: row - widget: containerLessObjectArray - subFields: - - name: standardInputProperties - meta: - widget: containerLessObject - subFields: !include standardInputProperties.yml diff --git a/api/collections/fieldLists/formular/dateInput.yml b/api/collections/fieldLists/formular/dateInput.yml deleted file mode 100644 index ef8902a..0000000 --- a/api/collections/fieldLists/formular/dateInput.yml +++ /dev/null @@ -1,17 +0,0 @@ -name: dateInput -type: object -meta: - label: - de: Normaler Kalender - en: Normal calendar - helperText: - de: Datumsfeld - en: Date field - dependsOn: - eval: $parent?.inputWidgets?.includes('defaultCalendar') -subFields: - - name: standardInputProperties - type: object - meta: - widget: containerLessObject - subFields: !include standardInputProperties.yml diff --git a/api/collections/fieldLists/formular/datePicker.yml b/api/collections/fieldLists/formular/datePicker.yml deleted file mode 100644 index 1977934..0000000 --- a/api/collections/fieldLists/formular/datePicker.yml +++ /dev/null @@ -1,46 +0,0 @@ -name: datePickerInput -type: object -meta: - label: - de: Custom Kalender - en: Custom Calendar - dependsOn: - eval: $parent?.inputWidgets?.includes('customCalendar') -subFields: - - name: props - type: object - meta: - label: - de: Datumauswahl Eigenschaften - en: Date selection properties - subFields: - - name: allowedDateRanges - type: object[] - meta: - label: - de: Erlaubte Datumsbereiche - en: Allowed date ranges - widget: containerLessObjectArray - subFields: - - !include ../../fields/from.yml - - name: to - type: date - meta: - label: - de: Bis - en: To - widget: date - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - !include ../../fields/excludedDays.yml - - - name: standardInputProperties - type: object - meta: - widget: containerLessObject - subFields: !include standardInputProperties.yml diff --git a/api/collections/fieldLists/formular/form.yml b/api/collections/fieldLists/formular/form.yml deleted file mode 100644 index a462a0a..0000000 --- a/api/collections/fieldLists/formular/form.yml +++ /dev/null @@ -1,192 +0,0 @@ -- name: emailSubject - type: string - meta: - label: - de: Email Betreff - en: Email Subject - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - -- name: emailReciever - type: string - meta: - label: - de: Email Empfänger - en: Email Reciever - helperText: - de: "Bsp: xyz@gmail.com" - en: "E.g.: xyz@gmail.com" - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - -- !include ../../fields/emailCC.yml - -- name: emailIntroduction - type: string - meta: - label: - de: Email Einleitungssatz - en: Email Introduction Sentence - helperText: - de: "Bsp: Hallo xyz, sie haben eine neue Kaufanfrage erhalten!" - en: "E.g.: Hello xyz, you have received a new purchase request!" - -- name: sendFormBtnText - type: string - meta: - label: - de: Formular Absenden Button Text - en: Form Submit Button Text - helperText: - de: "Bsp: Absenden" - en: "E.g.: Submit" - -- name: rows - type: object[] - meta: - label: - de: Zeile - en: Row - widget: grid - addElementLabel: Zeile Hinzufügen - - subFields: - - name: title - type: string - meta: - label: - de: Zeilenname - en: Row name - helperText: - de: "Sollte der Titel keinen Wert enthalten, wird kein Zeilenname angezeigt!" - en: "If the title does not contain a value, no row name will be displayed!" - - - name: emailTitle - type: string - meta: - label: - de: Email Abschnitt Titel - en: Email section title - helperText: - de: "Sollte der Titel keinen Wert enthalten, wird kein Abschnitt Titel angezeigt!" - en: "If the title does not contain a value, no section title will be displayed!" - - - name: columns - type: object[] - - meta: - label: - de: Spalte - en: Column - addElementLabel: - de: Spalte hinzufügen - en: Add column - widget: grid - direction: horizontal - subFields: - - name: title - type: string - meta: - label: - de: Überschrift - en: Headline - helperText: - de: Optional - en: Optional - - - name: emailTitle - type: string - meta: - label: - de: Email Abschnitt Titel - en: Email section title - - - name: annotation - type: string - meta: - label: - de: Zusatzinformation - en: Additional information - - - name: inputWidgets - type: string[] - meta: - label: - de: Angezeigte Eingabefelder - en: Displayed input fields - widget: selectArray - choices: - - name: - de: Nummernblock - en: Number block - id: labelNumber - - - name: - de: Zeitenauswahlfeld - en: Time selection field - id: times - - - name: - de: Auswahlfeld - en: Selection field - id: select - - - name: - de: Datumsauswahl - Standard Kalender - en: Date selection - Standard calendar - id: defaultCalendar - - - name: - de: Datumauswahl - Custom Kalender - en: Date selection - Custom calendar - id: customCalendar - - - name: - de: Nummerfeld - en: Number field - id: number - - - name: - de: Checkbox Gruppe - en: Checkbox group - id: checkboxGroup - - - name: - de: Mehrfachauswahl - en: Multiple selection - id: multiSelect - - - name: - de: Textfeld - en: Text field - id: text - - - name: - de: Zeitenauswahl - en: Time selection - id: timeSelect - - - name: - de: Standardauswahl - en: Standard selection - id: standardSelect - - - !include standardSelect.yml - - - !include labelNumberInput.yml - - !include timesInput.yml - - !include dateInput.yml - - !include numberInput.yml - - !include checkboxGroup.yml - - !include datePicker.yml - - !include multiSelectInput.yml - - !include textInputs.yml - - !include timeSelect.yml diff --git a/api/collections/fieldLists/formular/labelNumberInput.yml b/api/collections/fieldLists/formular/labelNumberInput.yml deleted file mode 100644 index eaec506..0000000 --- a/api/collections/fieldLists/formular/labelNumberInput.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: labelNumberInput -type: object[] -meta: - label: - de: Nummer block - en: Number block - dependsOn: - eval: $parent?.inputWidgets?.includes('labelNumber') - helperText: - de: Links beschreibender Text, rechts zahleneingabe - en: Left descriptive text, right number input - -subFields: - - name: group - type: number - meta: - label: - de: Gruppe - en: Group - helpterText: - de: Pflichtfeld seperierung. Aus einem Nummernblock muss mindestens eine Gruppe input haben. - en: Mandatory field separation. A number block must have at least one group input. - - - name: title - type: string - meta: - label: Titel - helperText: - de: Block Titel - en: Block title - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: emailName - type: string - meta: - label: - de: Email Name - en: Email name - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: block - type: object[] - meta: - label: Block - widget: containerLessObjectArray - subFields: - - name: label - type: string - meta: - label: Label - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: emailName - type: string - meta: - label: - de: Email Name - en: Email name - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" diff --git a/api/collections/fieldLists/formular/multiSelectInput.yml b/api/collections/fieldLists/formular/multiSelectInput.yml deleted file mode 100644 index d8b0315..0000000 --- a/api/collections/fieldLists/formular/multiSelectInput.yml +++ /dev/null @@ -1,50 +0,0 @@ -name: multiSelectInput -type: object -meta: - label: - de: Mehrfachauswahl Input - en: Multi Select Input - dependsOn: - eval: $parent?.inputWidgets?.includes('multiSelect') -subFields: - - name: standardInputProperties - type: object - meta: - widget: containerLessObject - subFields: !include standardInputProperties.yml - - - name: options - type: object[] - meta: - label: - de: Mehrfachauswahl Optionen - en: Multi Select Options - direction: row - widget: containerLessObjectArray - subFields: - - name: name - type: string - meta: - label: - de: Name - en: Name - - - name: props - type: object - meta: - label: - de: Mehrfachauswahl Eigenschaften - en: Multi Select Properties - subFields: - - name: additionalAddableValues - type: boolean - meta: - label: - de: Zusätzliche hinzufügbare Werte - en: Additional addable values - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" diff --git a/api/collections/fieldLists/formular/numberInput.yml b/api/collections/fieldLists/formular/numberInput.yml deleted file mode 100644 index 38e8ff6..0000000 --- a/api/collections/fieldLists/formular/numberInput.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: numberInput -type: object -meta: - label: - de: Nummereingabe - en: Number Input - dependsOn: - eval: $parent?.inputWidgets?.includes('number') -subFields: - - name: standardInputProperties - type: object - meta: - widget: containerLessObject - subFields: !include standardInputProperties.yml diff --git a/api/collections/fieldLists/formular/standardInputProperties.yml b/api/collections/fieldLists/formular/standardInputProperties.yml deleted file mode 100644 index 5b22e01..0000000 --- a/api/collections/fieldLists/formular/standardInputProperties.yml +++ /dev/null @@ -1,71 +0,0 @@ -- name: emailTitle - type: string - meta: - label: - de: Email Titel - en: Email title - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - -- name: placeholder - type: string - meta: - label: - de: Platzhalter - en: Placeholder - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - -- name: notRequired - type: boolean - meta: - label: - de: nicht Notwendig - en: not required - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - -- name: fieldOrder - type: number - meta: - label: - de: Reihenfolge - en: Order - helperText: - de: Die kleinste angegebene Zahl wird am weitesten oben in der Formularspalte stehen - en: The smallest specified number will be at the top of the form column. - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - -- name: textTitle - type: string - meta: - label: - de: Text Titel - en: Text title - helperText: - de: Alternative zu textPlaceholder, steht dann über dem Inputfeld - en: Alternative to textPlaceholder, then stands above the input field - -- name: groupTitle - type: string - meta: - label: - de: Gruppe Titel - en: Group title diff --git a/api/collections/fieldLists/formular/standardSelect.yml b/api/collections/fieldLists/formular/standardSelect.yml deleted file mode 100644 index adb3098..0000000 --- a/api/collections/fieldLists/formular/standardSelect.yml +++ /dev/null @@ -1,58 +0,0 @@ -name: standardSelect -type: object -meta: - label: Standardauswahl - dependsOn: - eval: $parent?.inputWidgets?.includes('standardSelect') -subFields: - - name: standardInputProperties - type: object - meta: - widget: containerLessObject - subFields: !include standardInputProperties.yml - - - name: selectEntries - type: object[] - meta: - label: - de: Auswahleingabe Möglichkeiten - en: Selection input options - widget: containerLessObjectArray - addElementLabel: Auswahleingabe hinzufügen - direction: horizontal - subFields: - - name: shownValue - type: string - meta: - label: - de: Angezeigter Wert - en: Displayed value - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: value - type: string - meta: - label: - de: per Email gesendeter Wert - en: Value sent by email - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: defaultValue - type: boolean - meta: - label: - de: Standardwert - en: Default value - helperText: - de: "Wird dieser Wert ausgewählt, wird er als Standardwert gesetzt" - en: "If this value is selected, it will be set as the default value" diff --git a/api/collections/fieldLists/formular/textInputs.yml b/api/collections/fieldLists/formular/textInputs.yml deleted file mode 100644 index 0ff2dc0..0000000 --- a/api/collections/fieldLists/formular/textInputs.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: textInput -type: object[] -meta: - label: Textfeld - addElementLabel: Textfeld hinzufügen - dependsOn: - eval: $parent?.inputWidgets?.includes('text') -subFields: - - name: standardInputProperties - type: object - meta: - widget: containerLessObject - subFields: !include standardInputProperties.yml - - - name: textArea - type: boolean - meta: - label: - de: Großes Textfeld - en: Large text field - containerProps: - layout: - size: - default: "col-4" - small: "col-6" - large: "col-4" - - - name: emailValidation - type: boolean - meta: - label: - de: E-Mail-Validierung - en: E-mail validation - containerProps: - layout: - size: - default: "col-4" - small: "col-6" - large: "col-4" - - - name: telValidation - type: boolean - meta: - label: - de: Telefon-Validierung - en: Phone validation - containerProps: - layout: - size: - default: "col-4" - small: "col-6" - large: "col-4" diff --git a/api/collections/fieldLists/formular/timeSelect.yml b/api/collections/fieldLists/formular/timeSelect.yml deleted file mode 100644 index 06b2035..0000000 --- a/api/collections/fieldLists/formular/timeSelect.yml +++ /dev/null @@ -1,45 +0,0 @@ -name: timeSelect -type: object -meta: - label: Zeitenwahl - dependsOn: - eval: $parent?.inputWidgets?.includes('timeSelect') -subFields: - - name: standardInputProperties - type: object - meta: - widget: containerLessObject - subFields: !include standardInputProperties.yml - - - name: selectEntries - type: object[] - meta: - label: Auswahleingabe - widget: containerLessObjectArray - helperText: "Die Angaben werden in folgendes Übersetzt: Anfangspunkt - Endpunkt" - direction: horizontal - - subFields: - - name: leftSide - type: string - meta: - label: Anfangspunkt - helperText: Bspw. 14:30 - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: rightSide - type: string - meta: - label: Endpunkt - helperText: Bspw. 15:30 - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" diff --git a/api/collections/fieldLists/formular/timesInput.yml b/api/collections/fieldLists/formular/timesInput.yml deleted file mode 100644 index 6d8aef8..0000000 --- a/api/collections/fieldLists/formular/timesInput.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: timesInput -type: object -meta: - label: - de: Zeitenauswahlfeld - en: Time input - dependsOn: - eval: $parent?.inputWidgets?.includes('times') - helperText: - de: Selectfeld mit von - bis Angabe - en: Select field with from - to specification - -subFields: - - name: times - type: object[] - meta: - label: - de: Zeitenauswahl Möglichkeiten - en: Time selection options - helperText: - de: "Die Angaben werden in folgendes Übersetzt: Anfangspunkt - Endpunkt" - en: "The information is translated into the following: starting point - end point" - direction: horizontal - widget: containerLessObjectArray - - subFields: - - name: from - type: string - meta: - label: - de: Anfangspunkt - en: Starting point - helperText: - de: Bspw. 14:30 - en: E.g. 14:30 - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: to - type: string - meta: - label: Endpunkt - helperText: - de: Bspw. 15:30 - en: E.g. 15:30 - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: standardInputProperties - type: object - meta: - widget: containerLessObject - subFields: !include standardInputProperties.yml diff --git a/api/collections/fieldLists/orderViews.yml b/api/collections/fieldLists/orderViews.yml deleted file mode 100644 index 0c5ed79..0000000 --- a/api/collections/fieldLists/orderViews.yml +++ /dev/null @@ -1,12 +0,0 @@ -- type: table - columns: - - source: status - filter: true - - source: customerTibiId - filter: - type: foreignKey - - source: insertTime - filter: true - - source: products.tibiId - filter: - type: foreignKey diff --git a/api/collections/helpcenterChapter.yml b/api/collections/helpcenterChapter.yml deleted file mode 100644 index f9d9bfe..0000000 --- a/api/collections/helpcenterChapter.yml +++ /dev/null @@ -1,143 +0,0 @@ -name: helpCenterChapter - -# Metaangaben zur Kollektion welche in der Admin-UI verwendet werden können -meta: - openapi: - disabled: true - # Navigationseintrag in der Admin-UI - label: - de: Helpcenter Kapitel - en: Helpcenter Chapter - backup: - active: true - collectionName: backups - # Icon (Material UI) für den Navigationseintrag - muiIcon: web - - tablist: - activeTab: general - tabs: - - name: general - label: - de: Allgemein - en: General - subFields: - - source: title - - source: slug - - source: brightIcon - - source: darkIcon - - name: questions - label: - de: Fragen - en: Questions - subFields: - - source: questions - views: - # Desktop - - type: table - mediaQuery: "(min-width:600px)" - columns: - - source: title - name: Titel - filter: true - - source: slug - name: Slug - filter: true - -permissions: - public: - methods: - get: true - post: false - put: false - delete: false - - user: - methods: - get: true - post: true - put: true - delete: true - -# Feldliste der Kollektion -fields: - - name: title - type: string - meta: - label: - de: Titel - en: Title - - name: slug - type: string - meta: - label: - de: Slug - en: Slug - - name: brightIcon - type: string - meta: - label: - de: Icon Hell - en: Icon Bright - widget: foreignKey - foreign: - collection: medialib - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: darkIcon - type: string - meta: - label: - de: Icon Dunkel - en: Icon Dark - widget: foreignKey - foreign: - collection: medialib - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: questions - type: object[] - meta: - label: - de: Fragen - en: Questions - widget: containerLessObjectArray - subFields: - - name: priority - type: boolean - meta: - label: - de: Priorität - en: Priority - helperText: - de: ob sie direkt ganz oben angezeigt werden soll - en: if it should be displayed directly at the top - - name: page - type: string - meta: - label: - de: Seite - en: Page - widget: foreignKey - foreign: - collection: content - id: path - subNavigation: 0 - render: - defaultCollectionViews: true diff --git a/api/collections/login.yml b/api/collections/login.yml deleted file mode 100644 index f4d4a1f..0000000 --- a/api/collections/login.yml +++ /dev/null @@ -1,61 +0,0 @@ -# no data in collection, only for post hook -name: login -uploadPath: ../media/login - -# Metaangaben zur Kollektion welche in der Admin-UI verwendet werden können -meta: - openapi: - disabled: true - hideInNavigation: true - # Navigationseintrag in der Admin-UI - label: { de: "Login", en: "Login" } - # Icon (Material UI) für den Navigationseintrag - muiIcon: web - # Identifizierung eines Eintrags für z.B. Select-Boxen in der Admin-UI - rowIdentTpl: { twig: "{{ id }}" } - # Standardsortierung der Liste - defaultSort: { field: "id", order: "ASC" } - # Admin-Backend Ansichten - defaultImageFilter: s - views: - # Mobile Darstellung - - type: simpleList - mediaQuery: "(max-width:599px)" - primaryText: id - - # Desktop - - type: table - mediaQuery: "(min-width:600px)" - columns: - - id - -# Zugriff auf diese Kollektion -permissions: - # öffentlicher Zugriff - public: - methods: - # Liste und Einzeleinträge lesen - get: false - # neuen Eintrag anlegen - post: true - # Eintrag editieren - put: false - # Eintrag löschen - delete: false - # zum Projekt zugeordneter Benutzer ohne Zusatzberechtigungen - user: - methods: - get: true - post: true - put: true - delete: true - -hooks: - post: - # check and return jwt - create: - type: javascript - file: hooks/login/post_create.js - -# Feldliste der Kollektion -fields: [] diff --git a/api/collections/lookCombination.yml b/api/collections/lookCombination.yml deleted file mode 100644 index 3caf94e..0000000 --- a/api/collections/lookCombination.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: lookCombination -meta: - allowExportAll: true - label: - de: Styling Kombinationen - en: Look Combination - muiIcon: label - views: [] - -permissions: - public: - methods: - get: true - post: false - put: false - delete: false - user: - methods: - get: true - post: true - put: true - delete: true - -fields: [] diff --git a/api/collections/productBackgroundImage.yml b/api/collections/productBackgroundImage.yml deleted file mode 100644 index 5f9db15..0000000 --- a/api/collections/productBackgroundImage.yml +++ /dev/null @@ -1,75 +0,0 @@ -name: productBackgroundImage - -meta: - allowExportAll: true - label: - de: Produkt Bg. - en: Product Bg. - muiIcon: label - - defaultSort: - field: name - order: ASC - - views: &views - - type: table - columns: - - source: type - filter: true - - source: image - filter: - type: foreignKey - -permissions: - public: - methods: - get: true - post: false - put: false - delete: false - user: - methods: - get: true - post: true - put: true - delete: true - -fields: - - name: type - type: string - meta: - label: - de: Typ - en: Type - widget: select - choices: - - id: standard - label: - de: Standard - en: Standard - - - id: dark - label: - de: Dunkel - en: Dark - - name: image - type: string - meta: - label: - de: Tibi ID - en: Tibi ID - widget: foreignKey - foreign: - collection: medialib - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - filter: - type: foreignKey - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" diff --git a/api/collections/productBenefit.yml b/api/collections/productBenefit.yml deleted file mode 100644 index 19c646e..0000000 --- a/api/collections/productBenefit.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: productBenefit - -meta: - allowExportAll: true - label: - de: Product Vorteile - en: Product Benefits - muiIcon: label - - defaultSort: - field: name - order: ASC - - views: &views - - type: table - columns: - - source: title - label: - de: Titel - en: Title - - source: description - label: - de: Beschreibung - en: Description - -permissions: - public: - methods: - get: true - post: false - put: false - delete: false - user: - methods: - get: true - post: true - put: true - delete: true - -fields: - - name: title - type: string - meta: - label: - de: Titel - en: Title - - - name: description - type: string - meta: - widget: richtext - label: - de: Beschreibung - en: Description diff --git a/api/collections/rating.yml b/api/collections/rating.yml deleted file mode 100644 index 07d07f0..0000000 --- a/api/collections/rating.yml +++ /dev/null @@ -1,301 +0,0 @@ -name: rating - -meta: - label: { de: "Bewertungen", en: "Ratings" } - muiIcon: reviews - views: &views - - type: simpleList - mediaQuery: "max-width: 600px" - - type: table - columns: - - source: bigCommerceProductId - filter: - type: foreignKey - - - source: bigcommerceOrderId - filter: - type: foreignKey - - - source: rating.overall - filter: true - - - source: status - filter: true - - tablist: - activeTab: generalDetails - tabs: - - name: generalDetails - label: - de: Allgemeine Details - en: General Details - subFields: - - source: bigCommerceProductId - - source: bigcommerceOrderId - - source: status - - source: review_date - - source: bigcommerceReviewId - - - name: rating - label: - de: Bewertung - en: Rating - subFields: - - source: rating - - source: comment - - source: title - - subNavigation: - - name: modal - views: *views - - defaultCallback: # Standard-Callback-Funktion, die ausgeführt wird, wenn keine andere spezifiziert ist. - eval: | # Der Code wird als JavaScript evaluiert. - //js - (entry) => { // Diese Funktion nimmt den Eintrag (entry) als Argument. - parent.selectEntry(entry) // Die Funktion selectEntry auf dem übergeordneten Objekt wird mit dem Eintrag als Argument aufgerufen. - } - //!js -permissions: - public: - methods: - get: true - post: true - put: true - delete: false - user: - methods: - get: true - post: true - put: true - delete: false - -hooks: - delete: - delete: - type: javascript - file: hooks/rating/delete_delete.js - - return: - type: javascript - file: hooks/rating/delete_return.js - get: - read: - type: javascript - file: hooks/rating/get_read.js - - post: - validate: - type: javascript - file: hooks/rating/post_validate.js - create: - type: javascript - file: hooks/rating/post_create.js - - return: - file: hooks/rating/post_return.js - type: javascript - - put: - validate: - type: javascript - file: hooks/rating/put_validate.js - update: - type: javascript - file: hooks/rating/put_update.js - return: - file: hooks/rating/put_return.js - type: javascript - -fields: - - name: bigcommerceOrderId - type: number - index: [single] - meta: - filter: - type: foreignKey - label: { de: "Interne Bestellnummer", en: "Internal Order Id" } - widget: foreignKey - foreign: - collection: bigCommerceOrder - subNavigation: 0 - id: bigCommerceId - render: - defaultCollectionViews: true - - validator: - required: true - - - name: bigCommerceProductId - index: [single] - type: number - meta: - filter: - type: foreignKey - label: { de: "Produkt", en: "Product" } - widget: foreignKey - foreign: - collection: bigCommerceProduct - subNavigation: 0 - id: bigCommerceId - render: - defaultCollectionViews: true - - validator: - required: true - - - name: rating - index: [single] - type: object - meta: - widget: containerLessObject - label: { de: "Bewertung", en: "Rating" } - - subFields: - - name: quality - type: number - meta: - label: { de: "Qualität", en: "Quality" } - helperText: { de: "1 - Schlecht; 5 - Sehr Gut", en: "1 - Bad; 5 - Very Good" } - validator: - eval: | - (function () { - return $this >= 0 && $this <= 5; - })() - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-4" - - - name: priceQualityRatio - type: number - meta: - label: { de: "Preis-Leistungs-Verhältnis", en: "Price-Quality Ratio" } - helperText: { de: "1 - Schlecht; 5 - Sehr Gut", en: "1 - Bad; 5 - Very Good" } - validator: - eval: | - (function () { - return $this >= 0 && $this <= 5; - })() - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-4" - - - name: comfort - type: number - meta: - label: { de: "Komfort", en: "Comfort" } - helperText: { de: "1 - Unbequem; 5 - Sehr Bequem", en: "1 - Uncomfortable; 5 - Very Comfortable" } - validator: - eval: | - (function () { - return $this >= 0 && $this <= 5; - })() - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-4" - - - name: overall - type: number - meta: - label: { de: "Gesamt", en: "Overall" } - helperText: { de: "1 - Schlecht; 5 - Sehr Gut", en: "1 - Bad; 5 - Very Good" } - validator: - eval: | - (function () { - return $this >= 0 && $this <= 5; - })() - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-4" - - - name: comment - type: string - meta: - label: { de: "Kommentar", en: "Comment" } - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - inputProps: - multiline: true - - - name: title - type: string - meta: - label: { de: "Titel", en: "title" } - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - inputProps: - multiline: true - - - name: review_date - type: date - validator: - eval: | - (function () { - return (new Date($this) !== "Invalid Date") && !isNaN(new Date($this)); - })() - meta: - label: { de: "Erstellungsdatum", en: "Creation date" } - defaultValue: - eval: new Date() - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: status - type: string - index: [single] - validator: - eval: (["pending", "approved", "rejected"].includes($this)) - meta: - label: Status - widget: "select" - defaultValue: pending - choices: - - name: { de: wartend, en: pending } - id: pending - - name: { de: bestätigt, en: approved } - id: approved - - name: { de: abgelehnt, en: rejected } - id: rejected - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: bigcommerceReviewId - type: string - meta: - label: - de: "BigCommerce Review Id" - en: "BigCommerce Review Id" - helperText: - de: "Die ID der Bewertung in BigCommerce" - en: "The ID of the review in BigCommerce" -indexes: - - name: fulltext # Ein eindeutiger Name für den Index. Es ist optional, wird jedoch empfohlen, um den Index später leicht identifizieren zu können. - key: # Bestimmt, auf welche Felder der Index angewendet werden soll. Dies kann ein einfacher String sein, wenn der Index nur ein Feld umfasst, oder ein Array von Strings, wenn der Index mehrere Felder umfasst. - - $text:$** diff --git a/api/collections/selfImprovementChapter.yml b/api/collections/selfImprovementChapter.yml deleted file mode 100644 index 846473b..0000000 --- a/api/collections/selfImprovementChapter.yml +++ /dev/null @@ -1,196 +0,0 @@ -name: selfImprovementChapter - -meta: - allowExportAll: true - label: - de: SelfImp. Kapitel - en: SelfImp. Chapter - muiIcon: label - backup: - active: true - collectionName: backups - defaultSort: - field: name - order: ASC - - views: &views - - type: table - columns: - - source: title - label: - de: Titel - en: Title - filter: true - - source: shortDescription - label: - de: Kurzbeschreibung - en: Short Description - filter: true - tabs: - activeTab: generalDetails - tabs: - - name: generalDetails - label: - de: Allgemeine Details - en: General Details - subFields: - - source: title - - source: alias - - source: previewVideo - - source: previewImage - - source: locked - - - name: homepage - label: - de: Homepage - en: Homepage - subFields: - - source: shortDescription - - source: description - - subNavigation: - - name: modalForeign - defaultSort: - field: name - order: ASC - views: *views - - defaultCallback: - eval: | - (entry) => { - parent.selectEntry(entry) - } - -permissions: - public: - methods: - get: true - post: false - put: false - delete: false - user: - methods: - get: true - post: true - put: true - delete: true - -fields: - - name: type - type: number - meta: - label: - de: Typ - en: Type - widget: select - choices: - - name: Krass Kraft - id: 1 - - name: Crazy Calm - id: 2 - - name: Crazy Crave Control - id: 3 - - name: Krass Kreativ - id: 4 - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - name: title - type: string - meta: - label: - de: Titel - en: Title - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: alias - type: string - meta: - label: - de: Alias - en: Alias - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: shortDescription - type: string - meta: - label: - de: Kurze Beschreibung - en: Short Description - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: description - type: string - meta: - widget: richtext - label: - de: Beschreibung - en: Description - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" - - - name: previewVideo - type: string - meta: - label: - de: Vorschau Video - en: Preview Video - widget: foreignKey - foreign: - collection: medialib - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - - - name: previewImage - type: string - meta: - label: - de: Vorschau Bild - en: Preview Image - widget: foreignKey - foreign: - collection: medialib - id: id - subNavigation: 0 - render: - defaultCollectionViews: true - - - name: locked - type: boolean - meta: - label: - de: Gesperrt - en: Locked - helperText: - de: Wenn gesperrt, kann das Kapitel nicht geöffnet werden. - en: If locked, the chapter cannot be opened. - containerProps: - layout: - size: - default: "col-6" - small: "col-12" - large: "col-6" diff --git a/api/collections/shopStatus.yml b/api/collections/shopStatus.yml deleted file mode 100644 index 8966fa6..0000000 --- a/api/collections/shopStatus.yml +++ /dev/null @@ -1,74 +0,0 @@ -name: shopStatus - -# Metaangaben zur Kollektion welche in der Admin-UI verwendet werden können -meta: - openapi: - disabled: true - # Navigationseintrag in der Admin-UI - backup: - active: true - collectionName: backups - label: - de: Shop Status - en: Shop Status - # Icon (Material UI) für den Navigationseintrag - muiIcon: web - views: - # Mobile Darstellung - - type: simpleList - mediaQuery: "(max-width:599px)" - primaryText: status - secondaryText: password - - # Desktop - - type: table - mediaQuery: "(min-width:600px)" - columns: - - source: status - label: - de: Status - en: Status - filter: true - - source: password - label: - de: Passwort - en: Password - filter: true - -permissions: - # öffentlicher Zugriff - public: - methods: - get: true - post: false - put: false - delete: false - - user: - methods: - get: true - post: true - put: true - delete: true - -# Feldliste der Kollektion -fields: - - name: status - type: string - meta: - label: - de: Status - en: Status - widget: select - choices: - - name: open - id: open - - - name: login - id: login - - name: password - type: string - meta: - label: - de: Passwort - en: Password diff --git a/api/collections/sizingDetails.yml b/api/collections/sizingDetails.yml deleted file mode 100644 index 2e07c6f..0000000 --- a/api/collections/sizingDetails.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: sizingDetails -meta: - allowExportAll: true - label: - de: Größen Details - en: Sizing Details - muiIcon: label - views: [] - -permissions: - public: - methods: - get: true - post: false - put: false - delete: false - user: - methods: - get: true - post: true - put: true - delete: true - -fields: [] diff --git a/api/collections/webhook.yml b/api/collections/webhook.yml deleted file mode 100644 index 0a87a12..0000000 --- a/api/collections/webhook.yml +++ /dev/null @@ -1,92 +0,0 @@ -######################################################################## -# Webhooks -######################################################################## - -name: webhook -meta: - openapi: - disabled: true - label: { de: "Webhooks", en: "webhooks" } - muiIcon: http - rowIdentTpl: { twig: "{{ insertTime }} - {{ type }}" } - views: - - type: simpleList - mediaQuery: "(max-width: 600px)" - primaryText: type - secondaryText: scope - - type: table - columns: - - type - - scope - - active - -permissions: - public: - methods: - get: false - post: true - put: false - delete: false - - user: - methods: - get: true - post: true - put: false - delete: false - - "token:${BIGCOMMERCE_WEBHOOK_TOKEN}": - methods: - get: true - post: true - put: false - delete: false - -hooks: - post: - create: - type: javascript - file: hooks/webhook/post_create.js - put: - update: - type: javascript - file: hooks/webhook/put_update.js - delete: - delete: - type: javascript - file: hooks/webhook/delete_delete.js - -fields: - - name: type - type: string - meta: - label: { de: "Typ", en: "Type" } - widget: select - choices: - - id: "bigCommerce" - name: "BigCommerce" - - id: "printful" - name: "Printful" - - name: scope - type: string - meta: - label: { de: "Scope", en: "Scope" } - helperText: - de: "The scope of the webhook, for example: store/product/*" - en: "The scope of the webhook, for example: store/product/*" - - name: active - type: boolean - meta: - label: { de: "Aktiv", en: "Active" } - helperText: - de: "Aktiviert oder deaktiviert den Webhook" - en: "Enables or disables the webhook" - - name: webhookId - type: number - meta: - label: { de: "Webhook ID", en: "Webhook ID" } - helperText: - de: "Die ID des Webhooks" - en: "The ID of the webhook" - inputProperties: - disabled: true diff --git a/api/collections/wishlistEntry.yml b/api/collections/wishlistEntry.yml deleted file mode 100644 index 3eeb1f0..0000000 --- a/api/collections/wishlistEntry.yml +++ /dev/null @@ -1,36 +0,0 @@ -######################################################################## -# cart -######################################################################## - -name: dummyWishlistEntryEndpoint -meta: - hideInNavigation: true - openapi: - disabled: true - -permissions: - public: - methods: - get: true - post: true - put: false - delete: false - - user: - methods: - get: false - post: false - put: false - delete: false - -hooks: - get: - read: - type: javascript - file: hooks/wishlist/get_read.js - post: - validate: - type: javascript - file: hooks/wishlist/post_create.js - -fields: diff --git a/api/config.yml b/api/config.yml index 05dcf5c..465c4e1 100644 --- a/api/config.yml +++ b/api/config.yml @@ -8,48 +8,29 @@ meta: dashboard: !include helper/dashboard.yml injectIntoHead: - # inject font faces (not possible in shadow dom for preview) - eval: | "" - eval: | "" - # Liste möglicher Berechtigungen, die Benutzern zugeordnet werden können permissions: - name: pages label: de: Seiten en: Pages + collections: - - !include collections/bigCommerceOrder.yml - - !include collections/OrderReturnRequest.yml - - !include collections/OrderRevokeRequest.yml - !include collections/contact.yml - - !include collections/rating.yml - - !include collections/bigCommerceProduct.yml - - !include collections/bigCommerceCustomer.yml - - !include collections/QRCode.yml - - !include collections/productBenefit.yml - !include collections/banner.yml - !include collections/content.yml - - !include collections/selfImprovementChapter.yml - - !include collections/Challenge.yml - !include collections/medialib.yml - !include collections/navigation.yml - - !include collections/sizingDetails.yml - - !include collections/lookCombination.yml - !include collections/tag.yml - !include collections/webhook.yml - - !include collections/login.yml - !include collections/action.yml - - !include collections/wishlistEntry.yml - !include collections/module.yml - - !include collections/helpcenterChapter.yml - - !include collections/shopStatus.yml - - !include collections/productBackgroundImage.yml - !include collections/ssr.yml - !include collections/lighthouseSubpath.yml - !include collections/lighthouse.yml - - !include collections/dummyCartEndpoint.yml - !include collections/backups.yml jobs: diff --git a/api/hooks/cart/get_read.js b/api/hooks/cart/get_read.js deleted file mode 100644 index 98417a2..0000000 --- a/api/hooks/cart/get_read.js +++ /dev/null @@ -1,46 +0,0 @@ -const { getCart, getRedirectUrl } = require("../lib/bigcommerceRestAPI") -const { bigcommerceStoreHash, bigcommerceBaseURL, bigCommerceCliendId, bigCommerceClientSecret } = require("../config") -const { getCustomerById, getLoginUrl } = require("../lib/bigcommerceRestAPI") -const { withAccount } = require("../lib/utils") -const { mapRestApiCartToGraphQL } = require("./helper") -;(function () { - if (context.user.auth()) return {} - const checkout = context.request().query("checkout") - const loggedInCheckout = context.request().query("loggedInCheckout") - if (checkout) { - if (loggedInCheckout) { - withAccount((loginClaims) => { - const cartId = context.request().param("id") - const cart = getCart(cartId) - const { checkoutURL } = getRedirectUrl(cartId) - const loginUrl = getLoginUrl( - loginClaims.bigCommerceId, - bigcommerceStoreHash, - bigcommerceBaseURL, - bigCommerceCliendId, - bigCommerceClientSecret, - checkoutURL.split(bigcommerceBaseURL).pop() - ) - throw { - status: 200, - data: cart && { - cart: mapRestApiCartToGraphQL(cart), - checkoutURL: loginUrl, - }, - } - }) - } - } - const cartId = context.request().param("id") - const cart = getCart(cartId) - const { checkoutURL, embeddedCheckoutURL } = getRedirectUrl(cartId) - - throw { - status: 200, - data: cart && { - cart: mapRestApiCartToGraphQL(cart), - checkoutURL: checkoutURL, - embeddedCheckoutURL: embeddedCheckoutURL, - }, - } -})() diff --git a/api/hooks/cart/helper.js b/api/hooks/cart/helper.js deleted file mode 100644 index 3c88f5f..0000000 --- a/api/hooks/cart/helper.js +++ /dev/null @@ -1,53 +0,0 @@ -/** - * - * @param {RestApiCart} cart - * @returns {BigCommerceCart} - */ - -function mapRestApiCartToGraphQL(cart) { - return { - entityId: cart.id, - currencyCode: cart.currency.code, - isTaxIncluded: cart.tax_included, - baseAmount: { value: cart.base_amount, currencyCode: cart.currency.code }, - discountedAmount: { value: cart.discount_amount, currencyCode: cart.currency.code }, - amount: { value: cart.cart_amount, currencyCode: cart.currency.code }, - discounts: cart.discounts.map((d) => ({ - entityId: d.id, - discountedAmount: { value: d.discounted_amount, currencyCode: cart.currency.code }, - })), - lineItems: { - physicalItems: cart.line_items.physical_items.map((item) => ({ - entityId: item.id, - parentEntityId: cart.parent_id, - productEntityId: item.product_id, - variantEntityId: item.variant_id, - sku: item.sku, - name: item.name, - url: item.url, - imageUrl: item.image_url, - brand: "BKDF", // REST API does not provide brand directly - quantity: item.quantity, - isTaxable: item.is_taxable, - listPrice: { value: item.list_price, currencyCode: cart.currency.code }, - extendedListPrice: { value: item.extended_list_price, currencyCode: cart.currency.code }, - selectedOptions: item?.options?.map((option) => ({ - // Map each option to the GraphQL format - // Assuming a simplified structure here for the example - })), - isShippingRequired: true, // Example assumption - })), - digitalItems: [], - customItems: [], - giftCertificates: [], - totalQuantity: cart.line_items.physical_items.reduce((total, item) => total + item.quantity, 0), - }, - createdAt: { utc: new Date(cart.created_time) }, - updatedAt: { utc: new Date(cart.updated_time) }, - locale: cart.locale, - } -} - -module.exports = { - mapRestApiCartToGraphQL, -} diff --git a/api/hooks/cart/post_validate.js b/api/hooks/cart/post_validate.js deleted file mode 100644 index 93d1c07..0000000 --- a/api/hooks/cart/post_validate.js +++ /dev/null @@ -1,25 +0,0 @@ -const { addCartItem, updateCartItem, deleteCartItem, getCart } = require("../lib/bigcommerceRestAPI") -const { postAddToCart } = require("../lib/facebookRestAPI") - -;(function () { - const operation = context?.data?.operation - - if (operation == "add") { - addCartItem(context?.data?.cartId, context?.data?.lineItems) - try { - postAddToCart() - } catch (e) {} - } else if (operation == "update") { - updateCartItem(context?.data?.cartId, context?.data?.lineItem, context?.data?.entityId) - try { - postAddToCart() - } catch (e) {} - } else if (operation == "delete") { - deleteCartItem(context?.data?.cartId, context?.data?.entityId) - } - - throw { - status: 200, - message: "success", - } -})() diff --git a/api/hooks/customer/get_read.js b/api/hooks/customer/get_read.js deleted file mode 100644 index 85a9c82..0000000 --- a/api/hooks/customer/get_read.js +++ /dev/null @@ -1,55 +0,0 @@ -const { getCustomerAddressById, getCustomerAddresses, getCustomerById } = require("../lib/bigcommerceRestAPI") -const { withAccount } = require("../lib/utils") -;(function () { - console.log("wtf") - if (context.user.auth()) return - const request = context.request() - const queryUsername = request.query("username") - if (queryUsername) { - const user = context.db.find("bigCommerceCustomer", { - filter: { username: queryUsername }, - })[0] - if (!user) { - throw { status: 404, error: "customer not found" } - } - throw { - data: { - id: user.id, - username: user.username, - socialMediaAccounts: user.socialMediaAccounts, - personalRecords: user.personalRecords, - }, - status: 200, - } - } - const foreign = request.query("foreign") - if (foreign) { - const id = request.param("id") - const user = context.db.find("bigCommerceCustomer", { - filter: { _id: id }, - })[0] - if (!user) { - throw { status: 404, error: "customer not found" } - } - throw { - data: { - id: user.id, - username: user.username, - socialMediaAccounts: user.socialMediaAccounts, - personalRecords: user.personalRecords, - }, - status: 200, - } - } - withAccount((loginClaims) => { - const queryAddressId = request.query("address") - const queryAddresses = request.query("addresses") - - if (queryAddressId) { - throw { data: getCustomerAddressById(loginClaims.bigCommerceId, Number(queryAddressId)), status: 200 } - } else if (queryAddresses) { - throw { data: getCustomerAddresses(loginClaims.bigCommerceId), status: 200 } - } else throw { data: getCustomerById(loginClaims.bigCommerceId), status: 200 } - }) - throw { status: 401, error: "unauthorized", log: false } -})() diff --git a/api/hooks/customer/post_create.js b/api/hooks/customer/post_create.js deleted file mode 100644 index e69de29..0000000 diff --git a/api/hooks/customer/put_update.js b/api/hooks/customer/put_update.js deleted file mode 100644 index ef6ab1d..0000000 --- a/api/hooks/customer/put_update.js +++ /dev/null @@ -1,250 +0,0 @@ -const { - updateCustomer, - updateCustomerAddressById, - deleteCustomerAddressById, - addCustomerAddress, - validateCredentials, - getCustomerById, -} = require("../lib/bigcommerceRestAPI") -const { withAccount } = require("../lib/utils") -const { getJwt } = require("../lib/utils") -const emailRegex = - /(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21\x23-\x5b\x5d-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])*")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\[(?:(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9]))\.){3}(?:(2(5[0-5]|[0-4][0-9])|1[0-9][0-9]|[1-9]?[0-9])|[a-z0-9-]*[a-z0-9]:(?:[\x01-\x08\x0b\x0c\x0e-\x1f\x21-\x5a\x53-\x7f]|\\[\x01-\x09\x0b\x0c\x0e-\x7f])+)\])/ -;(function () { - if (context.user.auth()) return - let data = context.data - const r = context.request() - const customerId = r.param("id") - - const backendAuth = context.user.auth() - - let returnCustomer = undefined - if (!backendAuth) { - // require authorization header with jwt - const token = getJwt(context) - /** @type {JWTPwResetClaims} */ // @ts-ignore - const pwResetClaims = token.claims - /** @type {Customer} */ // @ts-ignore - const customer = context.db.find("bigCommerceCustomer", { - filter: { _id: pwResetClaims.tibiId }, - })[0] - - if (!customer) { - throw { - status: 404, - error: "customer not found", - log: false, - } - } - - if (data.operation === "resetPassword") { - if (pwResetClaims && pwResetClaims.tibiId && pwResetClaims.check) { - // is password reset token since it has .check - if (pwResetClaims.tibiId != customerId) - throw { - status: 403, - error: "token not valid for this id", - log: false, - } - - if (pwResetClaims.check != customer.currentToken) - throw { - status: 403, - error: "password reset token expired", - log: false, - } - updateCustomer({ - authentication: { - force_password_reset: false, - new_password: data.password, - }, - id: Number(customer.bigCommerceId), - }) - - throw { - status: 200, - log: false, - } - } else { - throw { - status: 403, - error: "invalid token", - log: false, - } - } - } - withAccount((loginClaims) => { - /** @type {BigCommerceCustomer} */ - const customer = data.customer - if (customer) customer.id = Number(loginClaims.bigCommerceId) - if (data.operation === "updateCustomer") { - customer.email = loginClaims.email - const index = customer.form_fields.findIndex((f) => f.name === "username") - const internalCustomer = context.db.find("bigCommerceCustomer", { - filter: { email: customer.email }, - })[0] - if (index >= 0) customer.form_fields[index].value = internalCustomer.username - const response = updateCustomer(customer) - - throw { - status: 200, - data: response, - message: "customer updated", - log: false, - } - } else if (data.operation == "updateInternalCustomer") { - const customer = data.customer - returnCustomer = customer - } else if (data.operation === "updateCustomerAddress") { - /** @type {BigCommerceAddress} */ - const address = data.address - address.customer_id = Number(loginClaims.bigCommerceId) - const response = updateCustomerAddressById(address) - throw { - status: 200, - message: "customer addresses updated", - data: response, - log: false, - } - } else if (data.operation === "deleteCustomerAddress") { - deleteCustomerAddressById(Number(loginClaims.bigCommerceId), data.addressId) - throw { - status: 200, - message: "customer address deleted", - data: { - success: true, - }, - log: false, - } - } else if (data.operation === "addCustomerAddress") { - /** @type {BigCommerceAddress} */ - const address = data.address - address.customer_id = Number(loginClaims.bigCommerceId) - delete address.id - const response = addCustomerAddress(address) - throw { - status: 200, - message: "customer addresses updated", - data: response, - log: false, - } - } else if (data.operation === "changePassword") { - const res = validateCredentials(loginClaims.email, data.currentPassword) - if (!res.is_valid) { - throw { - status: 403, - error: "current password incorrect", - log: false, - } - } - const resPw = updateCustomer({ - authentication: { - force_password_reset: false, - new_password: data.newPassword, - }, - id: Number(loginClaims.bigCommerceId), - }) - throw { - status: 200, - message: "password reset successful", - log: false, - } - } else if (data.operation === "updateEmail") { - const resValidation = validateCredentials(loginClaims.email, data.password) - if (!resValidation.is_valid) { - throw { - status: 403, - error: "password incorrect", - log: false, - } - } - if (!data.email) - throw { - status: 400, - error: "email is required", - log: false, - } - data.email = data.email.toLowerCase() - const customers = context.db.find("bigCommerceCustomer", { - filter: { email: data.email }, - }) - if (customers.length > 0) - throw { - status: 409, - error: "email already in use", - log: false, - } - if (emailRegex.test(data.email) === false) { - throw { - status: 400, - error: "invalid email", - log: false, - } - } - const res = updateCustomer({ id: Number(loginClaims.bigCommerceId), email: data.email }) - context.db.update("bigCommerceCustomer", loginClaims.tibiId, { email: data.email }) - throw { - status: 200, - message: "customer updated", - data: res, - log: false, - } - } else if (data.operation === "updateUsername") { - const resValidation = validateCredentials(loginClaims.email, data.password) - if (!resValidation.is_valid) { - throw { - status: 403, - error: "password incorrect", - log: false, - } - } - /**@type {string} */ - let username = data.username - if (!username) - throw { - status: 400, - error: "username is required", - log: false, - } - username = username.toLowerCase() - - const userWithUsername = context.db.find("bigCommerceCustomer", { - filter: { username: username }, - })[0] - if (userWithUsername) - throw { - status: 409, - message: "username already in use", - } - const internalCustomer = context.db.find("bigCommerceCustomer", { - filter: { email: loginClaims.email }, - })[0] - internalCustomer.username = username - if (internalCustomer) { - context.db.update("bigCommerceCustomer", internalCustomer.id, internalCustomer) - } - - //update bigcommerce customer too : get it and then update it with username swapped - const bCCustomer = getCustomerById(loginClaims.bigCommerceId) - if (!bCCustomer.form_fields) bCCustomer.form_fields = [] - const usernameIndex = bCCustomer.form_fields.findIndex((f) => f.name === "username") - if (usernameIndex >= 0) bCCustomer.form_fields[usernameIndex].value = username - else bCCustomer.form_fields = [...bCCustomer.form_fields, { name: "username", value: username }] - updateCustomer(bCCustomer) - - throw { - status: 200, - message: "customer updated", - data: internalCustomer, - log: false, - } - } - }) - } - if (returnCustomer) { - return { - data: returnCustomer, - } - } - throw { status: 401, error: "unauthorized", log: false } -})() diff --git a/api/hooks/order/get_read.js b/api/hooks/order/get_read.js deleted file mode 100644 index 4272dee..0000000 --- a/api/hooks/order/get_read.js +++ /dev/null @@ -1,56 +0,0 @@ -const { getOrderById, getOrdersForCustomer, createInternalOrderObject } = require("../lib/bigcommerceRestAPI") -const { withAccount } = require("../lib/utils") - -;(function () { - if (context.user.auth()) return {} - withAccount((login) => { - const orderId = context.request().param("id") - if (orderId) { - /** @type {Order} */ - // @ts-ignore - const internalOrder = context.db.find("bigCommerceOrder", { - filter: { _id: orderId }, - })[0] - if (internalOrder.customerTibiId !== login.tibiId) { - if (String(internalOrder?.customerBigCommerceId) !== String(login?.bigCommerceId)) { - throw { - message: "You don't have permission to access this order", - code: 403, - } - } else { - context.db.update("bigCommerceOrder", internalOrder.id, { - customerTibiId: login.tibiId, - }) - } - } - const order = getOrderById(internalOrder.bigCommerceId) - order.tibiId = internalOrder.id - order.status = internalOrder.status - order.shipments = internalOrder.shipments - order.statusSetAt = internalOrder.statusSetAt - throw { - data: order, - status: 200, - } - } else { - const orders = getOrdersForCustomer(login.bigCommerceId) - orders.forEach((order) => { - let internalOrder = context.db.find("bigCommerceOrder", { - filter: { bigCommerceId: order.id }, - })[0] - if (!internalOrder && order.id) { - const internalOrderReference = createInternalOrderObject(order.id) - internalOrder = context.db.create("bigCommerceOrder", internalOrderReference) - } else if (!internalOrder) return - order.tibiId = internalOrder?.id - order.status = internalOrder?.status - order.shipments = internalOrder?.shipments - order.statusSetAt = internalOrder?.statusSetAt - }) - throw { - data: orders, - status: 200, - } - } - }) -})() diff --git a/api/hooks/order/put_update.js b/api/hooks/order/put_update.js deleted file mode 100644 index c3a018b..0000000 --- a/api/hooks/order/put_update.js +++ /dev/null @@ -1,5 +0,0 @@ -import { withAccount } from "../lib/utils" -;(function () { - if (context.user.auth()) return {} - withAccount((login) => {}) -}) diff --git a/api/hooks/orderReturnRequest/delete_delete.js b/api/hooks/orderReturnRequest/delete_delete.js deleted file mode 100644 index a59d14f..0000000 --- a/api/hooks/orderReturnRequest/delete_delete.js +++ /dev/null @@ -1,47 +0,0 @@ -const { withAccount } = require("../lib/utils") -;(function () { - withAccount((login) => { - const id = context.request().param("id") - if (!id) { - throw { - message: "id is required", - code: 400, - } - } - const existingReturnRequest = context.db.find("orderReturnRequest", { - filter: { - _id: id, - }, - })[0] - if (!existingReturnRequest) - throw { - message: "Return request not found", - code: 404, - } - const order = context.db.find("bigCommerceOrder", { - filter: { - bigCommerceId: Number(existingReturnRequest.bigCommerceId), - }, - })[0] - if (!order) - throw { - message: "Order not found", - code: 404, - } - - if (order.customerBigCommerceId !== login.bigCommerceId) - throw { - message: "You don't have permission to access this order", - code: 403, - } - if ( - existingReturnRequest.status !== "pending" && - existingReturnRequest.status !== "approved" && - !!existingReturnRequest.status - ) - throw { - message: "Return request is not pending or approved", - code: 400, - } - }) -})() diff --git a/api/hooks/orderReturnRequest/delete_return.js b/api/hooks/orderReturnRequest/delete_return.js deleted file mode 100644 index 559a2c7..0000000 --- a/api/hooks/orderReturnRequest/delete_return.js +++ /dev/null @@ -1,33 +0,0 @@ -const { serverBaseURL, logoPath, operatorEmail, noReplyEmail, contactEmail } = require("../config") -const { frontendBase } = require("../config-client") -const { withAccount } = require("../lib/utils") -;(function () { - if (context.user.auth()) return - withAccount((login) => { - const store = { - logo: `${serverBaseURL}${logoPath}`, - frontendBase, - } - const html = context.tpl.execute(context.fs.readFile("templates/orderReturnRequestRevoked.html"), { - store, - }) - - context.smtp.sendMail({ - to: contactEmail, - from: noReplyEmail, - fromName: "BinKrassDuFass", - replyTo: noReplyEmail, - subject: "New Order Return Request Cancellation", - plain: `Die Bestellung von ${login.email} soll doch nicht zurückgegeben werden.`, - }) - - context.smtp.sendMail({ - to: login.email, - from: operatorEmail, - fromName: "BinKrassDuFass", - replyTo: noReplyEmail, - subject: "Widerruf deiner Bestellung abgebrochen", - html, - }) - }) -})() diff --git a/api/hooks/orderReturnRequest/get_read.js b/api/hooks/orderReturnRequest/get_read.js deleted file mode 100644 index f44581f..0000000 --- a/api/hooks/orderReturnRequest/get_read.js +++ /dev/null @@ -1,41 +0,0 @@ -const { withAccount } = require("../lib/utils") -;(function () { - const queryParam = context.request().query("orderId") - if (!queryParam) { - if (context.user.auth()) return - throw { - message: "orderId is required", - code: 400, - } - } - - withAccount((login) => { - const order = context.db.find("bigCommerceOrder", { - filter: { - bigCommerceId: Number(queryParam), - }, - })[0] - if (!order) { - throw { - message: "Order not found", - code: 404, - } - } - if (order.customerBigCommerceId !== login.bigCommerceId) { - console.log( - "order.customerBigCommerceId", - order.customerBigCommerceId, - "login.bigCommerceId", - login.bigCommerceId - ) - throw { - message: "You don't have permission to access this order", - code: 403, - } - } - context.filter = { - bigCommerceId: order.bigCommerceId, - } - }) - return context -})() diff --git a/api/hooks/orderReturnRequest/post_create.js b/api/hooks/orderReturnRequest/post_create.js deleted file mode 100644 index 1dd5475..0000000 --- a/api/hooks/orderReturnRequest/post_create.js +++ /dev/null @@ -1,81 +0,0 @@ -const { withAccount } = require("../lib/utils") -const { getOrderProductsById } = require("../lib/bigcommerceRestAPI") -;(function () { - if (context.user.auth()) return - withAccount((login) => { - const order = context.db.find("bigCommerceOrder", { - filter: { - bigCommerceId: Number(context.data.bigCommerceId), - }, - })[0] - if (!order) - throw { - message: "Order not found", - code: 404, - } - - if (order.customerBigCommerceId !== login.bigCommerceId) - throw { - message: "You don't have permission to access this order", - code: 403, - } - - const bigcommerceProducts = getOrderProductsById(context.data.bigCommerceId) - const returnRequestProducts = context.data.products - // make sure all ids are also in the orderproducts - returnRequestProducts.forEach((/** @type {OrderReturnRequestProduct} */ returnRequestProduct) => { - const bigcommerceProduct = bigcommerceProducts.find( - (bigcommerceProduct) => Number(bigcommerceProduct.id) === returnRequestProduct.productId - ) - if (!bigcommerceProduct) - throw { - message: "Product not found", - code: 404, - } - if (bigcommerceProduct.quantity < returnRequestProduct.quantity) - throw { - message: "Quantity exceeds the available quantity", - code: 400, - } - const existingReturnRequests = context.db.find("orderReturnRequest", { - filter: { - bigCommerceId: context.data.bigCommerceId, - $or: [ - { - status: "pending", - }, - { - status: "approved", - }, - { - status: "refunded", - }, - ], - }, - }) - returnRequestProduct.baseProductId = bigcommerceProduct.product_id - let totalExistingQuantity = 0 - existingReturnRequests.forEach((existingReturnRequest) => { - existingReturnRequest.products.forEach( - (/** @type {OrderReturnRequestProduct} */ existingReturnRequestProduct) => { - if (existingReturnRequestProduct.productId === returnRequestProduct.productId) { - totalExistingQuantity += existingReturnRequestProduct.quantity - } - } - ) - }) - if (totalExistingQuantity + returnRequestProduct.quantity > bigcommerceProduct.quantity) { - throw { - message: "Quantity exceeds the available quantity", - code: 400, - } - } - }) - context.data.products = context.data.products.filter( - (/** @type {OrderReturnRequestProduct} */ p) => p.quantity > 0 - ) - context.data.status = "pending" - context.data.email = login.email - }) - return context -})() diff --git a/api/hooks/orderReturnRequest/post_return.js b/api/hooks/orderReturnRequest/post_return.js deleted file mode 100644 index 48a366e..0000000 --- a/api/hooks/orderReturnRequest/post_return.js +++ /dev/null @@ -1,30 +0,0 @@ -const { serverBaseURL, logoPath, operatorEmail, noReplyEmail, contactEmail } = require("../config") -const { frontendBase } = require("../config-client") - -;(function () { - const store = { - logo: `${serverBaseURL}${logoPath}`, - frontendBase, - } - const html = context.tpl.execute(context.fs.readFile("templates/orderReturnRequestApproval.html"), { - store, - }) - - context.smtp.sendMail({ - to: contactEmail, - from: noReplyEmail, - fromName: "BinKrassDuFass", - replyTo: noReplyEmail, - subject: "New Order Return Request", - plain: `Die Bestellung von ${context.data.email} soll zurückgegeben werden.`, - }) - - context.smtp.sendMail({ - to: context.data.email, - from: operatorEmail, - fromName: "BinKrassDuFass", - replyTo: noReplyEmail, - subject: "Widerruf deiner Bestellung", - html, - }) -})() diff --git a/api/hooks/orderReturnRequest/put_update.js b/api/hooks/orderReturnRequest/put_update.js deleted file mode 100644 index 318b2ff..0000000 --- a/api/hooks/orderReturnRequest/put_update.js +++ /dev/null @@ -1,51 +0,0 @@ -const { logoPath, noReplyEmail, operatorEmail, serverBaseURL } = require("../config") -const { frontendBase } = require("../config-client") -const { getOrderById, updateOrderById } = require("../lib/bigcommerceRestAPI") -;(function () { - const oldOrderReturnRequest = context.db.find("orderReturnRequest", { - filter: { - _id: context.data.id, - }, - })[0] - if (!oldOrderReturnRequest) - throw { - message: "Order return request not found", - code: 404, - } - if (context.data.status == "approved") { - const bigCommerceOrder = getOrderById(context.data.bigCommerceId) - delete bigCommerceOrder.productObjs - delete bigCommerceOrder.shipping_addressObjs - bigCommerceOrder.status_id = 5 - updateOrderById(bigCommerceOrder.id, { status_id: 5 }) - } - if (oldOrderReturnRequest.status !== context.data.status) { - const oRR = context.data - const customer = context.db.find("bigCommerceCustomer", { - filter: { email: oRR.email }, - })[0] - - if (!customer) { - throw { - status: 404, - message: "Customer not found", - } - } - const store = { - logo: `${serverBaseURL}${logoPath}`, - frontendBase, - } - const html = context.tpl.execute(context.fs.readFile("templates/statusUpdateReturnRequest.html"), { - store, - }) - - context.smtp.sendMail({ - to: oRR.email, - from: operatorEmail, - fromName: "BinKrassDuFass", - replyTo: noReplyEmail, - subject: "Stornierung deiner Bestellung", - html, - }) - } -})() diff --git a/api/hooks/orderRevokeRequest/get_read.js b/api/hooks/orderRevokeRequest/get_read.js deleted file mode 100644 index 23f83a8..0000000 --- a/api/hooks/orderRevokeRequest/get_read.js +++ /dev/null @@ -1,35 +0,0 @@ -const { withAccount } = require("../lib/utils") -;(function () { - const queryParam = context.request().query("orderId") - if (!queryParam) { - if (context.user.auth()) return - throw { - message: "orderId is required", - code: 400, - } - } - - withAccount((login) => { - const order = context.db.find("bigCommerceOrder", { - filter: { - bigCommerceId: Number(queryParam), - }, - })[0] - if (!order) { - throw { - message: "Order not found", - code: 404, - } - } - if (order.customerBigCommerceId !== login.bigCommerceId) { - throw { - message: "You don't have permission to access this order", - code: 403, - } - } - context.filter = { - bigCommerceId: order.bigCommerceId, - } - }) - return context -})() diff --git a/api/hooks/orderRevokeRequest/post_create.js b/api/hooks/orderRevokeRequest/post_create.js deleted file mode 100644 index fb90105..0000000 --- a/api/hooks/orderRevokeRequest/post_create.js +++ /dev/null @@ -1,45 +0,0 @@ -const { withAccount } = require("../lib/utils") -const { getPrintfulOrder, cancelPrintfulOrder } = require("../lib/printfulRestAPI") -;(function () { - withAccount((login) => { - const order = context.db.find("bigCommerceOrder", { - filter: { - bigCommerceId: Number(context.data.bigCommerceId), - }, - })[0] - if (!order) - throw { - message: "Order not found", - code: 404, - } - - if (order.customerBigCommerceId !== login.bigCommerceId) - throw { - message: "You don't have permission to access this order", - code: 403, - } - const existingRevokeRequests = context.db.find("orderRevokeRequest", { - filter: { - bigCommerceId: context.data.bigCommerceId, - }, - }) - if (existingRevokeRequests.length > 0) - throw { - message: "Revoke request already exists", - code: 400, - } - if (!!order.status && order.status !== "draft") { - throw { - message: "Order is already in process", - code: 400, - } - } - const printfulOrder = getPrintfulOrder(order.bigCommerceId) - - cancelPrintfulOrder(context.data.bigCommerceId) - context.data.status = "pending" - context.data.email = login.email - context.data.printfulId = printfulOrder.id - }) - return context -})() diff --git a/api/hooks/orderRevokeRequest/post_return.js b/api/hooks/orderRevokeRequest/post_return.js deleted file mode 100644 index 4799c36..0000000 --- a/api/hooks/orderRevokeRequest/post_return.js +++ /dev/null @@ -1,36 +0,0 @@ -const { serverBaseURL, logoPath, operatorEmail, noReplyEmail, contactEmail } = require("../config") -const { frontendBase } = require("../config-client") -const { getOrderById, updateOrderById } = require("../lib/bigcommerceRestAPI") -;(function () { - if (context.user.auth()) return - const bigCommerceOrder = getOrderById(context.data.bigCommerceId) - delete bigCommerceOrder.productObjs - delete bigCommerceOrder.shipping_addressObjs - bigCommerceOrder.status_id = 5 - updateOrderById(bigCommerceOrder.id, { status_id: 5 }) - const store = { - logo: `${serverBaseURL}${logoPath}`, - frontendBase, - } - const html = context.tpl.execute(context.fs.readFile("templates/orderRevokedApproval.html"), { - store, - }) - - context.smtp.sendMail({ - to: contactEmail, - from: noReplyEmail, - fromName: "BinKrassDuFass", - replyTo: noReplyEmail, - subject: "New Order Revoke Request", - plain: `Die Bestellung von ${context.data.email} wurde abgebrochen.`, - }) - - context.smtp.sendMail({ - to: context.data.email, - from: operatorEmail, - fromName: "BinKrassDuFass", - replyTo: noReplyEmail, - subject: "Abbruch deiner Bestellung", - html, - }) -})() diff --git a/api/hooks/orderRevokeRequest/put_update.js b/api/hooks/orderRevokeRequest/put_update.js deleted file mode 100644 index 7767e21..0000000 --- a/api/hooks/orderRevokeRequest/put_update.js +++ /dev/null @@ -1,43 +0,0 @@ -import { logoPath, noReplyEmail, operatorEmail, serverBaseURL } from "../config" -import { frontendBase } from "../config-client" -;(function () { - const oldOrderReturnRequest = context.db.find("orderReturnRequest", { - filter: { - _id: context.data.id, - }, - })[0] - if (!oldOrderReturnRequest) - throw { - message: "Order return request not found", - code: 404, - } - if (oldOrderReturnRequest.status !== context.data.status) { - const oRR = context.data - const customer = context.db.find("bigCommerceCustomer", { - filter: { email: oRR.email }, - })[0] - - if (!customer) { - throw { - status: 404, - message: "Customer not found", - } - } - const store = { - logo: `${serverBaseURL}${logoPath}`, - frontendBase, - } - const html = context.tpl.execute(context.fs.readFile("templates/statusUpdateReturnRequest.html"), { - store, - }) - - context.smtp.sendMail({ - to: oRR.email, - from: operatorEmail, - fromName: "BinKrassDuFass", - replyTo: noReplyEmail, - subject: "Stornierung Ihrer Bestellung", - html, - }) - } -})() diff --git a/api/hooks/product/get_read.js b/api/hooks/product/get_read.js deleted file mode 100644 index 702740e..0000000 --- a/api/hooks/product/get_read.js +++ /dev/null @@ -1,23 +0,0 @@ -const { attachRatingObjsToProduct } = require("./helper") -;(function () { - if (context.user.auth()) return - const bigCommerceProductId = context.request().query("bigCommerceProductId") - if (bigCommerceProductId) { - /**@type {LocalProduct[]} */ - //@ts-ignore - let products = context.db.find("bigCommerceProduct", { - filter: { - bigCommerceId: Number(bigCommerceProductId), - }, - }) - products = attachRatingObjsToProduct(products) - - if (products.length > 0) { - throw { - status: 200, - data: products[0], - } - } - } - return -})() diff --git a/api/hooks/product/get_return.js b/api/hooks/product/get_return.js deleted file mode 100644 index 8abbc8b..0000000 --- a/api/hooks/product/get_return.js +++ /dev/null @@ -1,12 +0,0 @@ -const { attachRatingObjsToProduct } = require("./helper") -;(function () { - if (context.user.auth()) return - /**@type {LocalProduct[]} */ - //@ts-ignore - let products = context.results() - products = attachRatingObjsToProduct(products) - let hookResponse = { - results: products, - } - return hookResponse -})() diff --git a/api/hooks/product/helper.js b/api/hooks/product/helper.js deleted file mode 100644 index 4190532..0000000 --- a/api/hooks/product/helper.js +++ /dev/null @@ -1,26 +0,0 @@ -/** - * @param {LocalProduct[]} products - * @returns {LocalProduct[]} - */ -function attachRatingObjsToProduct(products) { - let productIds = products.map((product) => product.bigCommerceId) - /**@type {ProductRating[]} */ - //@ts-ignore - let allRatings = context.db.find("rating", { - filter: { - status: "approved", - bigCommerceProductId: { $in: productIds }, - }, - }) - - products.forEach((product, i) => { - let ratings = allRatings.filter((rating) => rating.bigCommerceProductId === product.bigCommerceId).reverse() - products[i].ratings = ratings - }) - - return products -} - -module.exports = { - attachRatingObjsToProduct, -} diff --git a/api/hooks/product/post_create.js b/api/hooks/product/post_create.js deleted file mode 100644 index e3c28b4..0000000 --- a/api/hooks/product/post_create.js +++ /dev/null @@ -1,36 +0,0 @@ -const { getAllProducts, getProductImages } = require("../lib/bigcommerceRestAPI") -const { extractSizingChart } = require("../lib/printfulRestAPI") -;(function () { - const products = getAllProducts() - const productIds = products.map((p) => p.id) - const currentProducts = context.db.find("bigCommerceProduct", { filter: { bigCommerceId: { $in: productIds } } }) - const notFoundProductIds = productIds.filter((id) => !currentProducts.some((p) => p.bigCommerceId == id)) - - const newProducts = products.filter((p) => notFoundProductIds.includes(p.id)) - newProducts.forEach((p) => { - const productImage = getProductImages(String(p.id)) - context.db.create("bigCommerceProduct", { - forcedWarning: "", - productName: p.name_customer || p.name, - previewImage: productImage?.[0]?.url_thumbnail, - bigCommerceId: p?.id, - sizingChart: null, - }) - }) - - currentProducts.forEach((p) => { - context.db.update("bigCommerceProduct", p.id, { - ...p, - productName: - products.find((bp) => bp.id == p.bigCommerceId).name_customer || - products.find((bp) => bp.id == p.bigCommerceId).name, - bigCommerceSKU: products.find((bp) => bp.id == p.bigCommerceId).sku, - bigCommerceId: products.find((bp) => bp.id == p.bigCommerceId).id, - sizingChart: extractSizingChart(p.printfulProductId, p.id), - }) - }) - throw { - status: 200, - message: "Products created or updated successfully", - } -})() diff --git a/api/hooks/product/put_update.js b/api/hooks/product/put_update.js deleted file mode 100644 index 40ae444..0000000 --- a/api/hooks/product/put_update.js +++ /dev/null @@ -1,13 +0,0 @@ -const { extractSizingChart } = require("../lib/printfulRestAPI") -let { clearSSRCache } = require("../lib/utils") - -;(function () { - clearSSRCache() - if (context.data.printfulProductId) { - const sizingChart = extractSizingChart(context.data.printfulProductId, context.data.id) - if (sizingChart) { - context.data.sizingChart = sizingChart - return { data: context.data } - } - } -})() diff --git a/api/hooks/rating/delete_delete.js b/api/hooks/rating/delete_delete.js deleted file mode 100644 index 1bae003..0000000 --- a/api/hooks/rating/delete_delete.js +++ /dev/null @@ -1,15 +0,0 @@ -;(function () { - const ratingId = context.request().param("id") - let rating = context.db.find("rating", { - filter: { - _id: ratingId, - }, - })[0] - if (!rating.id) - throw { - status: 400, - error: "No id specified.", - } - // @ts-ignore - context["rating"] = rating -})() diff --git a/api/hooks/rating/delete_return.js b/api/hooks/rating/delete_return.js deleted file mode 100644 index f94ef31..0000000 --- a/api/hooks/rating/delete_return.js +++ /dev/null @@ -1,7 +0,0 @@ -let { clearSSRCache } = require("../lib/utils") -let { deleteRating } = require("../lib/bigcommerceRestAPI") -;(function () { - clearSSRCache() - // @ts-ignore - deleteRating(context["rating"].bigCommerceProductId, context["rating"].bigcommerceReviewId) -})() diff --git a/api/hooks/rating/get_read.js b/api/hooks/rating/get_read.js deleted file mode 100644 index 4b56fe1..0000000 --- a/api/hooks/rating/get_read.js +++ /dev/null @@ -1,46 +0,0 @@ -// @ts-check -const { withAccount } = require("../lib/utils") -;(function () { - /** @type {HookResponse} */ - let hookResponse - let request = context.request() - if (context.user.auth()) return - const orderId = Number(request.query("orderId")) - if (orderId) { - withAccount((login) => { - let order = context.db.find("bigCommerceOrder", { - filter: { - bigCommerceId: orderId, - customerBigCommerceId: login.bigCommerceId, - }, - })[0] - if (!order) { - throw { - status: 404, - data: { - message: "Order not found", - }, - } - } - }) - hookResponse = { - filter: { - bigcommerceOrderId: orderId, - }, - } - - return hookResponse - } else { - hookResponse = { - filter: context.filter, - selector: { - bigCommerceProductId: 1, - rating: 1, - comment: 1, - title: 1, - review_date: 1, - }, - } - return hookResponse - } -})() diff --git a/api/hooks/rating/post_create.js b/api/hooks/rating/post_create.js deleted file mode 100644 index c7ae6ce..0000000 --- a/api/hooks/rating/post_create.js +++ /dev/null @@ -1,17 +0,0 @@ -const { productInsideOrder } = require("../lib/utils") - -;(function () { - if (!context?.user?.auth()?.id) { - if (!context.data) throw { status: 400, error: "No data provided" } - // @ts-ignore - productInsideOrder(context.data) - /** @type {ProductRating[]} */ // @ts-ignore - let ratings = context.db.find("rating", { - filter: { - bigcommerceOrderId: context?.data?.bigcommerceOrderId, - bigCommerceProductId: context?.data?.bigCommerceProductId, - }, - }) - if (ratings.length) throw { status: 400, error: "Rating already existing" } - } -})() diff --git a/api/hooks/rating/post_return.js b/api/hooks/rating/post_return.js deleted file mode 100644 index f3ae460..0000000 --- a/api/hooks/rating/post_return.js +++ /dev/null @@ -1,41 +0,0 @@ -const { bigcommerceApiOAuth, serverBaseURL, bigcommerceStoreHash } = require("../config.js") -let { sendOperatorRatingMail, clearSSRCache, statusIsValid } = require("../lib/utils") -;(function () { - const response = context.http.fetch( - `https://api.bigcommerce.com/stores/${bigcommerceStoreHash}/v3/catalog/products/${context?.data?.bigCommerceProductId}/reviews`, - { - method: "POST", - headers: { - "Content-Type": "application/json", - Accept: "application/json", - "X-Auth-Token": bigcommerceApiOAuth, - }, - body: JSON.stringify({ - title: context?.data?.title, - comment: context?.data?.comment, - status: - context?.data?.status === "approved" - ? "approved" - : context?.data?.status == "pending" - ? "pending" - : "disapproved", - rating: context?.data?.rating?.overall, - date_reviewed: context?.data?.review_date, - }), - } - ) - - if (!statusIsValid(response.status)) { - throw { - status: response.status, - error: response.statusText, - } - } - const bigcommerceRating = response.body.json() - context.db.update("rating", context?.data?.id || "", { - bigcommerceReviewId: String(bigcommerceRating?.data?.id), - }) - - clearSSRCache() - sendOperatorRatingMail() -})() diff --git a/api/hooks/rating/post_validate.js b/api/hooks/rating/post_validate.js deleted file mode 100644 index 8917c4c..0000000 --- a/api/hooks/rating/post_validate.js +++ /dev/null @@ -1,5 +0,0 @@ -let { validateAndModifyRating } = require("../lib/utils") -;(function () { - // @ts-ignore - return { data: validateAndModifyRating(context.data) } -})() diff --git a/api/hooks/rating/put_return.js b/api/hooks/rating/put_return.js deleted file mode 100644 index 7add362..0000000 --- a/api/hooks/rating/put_return.js +++ /dev/null @@ -1,42 +0,0 @@ -let { sendOperatorRatingMail, clearSSRCache, statusIsValid } = require("../lib/utils") -const { bigcommerceApiOAuth, bigcommerceStoreHash } = require("../config.js") -;(function () { - const response = context.http.fetch( - // @ts-ignore - `https://api.bigcommerce.com/stores/${bigcommerceStoreHash}/v3/catalog/products/${context?.data?.bigCommerceProductId}/reviews/${context["oldRating"]?.bigcommerceReviewId}`, - { - method: "PUT", - headers: { - "Content-Type": "application/json", - Accept: "application/json", - "X-Auth-Token": bigcommerceApiOAuth, - }, - body: JSON.stringify({ - title: context?.data?.title, - comment: context?.data?.comment, - status: - context?.data?.status === "approved" - ? "approved" - : context?.data?.status == "pending" - ? "pending" - : "disapproved", - rating: context?.data?.rating?.overall, - date_reviewed: context?.data?.review_date, - }), - } - ) - if (!statusIsValid(response.status)) { - throw { - status: response.status, - error: response.statusText, - } - } - let rating = context.data - // @ts-ignore - let oldRating = context["oldRating"] - // @ts-ignore - if (!oldRating || JSON.stringify(rating) != JSON.stringify(oldRating)) { - sendOperatorRatingMail() - clearSSRCache() - } -})() diff --git a/api/hooks/rating/put_update.js b/api/hooks/rating/put_update.js deleted file mode 100644 index 0600276..0000000 --- a/api/hooks/rating/put_update.js +++ /dev/null @@ -1,16 +0,0 @@ -const { productInsideOrder } = require("../lib/utils") - -;(function () { - if (!context?.user?.auth()?.id) { - // @ts-ignore - productInsideOrder(context?.data) - } - /** @type {ProductRating} */ // @ts-ignore - let ratingObj = context.db.find("rating", { - filter: { - _id: context?.data?.id, - }, - })[0] - // @ts-ignore - context["oldRating"] = ratingObj -})() diff --git a/api/hooks/rating/put_validate.js b/api/hooks/rating/put_validate.js deleted file mode 100644 index 8917c4c..0000000 --- a/api/hooks/rating/put_validate.js +++ /dev/null @@ -1,5 +0,0 @@ -let { validateAndModifyRating } = require("../lib/utils") -;(function () { - // @ts-ignore - return { data: validateAndModifyRating(context.data) } -})() diff --git a/chatgptpromps.md b/chatgptpromps.md deleted file mode 100644 index c5076f7..0000000 --- a/chatgptpromps.md +++ /dev/null @@ -1 +0,0 @@ -ich arbeite jetzt mit so nhm tool zusammen, was mir das figma als svelte + css ausspuckt, ziemlich redundant. Deine aufgabe ist in diesem chat, die sachen zu nehmen, das css ist less umzuwandeln und redundanzen aus dem less zu entfernen (keine neuen variablen machen!!) und im template mit loops etc arebbeiten sowie im script block halt arrays etc declaren... Schreib unbedingt immer alles aus, niemals iwi ... oder so machen, wenn nötig, auch über mehrere antworten lnag ziehen, ich wills copyn pasten können. Die seite bleibt nicht statisch, ich baue das dann selbst so um, dass die daten dynamisch gefatched werden, baue es so, dass ich da ein leichtes habe. Achte beim HTML vor allem auf ausgezeichnete semantik! Benutze weiterhin die variablen, die auch im bereitgestelltem skript gegeben sind, die sind alle verfügbar: \ No newline at end of file diff --git a/docker-compose-playwright.yml b/docker-compose-playwright.yml deleted file mode 100644 index 28a82e0..0000000 --- a/docker-compose-playwright.yml +++ /dev/null @@ -1,71 +0,0 @@ -version: "3.9" - -services: - maildev: - image: maildev/maildev - command: [node, bin/maildev, --web, "80", --smtp, "25", -v, --hide-extensions=STARTTLS] - expose: - - 1080 - - mongo: - image: mongo:4.2 - - tibi-server: - image: gitbase.de/cms/tibi-server - environment: - DB_DIAL: mongodb://mongo - API_PORT: 8080 - MAIL_HOST: maildev:25 - depends_on: - - maildev - - mongo - volumes: - - ./:/workdir - - liveserver: - image: node:20 - command: yarn run -- live-server --no-browser --port=80 --ignore='*' --entry-file=spa.html --no-css-inject --proxy=/api:http://tibi-server:8080/api/v1/_/einfo_test frontend - depends_on: - - tibi-server - volumes: - - ./:/workdir - working_dir: /workdir - - playwright: - image: mcr.microsoft.com/playwright:focal - environment: - FORCE_COLOR: "true" - PLAYWRIGHT_BASE_URL: http://liveserver - PLAYWRIGHT_CI: "true" - PLAYWRIGHT_mongodbUri: mongodb://mongo - PLAYWRIGHT_tibiApiUrl: http://tibi-server:8080/api/v1 - PLAYWRIGHT_projectApiConfig: /workdir/api/config.yml - DISPLAY: display:0 - PLAYWRIGHT_CACHE_FOLDER: /.cache/Playwright - command: sh ./scripts/py-command.docker.sh $PY_MODE $PY_SPECFLAG - depends_on: - - liveserver - volumes: - - ./:/workdir - - ./tmp/.npm:/.npm - - ./tmp/.cache:/.cache - - ./tmp/.yarn:/.yarn - working_dir: /workdir - - display: - image: ghcr.io/dtinth/xtigervnc-docker:main - tmpfs: /tmp - restart: always - environment: - VNC_GEOMETRY: 1920x1080 - - novnc: - image: geek1011/easy-novnc - restart: always - command: -a :5800 -h display --no-url-password - labels: - - traefik.enable=true - - traefik.http.services.${PROJECT_NAME}-playwright-novnc.loadbalancer.server.port=5800 - - online.testversion.code.subdomain=${PROJECT_NAME}-playwright-novnc - - traefik.http.routers.${PROJECT_NAME}-playwright-novnc.middlewares=${PROJECT_NAME}-playwright-novnc - - traefik.http.middlewares.${PROJECT_NAME}-playwright-novnc.basicauth.usersfile=${PWD}/.basic-auth-code diff --git a/frontend/src/App.svelte b/frontend/src/App.svelte index 9e6a21b..bce22d4 100644 --- a/frontend/src/App.svelte +++ b/frontend/src/App.svelte @@ -25,11 +25,7 @@ import { getWishlist } from "./lib/functions/CommerceAPIs/tibiEndpoints/wishlist" import PublicProfile from "./routes/PublicProfile.svelte" import { api, getDBEntries } from "./api" - import NewsletterRow from "./lib/components/pagebuilder/blocks/NewsletterRow.svelte" import HelpCenter from "./routes/HelpCenter.svelte" - import { checkIfStoreIsOpen } from "./lib/functions/CommerceAPIs/tibiEndpoints/store" - import Input from "./lib/components/pagebuilder/blocks/form/Input.svelte" - import { onChange } from "./lib/components/pagebuilder/profile/helper" import RedirectToPublicProfile from "./routes/RedirectToPublicProfile.svelte" import { onMount } from "svelte" import ActionApproval from "./lib/components/widgets/ActionApproval.svelte" @@ -54,7 +50,6 @@ if (l.push && oldPath != l.path) window.scrollTo(0, 0) oldPath = l.path }) - getWishlist().then(wishlist.set) api(`module`, { method: "GET", @@ -62,30 +57,6 @@ $modules = res.data }) - api("productBackgroundImage", { - method: "GET", - }).then((res) => { - res.data.forEach((element) => { - $backgroundImages[element.type] = element.image - }) - }) - - checkIfStoreIsOpen().then((status) => { - if ($shopStatus.loggedIn) return - if (!status || status.status === "open") { - shopStatus.set({ - status: "open", - loggedIn: true, - password: status?.password, - }) - } else { - shopStatus.set({ - status: "login", - loggedIn: false, - password: status.password, - }) - } - }) onMount(() => { const updateModalState = () => { $openModal = document.getElementsByClassName("dialog-open").length > 0 @@ -93,21 +64,13 @@ const interval = setInterval(updateModalState, 100) return () => clearInterval(interval) }) - let login = { - password: "", - } + let googleCookiesAllowed = false let googleCookieName = "googleAnalytics" - let metaPixelCookieName = "metaPixel" - let metaPixelCookiesAllowed = false - getDBEntries("selfImprovementChapter").then((res) => { - $selfImprovementChapters = res - }) if (typeof window !== "undefined") { window.addEventListener("ccAccept", (e) => { // @ts-ignore if (e.detail.includes(googleCookieName)) googleCookiesAllowed = true - if (e.detail.includes(metaPixelCookieName)) metaPixelCookiesAllowed = true }) function checkCookie(cookieName: string) { var allCookies = decodeURIComponent(document.cookie) @@ -124,7 +87,6 @@ return false } googleCookiesAllowed = checkCookie(googleCookieName) - metaPixelCookiesAllowed = checkCookie(metaPixelCookieName) } let innerWidth = 0 @@ -135,14 +97,7 @@ {#if googleCookiesAllowed} - - - - - - - - + - - - {/if}
- {#if $shopStatus.status === "open" || $shopStatus.loggedIn} {#if $location?.path?.toLowerCase().startsWith("/product/")} {#key $location?.path} @@ -235,40 +147,7 @@ {:else} {/if} - {:else} -
- - -
- {/if} +
diff --git a/frontend/src/api.ts b/frontend/src/api.ts index 3ef1cb0..a321bec 100644 --- a/frontend/src/api.ts +++ b/frontend/src/api.ts @@ -307,20 +307,6 @@ type EntryTypeSwitch = T extends "medialib" ? ContentEntry : T extends "navigation" ? NavigationEntry - : T extends "tag" - ? TagEntry - : T extends "dummyCartEndpoint" - ? DummyCartEndpoint - : T extends "productBenefit" - ? ProductBenefit - : T extends "selfImprovementChapter" - ? SelfImprovementChapter - : T extends "rating" - ? ProductRating - : T extends "bigCommerceProduct" - ? LocalProduct - : T extends "selfImprovementChallenge" - ? BKDFChallenge : never export async function getDBEntries( diff --git a/frontend/src/lib/components/Review.svelte b/frontend/src/lib/components/Review.svelte deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/src/lib/components/krasskraft/Blog.svelte b/frontend/src/lib/components/krasskraft/Blog.svelte deleted file mode 100644 index 1a23bc4..0000000 --- a/frontend/src/lib/components/krasskraft/Blog.svelte +++ /dev/null @@ -1,122 +0,0 @@ - - -
-
- crinkle - {#if entry} - - {/if} -
-
- -
- {#if entry} - {#each entry.blocks as block} - - {/each} - {/if} -
-
-

Quellen:

- -
-
-
-
- - diff --git a/frontend/src/lib/components/krasskraft/ChallengeDetailed.svelte b/frontend/src/lib/components/krasskraft/ChallengeDetailed.svelte deleted file mode 100644 index 2fd35d3..0000000 --- a/frontend/src/lib/components/krasskraft/ChallengeDetailed.svelte +++ /dev/null @@ -1,133 +0,0 @@ - - -
-
- {#if challenge} -

Weekly Challenge #{getCalendarWeekFromDate(challenge.activeAt)}

- -
- -
- -

{challenge.title}

- {/if} -
- - {#if activeTab == 0} -
- {#if challenge} - {#each challenge.introduction as intro} -

{@html intro}

- {/each} - {/if} -
- {#if challenge} -
- {challenge?.howItWorks?.invitation} -
- - {/if} - {:else if challenge} - - {/if} -
-
- - diff --git a/frontend/src/lib/components/krasskraft/ChallengePreview.svelte b/frontend/src/lib/components/krasskraft/ChallengePreview.svelte deleted file mode 100644 index 6d01208..0000000 --- a/frontend/src/lib/components/krasskraft/ChallengePreview.svelte +++ /dev/null @@ -1,70 +0,0 @@ - - -
  • - - - - -
  • - - diff --git a/frontend/src/lib/components/krasskraft/ChallengePreviewList.svelte b/frontend/src/lib/components/krasskraft/ChallengePreviewList.svelte deleted file mode 100644 index c0f2bcb..0000000 --- a/frontend/src/lib/components/krasskraft/ChallengePreviewList.svelte +++ /dev/null @@ -1,67 +0,0 @@ - - - - -
    -
      - {#each challenges as challenge} - - {/each} -
    -
    - - diff --git a/frontend/src/lib/components/krasskraft/ChallengesOverview.svelte b/frontend/src/lib/components/krasskraft/ChallengesOverview.svelte deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/src/lib/components/krasskraft/KrassKraftHomepage.svelte b/frontend/src/lib/components/krasskraft/KrassKraftHomepage.svelte deleted file mode 100644 index 7dcb58d..0000000 --- a/frontend/src/lib/components/krasskraft/KrassKraftHomepage.svelte +++ /dev/null @@ -1,99 +0,0 @@ - - -
    - -
    -
    -
    -
    -

    Challenges

    -
    - - -
    - -
    - - diff --git a/frontend/src/lib/components/pagebuilder/blocks/ChapterPreview/ChapterPreview.svelte b/frontend/src/lib/components/pagebuilder/blocks/ChapterPreview/ChapterPreview.svelte deleted file mode 100644 index ea31896..0000000 --- a/frontend/src/lib/components/pagebuilder/blocks/ChapterPreview/ChapterPreview.svelte +++ /dev/null @@ -1,105 +0,0 @@ - - -
    -
      - {#each $selfImprovementChapters as chapter, i} -
    • - -
    • - {/each} -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/blocks/ChapterPreview/Item.svelte b/frontend/src/lib/components/pagebuilder/blocks/ChapterPreview/Item.svelte deleted file mode 100644 index bdcd610..0000000 --- a/frontend/src/lib/components/pagebuilder/blocks/ChapterPreview/Item.svelte +++ /dev/null @@ -1,350 +0,0 @@ - - -
    - {#if chapter.locked} -
    - - - -

    Coming Soon

    -
    - {/if} -
    - - -
    -
    -
    -
    -
    -
    -
    -

    - {chapter.alias} -

    -

    - {chapter.title} -

    -

    - {chapter.shortDescription} -

    -
    -
    - -
    -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/blocks/RatingPreview/PreviewCard.svelte b/frontend/src/lib/components/pagebuilder/blocks/RatingPreview/PreviewCard.svelte deleted file mode 100644 index 0b57eca..0000000 --- a/frontend/src/lib/components/pagebuilder/blocks/RatingPreview/PreviewCard.svelte +++ /dev/null @@ -1,261 +0,0 @@ - - - - -{#if ratings.length} -
    -
      - {#each ratings as rating} -
    • -
      - - - -
      - {rating.title} - -
      -
      -

      - {rating.title} -

      -

      {rating.comment}

      -
      {formatDate(rating.review_date)}
      -
      -
      -
      -
      -
      - - - - {returnAvgForRating(rating)} -
      -
      -
      -
    • - {/each} -
    -
    -{/if} - - diff --git a/frontend/src/lib/components/pagebuilder/cart/CartProducts.svelte b/frontend/src/lib/components/pagebuilder/cart/CartProducts.svelte deleted file mode 100644 index 0be3082..0000000 --- a/frontend/src/lib/components/pagebuilder/cart/CartProducts.svelte +++ /dev/null @@ -1,70 +0,0 @@ - - -
      - {#each cart.lines as item, i (item?.id)} -
    • - - -
    • - {/each} -
    - - diff --git a/frontend/src/lib/components/pagebuilder/cart/OverlayCart.svelte b/frontend/src/lib/components/pagebuilder/cart/OverlayCart.svelte deleted file mode 100644 index 4cda8fa..0000000 --- a/frontend/src/lib/components/pagebuilder/cart/OverlayCart.svelte +++ /dev/null @@ -1,200 +0,0 @@ - - - - -{#if cart} -
    -
    - -
    -
    -
    - {#if Number(cart.cost.discountedAmount.amount) > 0} -
    -
    Rabatt
    -
    -{cart.cost.discountedAmount.amount} €
    -
    - {/if} - {#if Number(cart?.cost?.couponDiscount?.amount || 0) > 0} -
    -
    Rabatt Codes
    -
    -{cart.cost.couponDiscount.amount} €
    -
    - {/if} -
    -
    Versand
    -
    - {#if Number(cart.cost.amount.amount) >= minimumForFreeShipping} - Kostenfrei - {:else} - 5,00 € - {/if} -
    -
    -
    - Gesamt -
    - {( - Number(cart.cost.amount.amount) + - (Number(cart.cost.amount.amount) >= minimumForFreeShipping || shippingIncludedInTotal ? 0 : 5) - ).toFixed(2)} € -
    -
    - {#if cart.checkoutUrl} - - {/if} -
    -{:else if loading} - -{:else} -

    Keine Produkte im Warenkorb

    -{/if} - - diff --git a/frontend/src/lib/components/pagebuilder/cart/OverlayCartRecommendations.svelte b/frontend/src/lib/components/pagebuilder/cart/OverlayCartRecommendations.svelte deleted file mode 100644 index cafaef4..0000000 --- a/frontend/src/lib/components/pagebuilder/cart/OverlayCartRecommendations.svelte +++ /dev/null @@ -1,86 +0,0 @@ - - -{#if products.length > 0} -
    -
      - {#each products as product} - - {/each} -
    -
    -{/if} - - diff --git a/frontend/src/lib/components/pagebuilder/favorite/FavoriteListItems.svelte b/frontend/src/lib/components/pagebuilder/favorite/FavoriteListItems.svelte deleted file mode 100644 index cb6cb34..0000000 --- a/frontend/src/lib/components/pagebuilder/favorite/FavoriteListItems.svelte +++ /dev/null @@ -1,60 +0,0 @@ - - -{#key $wishlist?.items?.length} - {#if !$wishlist?.items?.length} -

    Keine Produkte in der Wunschliste

    - {:else} - {#await loadProducts()} - - {:then products} - {#if products.length == 0} -

    Keine Produkte in der Wunschliste

    - {:else} -
      - {#each products as product} -
    • - -
    • - {/each} -
    {/if} - {/await} - {/if} -{/key} - - diff --git a/frontend/src/lib/components/pagebuilder/favorite/OverlayFavoriteList.svelte b/frontend/src/lib/components/pagebuilder/favorite/OverlayFavoriteList.svelte deleted file mode 100644 index f8073d7..0000000 --- a/frontend/src/lib/components/pagebuilder/favorite/OverlayFavoriteList.svelte +++ /dev/null @@ -1,44 +0,0 @@ - - -
    - {#if $login} - - {:else} -

    Um deine Favoriten zu sehen, musst du eingeloggt sein.

    -
    -
    - {/if} -
    - - diff --git a/frontend/src/lib/components/pagebuilder/helpCenter/Chapter.svelte b/frontend/src/lib/components/pagebuilder/helpCenter/Chapter.svelte deleted file mode 100644 index ac9cc55..0000000 --- a/frontend/src/lib/components/pagebuilder/helpCenter/Chapter.svelte +++ /dev/null @@ -1,134 +0,0 @@ - - - -
    -
    -
    - -
    -
    -
    -

    {chapter.title}

    -
      - {#if loading} - - {:else if questions} - {#each questions as question, i} - {#if i < 3} -
    • - - {question.question} - -
    • - {/if} - {/each} - {:else} -

      Es wurden keine Fragen gefunden.

      - {/if} -
    - -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/helpCenter/ChapterDetailed.svelte b/frontend/src/lib/components/pagebuilder/helpCenter/ChapterDetailed.svelte deleted file mode 100644 index d265cd8..0000000 --- a/frontend/src/lib/components/pagebuilder/helpCenter/ChapterDetailed.svelte +++ /dev/null @@ -1,182 +0,0 @@ - - -
    - -
    - - {#if pathBefore == "/helpCenter" || pathBefore == "/helpCenter/"} -
      - {#if !Array.isArray(chapters)} - - {:else} - {#each chapters as chapter} - - {/each} - {/if} -
    - {:else} - - {/if} -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/helpCenter/ChapterQuestionDetailed.svelte b/frontend/src/lib/components/pagebuilder/helpCenter/ChapterQuestionDetailed.svelte deleted file mode 100644 index 91875df..0000000 --- a/frontend/src/lib/components/pagebuilder/helpCenter/ChapterQuestionDetailed.svelte +++ /dev/null @@ -1,51 +0,0 @@ - - -{#if loading} - -{:else if question} - -
    - {#each question.blocks || [] as block, idx} - - {/each} -
    -{:else} - -{/if} - - diff --git a/frontend/src/lib/components/pagebuilder/helpCenter/ChapterQuestionPreview.svelte b/frontend/src/lib/components/pagebuilder/helpCenter/ChapterQuestionPreview.svelte deleted file mode 100644 index 9219035..0000000 --- a/frontend/src/lib/components/pagebuilder/helpCenter/ChapterQuestionPreview.svelte +++ /dev/null @@ -1,47 +0,0 @@ - - -{#if location.path.includes(`/helpCenter/${chapter.slug}`)} - - {#if !Array.isArray(questions)} - - {:else} - {#each questions as question} -
  • - - {question.question} - - -
  • - {/each} - {/if} -{/if} diff --git a/frontend/src/lib/components/pagebuilder/product/ActionRow.svelte b/frontend/src/lib/components/pagebuilder/product/ActionRow.svelte deleted file mode 100644 index 153835c..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ActionRow.svelte +++ /dev/null @@ -1,89 +0,0 @@ - - -
    - - - -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/AddToCart.svelte b/frontend/src/lib/components/pagebuilder/product/AddToCart.svelte deleted file mode 100644 index 2d7c568..0000000 --- a/frontend/src/lib/components/pagebuilder/product/AddToCart.svelte +++ /dev/null @@ -1,37 +0,0 @@ - - - - - diff --git a/frontend/src/lib/components/pagebuilder/product/CompleteTheLook.svelte b/frontend/src/lib/components/pagebuilder/product/CompleteTheLook.svelte deleted file mode 100644 index d6bad62..0000000 --- a/frontend/src/lib/components/pagebuilder/product/CompleteTheLook.svelte +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/frontend/src/lib/components/pagebuilder/product/DynamicRows.svelte b/frontend/src/lib/components/pagebuilder/product/DynamicRows.svelte deleted file mode 100644 index da2b2e9..0000000 --- a/frontend/src/lib/components/pagebuilder/product/DynamicRows.svelte +++ /dev/null @@ -1,31 +0,0 @@ - - -
    - {#each contentEntries || [] as contentEntry} - {#each contentEntry.blocks || [] as block, idx} - - {/each} - {/each} -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/Filter.svelte b/frontend/src/lib/components/pagebuilder/product/Filter.svelte deleted file mode 100644 index c6bd068..0000000 --- a/frontend/src/lib/components/pagebuilder/product/Filter.svelte +++ /dev/null @@ -1,71 +0,0 @@ - - -{#if category} -
    - - {#each category.children as subcategory} - - {/each} -
    -{/if} - - diff --git a/frontend/src/lib/components/pagebuilder/product/Informations.svelte b/frontend/src/lib/components/pagebuilder/product/Informations.svelte deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/src/lib/components/pagebuilder/product/MagnifyableProductImage.svelte b/frontend/src/lib/components/pagebuilder/product/MagnifyableProductImage.svelte deleted file mode 100644 index 35212fa..0000000 --- a/frontend/src/lib/components/pagebuilder/product/MagnifyableProductImage.svelte +++ /dev/null @@ -1,141 +0,0 @@ - - -
    - -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/Options.svelte b/frontend/src/lib/components/pagebuilder/product/Options.svelte deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/src/lib/components/pagebuilder/product/ProductBenefitsSlider.svelte b/frontend/src/lib/components/pagebuilder/product/ProductBenefitsSlider.svelte deleted file mode 100644 index 7ac6232..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ProductBenefitsSlider.svelte +++ /dev/null @@ -1,92 +0,0 @@ - - - - -
    - {#each productBenefits as benefit, index} - - {/each} -
    - {#each productBenefits as _, index} -
    - {/each} -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/ProductColorPreviewList.svelte b/frontend/src/lib/components/pagebuilder/product/ProductColorPreviewList.svelte deleted file mode 100644 index 8c4c5d6..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ProductColorPreviewList.svelte +++ /dev/null @@ -1,101 +0,0 @@ - - -
      - {#each variants.map((v) => v.selectedOptions.find((o) => o.name === "Farbe").value) as value, i} -
    • - -
    • - {/each} -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/ProductConfigurator.svelte b/frontend/src/lib/components/pagebuilder/product/ProductConfigurator.svelte deleted file mode 100644 index 357c667..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ProductConfigurator.svelte +++ /dev/null @@ -1,165 +0,0 @@ - - - - -
    -
    - {#each optionTypes as { name }} - {#if name == "Farbe"} - - {:else if name == "Größe"} - - {/if} - {/each} -
    - - -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/ProductExtendableBoxes.svelte b/frontend/src/lib/components/pagebuilder/product/ProductExtendableBoxes.svelte deleted file mode 100644 index a70781e..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ProductExtendableBoxes.svelte +++ /dev/null @@ -1,202 +0,0 @@ - - -
    -
    -
    -

    Beschreibung

    -
    - diamond -
    -
    -
    - {@html product.descriptionHtml} -
    -
    -
    -
    -

    Lieferung & Rücksendung

    -
    - diamond -
    -
    -
    -
      -
    • -

      Versandkosten ab 100 Euro gratis

      -

      - Ab einem Bestellwert von 100 Euro liefern wir deine Bestellung versandkostenfrei. Die Lieferzeit - beträgt in der Regel 7 Werktage, sodass du deine neuen Sportklamotten schnell in den Händen - hältst. -

      -
    • -
    • -

      Rücksendung

      -

      - Du kannst deine Bestellung innerhalb von 30 Tagen nach Erhalt der Ware zurücksenden. Die Kosten - für die Rücksendung übernehmen wir nicht. Dir wird ein Versandschein zur Verfügung gestellt, - wobei die Kosten dafür von dem zurückerstatteten Betrag abgezogen werden. Die Rücksendung kann - ganz bequem über unsere Retourenfunktion in deinem persönlichen Konto abgewickelt werden. -

      -
    • -
    • -

      Mehr Details

      -

      - Weitere Informationen zur Rücksendung findest du in unserer ausführlichen - Widerrufsbelehrung - - sowie in unserem - HelpCenter. Bei Fragen stehen wir dir jederzeit zur Verfügung. -

      -
    • -
    -
    -
    -
    -
    -

    GPSR-bezogene Produktinformationen der EU

    -
    - diamond -
    -
    -
    -
      -
    • - Hersteller-Kontaktinformationen -
        -
      • Name: Robin Grenzdörfer
      • -
      • Email-Adresse: support@binkrassdufass.de
      • -
      • Postanschrift: Robin Grenzdörfer; Schultheißstraße 39; 85049 Ingolstadt; Deutschland
      • -
      -
    • -
    • EU-Garantie: 2 Jahre
    • -
    -
    -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/ProductImagePreview.svelte b/frontend/src/lib/components/pagebuilder/product/ProductImagePreview.svelte deleted file mode 100644 index d104393..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ProductImagePreview.svelte +++ /dev/null @@ -1,99 +0,0 @@ - - -
    -
    - {#each previewImages as previewImage} - - {/each} -
    - -
    - -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/ProductInCartPreview.svelte b/frontend/src/lib/components/pagebuilder/product/ProductInCartPreview.svelte deleted file mode 100644 index 8f7a885..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ProductInCartPreview.svelte +++ /dev/null @@ -1,155 +0,0 @@ - - -
    -
    -
    - -
    - {previewImage?.altText} -
    -
    -
    -
    {product.title}
    - {#if item.merchandise.selectedOptions} - {item.merchandise.selectedOptions?.map((o) => o.value).join(" | ")} - {/if} - -
    - - - {#if !hideActions} -
    - - -
    - {:else if showQuantity} -
    - {item.quantity} Stk. -
    - {:else if showFavoriteActionButtons} -
    - - -
    - {/if} -
    -
    -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/ProductItems.svelte b/frontend/src/lib/components/pagebuilder/product/ProductItems.svelte deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/src/lib/components/pagebuilder/product/ProductListPreviewWidget.svelte b/frontend/src/lib/components/pagebuilder/product/ProductListPreviewWidget.svelte deleted file mode 100644 index 119f0a2..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ProductListPreviewWidget.svelte +++ /dev/null @@ -1,142 +0,0 @@ - - -{#if loading} - -{:else if products} -
    - {#if productSlider.headline} -
    -
    - {#if productSlider.topLine} - - {productSlider.topLine} - - {/if} - -

    {productSlider.headline}

    -
    - {#if cta} - - {/if} -
    - {/if} - -
    -{:else} -

    Es wurden keine Produkte gefunden.

    -{/if} - - diff --git a/frontend/src/lib/components/pagebuilder/product/ProductPageDesktop.svelte b/frontend/src/lib/components/pagebuilder/product/ProductPageDesktop.svelte deleted file mode 100644 index 97a0995..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ProductPageDesktop.svelte +++ /dev/null @@ -1,135 +0,0 @@ - - -
    -
    -
    -
    - -
    -
    -
    - {#if previewImages?.length} - - {/if} -
    -
    - {#if product} - - {/if} - - {#if product} - - {/if} - {#if product} - - - {/if} -
    -
    - {#if product} - - - {/if} - -
    -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/ProductPageMobile.svelte b/frontend/src/lib/components/pagebuilder/product/ProductPageMobile.svelte deleted file mode 100644 index 2ef1115..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ProductPageMobile.svelte +++ /dev/null @@ -1,106 +0,0 @@ - - -
    - - - - - -
    -
    - {#if previewImages?.length} - - {/if} -
    - - - {#if product} - - {/if} - - {#if product} - - - {/if} -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/ProductPreview.svelte b/frontend/src/lib/components/pagebuilder/product/ProductPreview.svelte deleted file mode 100644 index f9d45ce..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ProductPreview.svelte +++ /dev/null @@ -1,326 +0,0 @@ - - -
  • -
    -
    -
    - - - crinkle -
    - -
    - CHOOSE YOUR STYLE -
      - {#each getOptionValues(product, "Größe") as size} -
    • - -
    • - {/each} -
    -
    -
    - {#key loading} -
    - - -
    - -
    - {shownImage?.altText} -
    -
    -
    - {/key} -
    - - - - -
  • - - diff --git a/frontend/src/lib/components/pagebuilder/product/ProductPreviewList.svelte b/frontend/src/lib/components/pagebuilder/product/ProductPreviewList.svelte deleted file mode 100644 index a29f2af..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ProductPreviewList.svelte +++ /dev/null @@ -1,67 +0,0 @@ - - - - -
    -
      - {#each products as product (product.id)} - - {/each} -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/ProductSizesPreviewList.svelte b/frontend/src/lib/components/pagebuilder/product/ProductSizesPreviewList.svelte deleted file mode 100644 index 2b80086..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ProductSizesPreviewList.svelte +++ /dev/null @@ -1,183 +0,0 @@ - - -
    -
    - CHOOSE SIZE - -
    - -
      - {#each possibleSizeVariants.map((v) => v.selectedOptions.find((o) => o.name === "Größe").value) as value} -
    • - -
    • - {/each} -
    -
    - {#if forcedWarning} - Heads Up -

    {@html forcedWarning}

    - {:else if sizingChart && sizingChart.generalDescription?.includes("fällt klein aus")} - Heads Up -

    - Dieser Artikel fällt klein aus. Daher empfehlen wir, eine Nummer größer zu bestellen. -

    - {:else if sizingChart && sizingChart.generalDescription?.includes("fällt groß aus")} - Heads Up -

    - Dieser Artikel fällt groß aus. Daher empfehlen wir, eine Nummer kleiner zu bestellen. -

    - {:else if sizingChart && sizingChart.generalDescription?.includes("wenn deine Maße zwischen den Größen liegen")} - Heads Up -

    - Solltest du unsicher sein, welche Größe du bestellen sollstest, empfehlen wir, die größere Größe zu - wählen. -

    - {/if} -
    -
    -{#if showSizingChart} - - Größen - -
    - {#if !loading} - - {/if} -
    -
    -{/if} - - diff --git a/frontend/src/lib/components/pagebuilder/product/ProductSummary.svelte b/frontend/src/lib/components/pagebuilder/product/ProductSummary.svelte deleted file mode 100644 index 9176e9c..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ProductSummary.svelte +++ /dev/null @@ -1,104 +0,0 @@ - - -
    - {#if productTitleAsHeading} -

    {product.title}

    - {:else} - {product.title} - {/if} - {#if product.title.includes("QR")} -
    - -
    - {/if} -
    - -
    - - {#if product.reviews.avgRating} -
    - - - - - {product.reviews.avgRating.toFixed(1)} -
    - {/if} -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/RatingOverview.svelte b/frontend/src/lib/components/pagebuilder/product/RatingOverview.svelte deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/src/lib/components/pagebuilder/product/RecommendedProducts.svelte b/frontend/src/lib/components/pagebuilder/product/RecommendedProducts.svelte deleted file mode 100644 index dc12a4f..0000000 --- a/frontend/src/lib/components/pagebuilder/product/RecommendedProducts.svelte +++ /dev/null @@ -1,43 +0,0 @@ - - - - -{#if products.length} -
    -
    -
    -

    - - Weitere Produkte {#if isMobile}{:else}aus dieser Kategorie{/if} -

    -
    - - -
    - - -
    -{/if} - - diff --git a/frontend/src/lib/components/pagebuilder/product/ToggleFavorite.svelte b/frontend/src/lib/components/pagebuilder/product/ToggleFavorite.svelte deleted file mode 100644 index 54b73ad..0000000 --- a/frontend/src/lib/components/pagebuilder/product/ToggleFavorite.svelte +++ /dev/null @@ -1,77 +0,0 @@ - - - - - diff --git a/frontend/src/lib/components/pagebuilder/product/widgets/FilterBlock.svelte b/frontend/src/lib/components/pagebuilder/product/widgets/FilterBlock.svelte deleted file mode 100644 index 92fff21..0000000 --- a/frontend/src/lib/components/pagebuilder/product/widgets/FilterBlock.svelte +++ /dev/null @@ -1,123 +0,0 @@ - - - - - diff --git a/frontend/src/lib/components/pagebuilder/product/widgets/ProductBenefits.svelte b/frontend/src/lib/components/pagebuilder/product/widgets/ProductBenefits.svelte deleted file mode 100644 index 4eda4f1..0000000 --- a/frontend/src/lib/components/pagebuilder/product/widgets/ProductBenefits.svelte +++ /dev/null @@ -1,131 +0,0 @@ - - -
    -
      - {#each benefits as benefit, i} -
    • -

      {benefit.title}

      -

      {@html benefit.description}

      -
    • - {/each} -
    -
    - {#each benefits as _} -
    -
    -
    -
    - {/each} -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/widgets/ProductPricetags.svelte b/frontend/src/lib/components/pagebuilder/product/widgets/ProductPricetags.svelte deleted file mode 100644 index db2eba8..0000000 --- a/frontend/src/lib/components/pagebuilder/product/widgets/ProductPricetags.svelte +++ /dev/null @@ -1,35 +0,0 @@ - - -
    - {#if hasDiscount} - - {/if} - -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/widgets/ProductQuantity.svelte b/frontend/src/lib/components/pagebuilder/product/widgets/ProductQuantity.svelte deleted file mode 100644 index 2297643..0000000 --- a/frontend/src/lib/components/pagebuilder/product/widgets/ProductQuantity.svelte +++ /dev/null @@ -1,56 +0,0 @@ - - -
    - -
    - {quantity} -
    - -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/widgets/ProductRatings.svelte b/frontend/src/lib/components/pagebuilder/product/widgets/ProductRatings.svelte deleted file mode 100644 index f93fd7f..0000000 --- a/frontend/src/lib/components/pagebuilder/product/widgets/ProductRatings.svelte +++ /dev/null @@ -1,254 +0,0 @@ - - -
    -
    -

    Bewertungen

    -
    -
    - {#if !ratingDetails} - - {:else if ratingDetails.ratings.length === 0} -

    Es gibt noch keine Bewertungen für dieses Produkt.

    - {:else} -
    -

    Überblick

    -
      - {#each Object.keys(ratingDetails.overview) as key, i} -
    • -
      - - - - {i + 1} -
      -
      -
      -
      -
      {ratingDetails.overview[key].count}
      -
    • - {/each} -
    -
    -
    -

    Ø Bewertungen

    -
      - - - {#each Object.keys(ratingDetails.detailed) as key} -
    • -
      - {ratingDetails.detailed[key].label} -
      -
      -
      -
      -
      -
      - - {ratingDetails.detailed[key].bad} - - - {ratingDetails.detailed[key].good} - -
      -
      -
    • - {/each} -
    -
    - {/if} -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/product/widgets/ShareButton.svelte b/frontend/src/lib/components/pagebuilder/product/widgets/ShareButton.svelte deleted file mode 100644 index ee135bf..0000000 --- a/frontend/src/lib/components/pagebuilder/product/widgets/ShareButton.svelte +++ /dev/null @@ -1,3 +0,0 @@ - diff --git a/frontend/src/lib/components/pagebuilder/product/widgets/SizeChart.svelte b/frontend/src/lib/components/pagebuilder/product/widgets/SizeChart.svelte deleted file mode 100644 index f6807f2..0000000 --- a/frontend/src/lib/components/pagebuilder/product/widgets/SizeChart.svelte +++ /dev/null @@ -1,90 +0,0 @@ - - -{#if sizingChart && sizingChart.columns && sizingChart.columns.length} -
    -

    Messe dich selbst

    -

    - {#if sizingChart.generalDescription} - {@html sizingChart.generalDescription?.replace( - "Die Maße werden von den Lieferanten zur Verfügung gestellt.", - "" - )} - {/if} -

    -
    - größentabelle -

    - {#if sizingChart.imageDescription} - {@html sizingChart.imageDescription - .replace("Eine Brust", "A Brust") - .replace("Eine Länge", "A Länge") - .replace("Eine Taille", "A Taille") - .replace("Eine Hüfte", "A Hüfte") - .replace("Eine Schulter", "A Schulter")}{/if} -

    -
    - - - - - {#each sizingChart.columns || [] as column} - - {/each} - - - - {#each sizingChart.availableSizes || [] as size, index} - - - {#each sizingChart.columns as column} - - {/each} - - {/each} - -
    Größe{column.germanLabelTranslation || column.label}
    {size}{column.sizes[index]} cm
    -
    -{:else} -

    Keine Größentabelle verfügbar

    -{/if} - - diff --git a/frontend/src/lib/components/pagebuilder/profile/Account.svelte b/frontend/src/lib/components/pagebuilder/profile/Account.svelte deleted file mode 100644 index b7756a7..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/Account.svelte +++ /dev/null @@ -1,82 +0,0 @@ - - -
    -
    -

    Deine Daten

    - {#key reload} - {#await getCustomer($login.tokenData.tibiId)} - - {:then customer} -
    -
    - -
    -
    - -
    -
    - -
    -
    - {/await}{/key} -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/profile/AddressForm.svelte b/frontend/src/lib/components/pagebuilder/profile/AddressForm.svelte deleted file mode 100644 index 36b3a6c..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/AddressForm.svelte +++ /dev/null @@ -1,93 +0,0 @@ - - -
    - - -
    -
    - -
    -
    - -
    - -
    - - -
    - -
    - -
    -
    - -
    - - diff --git a/frontend/src/lib/components/pagebuilder/profile/CardWrapper.svelte b/frontend/src/lib/components/pagebuilder/profile/CardWrapper.svelte deleted file mode 100644 index 1fbde40..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/CardWrapper.svelte +++ /dev/null @@ -1,137 +0,0 @@ - - -
  • - {#if clickable} -
    -
    - - - -
    -
    - -
    -
    - {:else} -
    - - - - {#if red} - - - - {:else} - - - {/if} - -
    - -
    -
    -
    - -
    - {/if} -
  • - - diff --git a/frontend/src/lib/components/pagebuilder/profile/Login.svelte b/frontend/src/lib/components/pagebuilder/profile/Login.svelte deleted file mode 100644 index c978ee4..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/Login.svelte +++ /dev/null @@ -1,107 +0,0 @@ - - -
    - -
    - - diff --git a/frontend/src/lib/components/pagebuilder/profile/Orders.svelte b/frontend/src/lib/components/pagebuilder/profile/Orders.svelte deleted file mode 100644 index 4c675e4..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/Orders.svelte +++ /dev/null @@ -1,184 +0,0 @@ - - - - -{#if id} - -{:else} -
    -
    -
    -
    -

    Deine Bestellungen

    -

    Hier findest du alle Bestellungen, die du bei uns getätigt hast.

    -
    - {#if innerWidth >= minTableWidth} -
      -
    • - -
    • - -
    • - -
    • -
    - {/if} -
    - {#await getTibiRestOrders()} - - {:then orders} -
      - {#each orders as order} - {#if viewType === "card"} - - {:else} - - {/if} - {/each} -
    - {/await} -
    -
    -{/if} - - diff --git a/frontend/src/lib/components/pagebuilder/profile/PasswordReset.svelte b/frontend/src/lib/components/pagebuilder/profile/PasswordReset.svelte deleted file mode 100644 index 17c1b0f..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/PasswordReset.svelte +++ /dev/null @@ -1,95 +0,0 @@ - - -
    - -
    - - diff --git a/frontend/src/lib/components/pagebuilder/profile/PasswordResetRequest.svelte b/frontend/src/lib/components/pagebuilder/profile/PasswordResetRequest.svelte deleted file mode 100644 index 27b4243..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/PasswordResetRequest.svelte +++ /dev/null @@ -1,113 +0,0 @@ - - -
    - -
    - - diff --git a/frontend/src/lib/components/pagebuilder/profile/Profile.svelte b/frontend/src/lib/components/pagebuilder/profile/Profile.svelte deleted file mode 100644 index 958c937..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/Profile.svelte +++ /dev/null @@ -1,95 +0,0 @@ - - -
    -
    -

    - {bigCommerceCustomer?.first_name || ""} - {bigCommerceCustomer?.last_name || ""} - -

    - -
    -

    Meine Rekorde

    -

    Alle unten gelisteten Rekorde sind automatisch und umgehend öffentlich über folgenden Link Einsehbar.

    - {#if !bigCommerceCustomer?.form_fields?.find((f) => f?.name == "username")?.value} -

    - Um ein öffentliches Profil zu haben, benötigst du einen Nutzernamen! Klicke hier. -

    - {:else} - - - {location.origin.split("https://").pop()}/@{( - bigCommerceCustomer?.form_fields?.find((f) => f?.name == "username")?.value || "" - ).toLowerCase()} - - {/if} -
    - -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/profile/Register.svelte b/frontend/src/lib/components/pagebuilder/profile/Register.svelte deleted file mode 100644 index 81cff7f..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/Register.svelte +++ /dev/null @@ -1,280 +0,0 @@ - - -
    -
    -

    Erstelle einen Account

    -
    -

    - Um einen Account zu löschen, ist die Kommunikation mit unserem Kundenservice notwendig. Aus Gründen der - Bestellungsverfolgung können wir diese Funktion leider nicht automatisiert anbieten. -

    -
    -
    - - -
    -
    - -
    - -
    -
    - -
    -
    - - - -
    -
    -
    - -
    -

    - Ich habe die Datenschutzbestimmungen gelesen und akzeptiere sie. -

    -
    -
    -
    - -
    -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/profile/account/Address.svelte b/frontend/src/lib/components/pagebuilder/profile/account/Address.svelte deleted file mode 100644 index 0da9b55..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/account/Address.svelte +++ /dev/null @@ -1,94 +0,0 @@ - - -
  • -
    -

    {address.first_name || ""} {address.last_name || ""}

    -
    -

    {address.address1}

    - {#if address.address2} -

    {address.address2}

    - {/if} -

    - {address.postal_code} - {address.city} - {address.state_or_province ? `(${address.state_or_province})` : ""} -

    -

    {address.country}

    -
    -
    -
    -

    Wohnadresse

    - - - - {#if showDelete} - - {/if} - -
    -
  • - - diff --git a/frontend/src/lib/components/pagebuilder/profile/account/Addresses.svelte b/frontend/src/lib/components/pagebuilder/profile/account/Addresses.svelte deleted file mode 100644 index 7dc208f..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/account/Addresses.svelte +++ /dev/null @@ -1,213 +0,0 @@ - - -
    - -
    -

    - {editedAddress - ? !editedAddress.id - ? "Adresse hinzufügen" - : "Adresse bearbeiten" - : "Gespeicherte Adressen"} -

    - {#await getCustomerAddresses($login.tokenData.tibiId)} - - {:then addresses} -
    - {#if editedAddress} -
    -
    - -
    -
    - - -
    -
    - {:else} -
      - {#key rerender} - {#each addresses as address, i} - {#if address} -
      - {/if} - {/each}{/key} -
    - - {/if} -
    - {/await} -
    -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/profile/account/IndentifyingData.svelte b/frontend/src/lib/components/pagebuilder/profile/account/IndentifyingData.svelte deleted file mode 100644 index 963a3ec..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/account/IndentifyingData.svelte +++ /dev/null @@ -1,384 +0,0 @@ - - -
    - -
    -

    Identifizierende Daten

    - {#if editMode} - {#if editMode === "password"} -
    - -
    -
    - - -
    - {:else if editMode === "email"} -
    - -
    -
    - -
    - {:else if editMode == "username"} -
    - -
    -
    - -
    - {/if} - {:else} -
    -
    -
    - - -
    -
    - -
    -
    -
    - {/if} - {#if editMode} -
    - - -
    - {:else} -
    - - - - -
    - {/if} -
    -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/profile/account/PersonalData.svelte b/frontend/src/lib/components/pagebuilder/profile/account/PersonalData.svelte deleted file mode 100644 index 1c27a81..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/account/PersonalData.svelte +++ /dev/null @@ -1,225 +0,0 @@ - - -
    - -
    -

    Persönliche Daten

    -
    - - - -
    -
    - - -
    -
    - -
    - - - {#each ratingOptions as option} -
    -
    - {option.label} -
    -
    - {#each Array.from({ length: 5 }, (v, k) => k) as star} - - {/each} -
    -
    - {/each} -
    -
    - - {#if productRating.status !== "pending"} - Deine Bewertung wurde bereits veröffentlicht. - {/if} -
    - - - diff --git a/frontend/src/lib/components/pagebuilder/profile/order/return/OrderReturnView.svelte b/frontend/src/lib/components/pagebuilder/profile/order/return/OrderReturnView.svelte deleted file mode 100644 index 1145ae6..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/order/return/OrderReturnView.svelte +++ /dev/null @@ -1,208 +0,0 @@ - - -
    - -
    -
    -

    Rückgabe

    - {#if (order.shipments || []).length > 0 && order.shipments[0].sentAt && checkIfOrderMayArrived(new Date(order.shipments[0].sentAt))} -

    - Bis zum {new Date(getLastDayForReturn(order.shipments[0].sentAt)).toLocaleDateString("de-DE", { - day: "2-digit", - month: "2-digit", - year: "numeric", - })} -

    - {/if} -

    - Bitte beachte, dass wir die Kosten für das Versandlabel vom erstatteten Betrag abziehen. Solltest du - mehrere Rücksendungen für eine Bestellung vornehmen, werden die zusätzlichen Kosten von deinem - Erstattungsbetrag abgezogen. -

    -

    - Bitte sende uns keine Artikel zurück, die über eine normale Prüfung hinaus getragen, benutzt oder - beschädigt wurden. Solche Artikel können nicht vollständig erstattet werden. Jede Rücksendung wird - von uns sorgfältig geprüft, und nur Ware, die sich in einwandfreiem Zustand befindet, wird - vollständig erstattet. Für mehr Details haben wir eine - Widerrufsbelehrung - . -

    -

    - Bitte beachten Sie auch unsere Datenschutzbestimmungen, die Sie unter - Datenschutz - finden. -

    -
    -
    - {#await createCart(order)} - - {:then cart} - {#if !!existingReturnRequests} -
      - {#each cart.lines as line, i} - - {/each} -
    - - - - {/if} - {/await} - -
    -
    -
    - - diff --git a/frontend/src/lib/components/pagebuilder/profile/order/return/ReturnOverview.svelte b/frontend/src/lib/components/pagebuilder/profile/order/return/ReturnOverview.svelte deleted file mode 100644 index edab7ca..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/order/return/ReturnOverview.svelte +++ /dev/null @@ -1,330 +0,0 @@ - - -
      - -
      -
      -

      Das geht zurück

      -
      -
      - {#await createCart(order)} - - {:then cart} - {#if !!existingReturnRequests} -
        - {#each cart.lines.filter((line) => returnRequest.products.findIndex((product) => { - return product.productId == Number(line.id) && product.quantity > 0 - }) >= 0) as line} -
      • -
        -

        - {returnRequest.products.find((p) => p.productId == Number(line.id)) - ?.quantity} Stk. -

        -
        -
        - -
        - -
        - Grund der Rückgabe -

        - {getLabelByValueForReturnReason( - returnRequest.products.find((p) => p.productId == Number(line.id)) - ?.returnReason - ) || "-"} -

        - {#if returnRequest.products.find((p) => p.productId == Number(line.id))?.attachedImages?.length} - {/if} -
        -
      • - {/each} -
      - {/if} - {/await} -
      -
      -
      - -
      -
      -

      Rückgabestatus

      -

      Rückgabe-ID: #{getShownIdFraction(returnRequest.id)}

      -
      -
      - -
      - {#if !returnRequest.status || returnRequest.status == "pending"} -
      - -
      - {/if} -
      -
      -
    - - diff --git a/frontend/src/lib/components/pagebuilder/profile/order/return/ReturnProductLine.svelte b/frontend/src/lib/components/pagebuilder/profile/order/return/ReturnProductLine.svelte deleted file mode 100644 index 60783cd..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/order/return/ReturnProductLine.svelte +++ /dev/null @@ -1,218 +0,0 @@ - - - - -
  • -
    - -
    - - Menge: {orderedQuantity} - {#if alreadyReturnedQuantity > 0} - Bereits storniert: {alreadyReturnedQuantity} Stk. - {/if} - -
    -
    Zurückgeben Menge:
    - -
    -
    -
    - -

    - Ich habe die Nutzungsbedingungen gelesen und akzeptiere Sie. Auch achte ich darauf, nicht gegen die Urheber- und Datenschutzrechte von Dritten - zu verstoßen. -

    -
    - - -{/if} - - diff --git a/frontend/src/lib/components/pagebuilder/profile/profile/RecordEditMask.svelte b/frontend/src/lib/components/pagebuilder/profile/profile/RecordEditMask.svelte deleted file mode 100644 index bde38f7..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/profile/RecordEditMask.svelte +++ /dev/null @@ -1,325 +0,0 @@ - - - - -
    - {#if uploadMode} -
    -
    -
    - - -
    -
    - -
    -
    - {:else if record.recording} - - {:else} - - {/if} -
    -
    - -
    -
    - - -
    -
    - -
    -
    - {#if newRecord} -
    - - -
    - {/if} - -
    - - diff --git a/frontend/src/lib/components/pagebuilder/profile/profile/Records.svelte b/frontend/src/lib/components/pagebuilder/profile/profile/Records.svelte deleted file mode 100644 index 04cfa5e..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/profile/Records.svelte +++ /dev/null @@ -1,121 +0,0 @@ - - -
      - {#each records || [] as record} - - -
      - {#if record.recording} - - {/if} -
      -

      {record.title}

      -

      {record.description}

      -
      -
      -
      - {/each} -
    - -{#if !!reportRecordModal} - - Beitrag Melden -
    Haben du einen unangemessenen Beitrag gefunden? Melde diesen hier.
    - -
    -{/if} - - diff --git a/frontend/src/lib/components/pagebuilder/profile/profile/SocialMediaRow.svelte b/frontend/src/lib/components/pagebuilder/profile/profile/SocialMediaRow.svelte deleted file mode 100644 index c99c401..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/profile/SocialMediaRow.svelte +++ /dev/null @@ -1,315 +0,0 @@ - - - - - - - diff --git a/frontend/src/lib/components/pagebuilder/profile/profile/VideoPreview.svelte b/frontend/src/lib/components/pagebuilder/profile/profile/VideoPreview.svelte deleted file mode 100644 index 2899ef3..0000000 --- a/frontend/src/lib/components/pagebuilder/profile/profile/VideoPreview.svelte +++ /dev/null @@ -1,265 +0,0 @@ - - -
    - {#if !age} - - {/if} - {#if age} -
    - ALTER -

    {age}

    - - - -
    - {/if} - {#if imgIsData} -
    - -
    - {:else} - -
    - -
    -
    - {/if} -
    - - diff --git a/frontend/src/lib/components/widgets/Pricetag.svelte b/frontend/src/lib/components/widgets/Pricetag.svelte deleted file mode 100644 index 4b2054d..0000000 --- a/frontend/src/lib/components/widgets/Pricetag.svelte +++ /dev/null @@ -1,77 +0,0 @@ - - - - crinkle - - {formatPrice(Number(price.amount) * 1.19)} - - crinkle - - - diff --git a/frontend/src/lib/components/widgets/inputs/imageUpload/ImageFieldLibrary.svelte b/frontend/src/lib/components/widgets/inputs/imageUpload/ImageFieldLibrary.svelte deleted file mode 100644 index 42b109b..0000000 --- a/frontend/src/lib/components/widgets/inputs/imageUpload/ImageFieldLibrary.svelte +++ /dev/null @@ -1,135 +0,0 @@ - - - - - icon - FOTOS - -
    - - {#each images as image} -
    -
    - - -
    -
    - {/each} -
    -
    - - diff --git a/frontend/src/lib/components/widgets/inputs/imageUpload/ImagePreviewRow.svelte b/frontend/src/lib/components/widgets/inputs/imageUpload/ImagePreviewRow.svelte deleted file mode 100644 index a240c06..0000000 --- a/frontend/src/lib/components/widgets/inputs/imageUpload/ImagePreviewRow.svelte +++ /dev/null @@ -1,114 +0,0 @@ - - - -
    - {#each imageData.slice(0, amountOfVisibleImages) as image} - - -
    - -
    - {/each} - - - - {#if imageData.length > amountOfVisibleImages} - -
    - - {#if imageData.length > amountOfVisibleImages + 1} -
    +{imageData.length - amountOfVisibleImages}
    - {/if} -
    - {/if} - {#if !disabled} - - - {/if} -
    - - diff --git a/frontend/src/lib/components/widgets/inputs/imageUpload/ImageUpload.svelte b/frontend/src/lib/components/widgets/inputs/imageUpload/ImageUpload.svelte deleted file mode 100644 index 81d58d1..0000000 --- a/frontend/src/lib/components/widgets/inputs/imageUpload/ImageUpload.svelte +++ /dev/null @@ -1,299 +0,0 @@ - - - - - - Bilder hochladen oder aufnehmen - - -

    - Bitte wählen Sie die Bilder aus, die Sie hochladen oder aufnehmen möchten. Sie können mehrere Bilder - gleichzeitig auswählen. Auf dem Computer müssen Sie die Bilder aus Ihrer Bibliothek auswählen. Auf einem - Smartphone können Sie die Kamera verwenden, um Bilder aufzunehmen. -

    - -
    - {#each sessionImages as image, index} - -
    - {#if image} -
    - -
    - - -
    -
    - {/if} -
    -
    - {/each} -
    - -
    - - - - - -
    -
    - - diff --git a/frontend/src/lib/components/widgets/inputs/imageUpload/ImagesRow.svelte b/frontend/src/lib/components/widgets/inputs/imageUpload/ImagesRow.svelte deleted file mode 100644 index bd98e95..0000000 --- a/frontend/src/lib/components/widgets/inputs/imageUpload/ImagesRow.svelte +++ /dev/null @@ -1,154 +0,0 @@ - - - - -
    - {#if !disabled} -

    - icon -

    FOTOS

    -

    {/if} - {#if imagesData?.length === 0} - - {:else} - - {/if} -
    -{#if showFileLibrary} - -{/if} - -{#if imagesData && modalStates.showImageUploadModal} - -{/if} - - diff --git a/frontend/src/lib/components/widgets/inputs/imageUpload/UploadImageWidget.svelte b/frontend/src/lib/components/widgets/inputs/imageUpload/UploadImageWidget.svelte deleted file mode 100644 index 8971523..0000000 --- a/frontend/src/lib/components/widgets/inputs/imageUpload/UploadImageWidget.svelte +++ /dev/null @@ -1,47 +0,0 @@ - - - - - diff --git a/frontend/src/lib/components/widgets/inputs/imageUpload/helper.ts b/frontend/src/lib/components/widgets/inputs/imageUpload/helper.ts deleted file mode 100644 index 5f6bc93..0000000 --- a/frontend/src/lib/components/widgets/inputs/imageUpload/helper.ts +++ /dev/null @@ -1,41 +0,0 @@ -export const openFileInput = (callback: (e: Event) => Promise) => { - const input = document.createElement("input") - input.type = "file" - input.accept = "image/*" - input.multiple = true - input.onchange = async (e: Event) => { - await callback(e) - setTimeout(() => { - input.remove() // Delay the removal slightly - }, 100) - } - input.click() -} - -export const openCameraInput = (callback: (e: Event) => Promise) => { - const input = document.createElement("input") - input.type = "file" - input.accept = "image/*" - input.capture = "environment" - - input.style.position = "absolute" - input.style.left = "-9999px" // Hide the input off-screen - document.body.appendChild(input) - - const handleChange = async (e: Event) => { - console.log("HandleChange triggered") // Log to check if this triggers - e.stopPropagation() - await callback(e) - - setTimeout(() => { - input.value = "" // Reset input - input.remove() // Remove element - }, 1000) // Delay removal - } - - // Try using 'input' event listener as an alternative - input.addEventListener("input", handleChange) - - input.focus() - input.click() -} diff --git a/frontend/src/lib/components/widgets/inputs/imageUpload/imagePreview.svelte b/frontend/src/lib/components/widgets/inputs/imageUpload/imagePreview.svelte deleted file mode 100644 index a9c9191..0000000 --- a/frontend/src/lib/components/widgets/inputs/imageUpload/imagePreview.svelte +++ /dev/null @@ -1,21 +0,0 @@ - - - - - diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/cart.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/cart.ts deleted file mode 100644 index 86060d8..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/cart.ts +++ /dev/null @@ -1,139 +0,0 @@ -import { get } from "svelte/store" -import { bigCommerceFetch } from "." -import { api, postDBEntry } from "../../../../api" -import { login } from "../../../store" -import { BKDFFromBigCommerceLineItems, bigCommerceToBKDFCart } from "./mapper" -import { createCartMutation } from "./mutations/cart" -import { getStoreProductsQuery } from "./queries/product" - -const getBigCommerceProductsWithCheckoutInformation = async (cartId: string) => { - const _login = get(login) - - let cartRes - if (_login) { - cartRes = await api(`dummyCartEndpoint/${cartId}?checkout=true&loggedInCheckout=true`, { - method: "GET", - useJwt: true, - }) - } else cartRes = await api(`dummyCartEndpoint/${cartId}?checkout=true`, {}) - - const cart = cartRes.data?.data?.cart - if (!cart) { - return { - productsByIdList: null, - cart: null, - checkoutUrl: null, - } - } - const checkoutUrl = cartRes.data.data.checkoutURL - const lines = BKDFFromBigCommerceLineItems(cart.lineItems) - const productIds = lines.map(({ merchandiseId }) => parseInt(merchandiseId)) - const bigCommerceProductListRes = await bigCommerceFetch({ - query: getStoreProductsQuery, - variables: { - entityIds: productIds, - }, - cache: "no-store", - }) - const bigCommerceProductList = bigCommerceProductListRes.body.data.site.products.edges.map( - (product) => product.node - ) - const createProductList = (idList: number[], products: BigCommerceProduct[]) => { - return idList.map((productId) => { - const productData = products.find(({ entityId }) => entityId == productId)! - return { - productId, - productData, - } - }) - } - const bigCommerceProducts = createProductList(productIds, bigCommerceProductList) - return { - productsByIdList: bigCommerceProducts, - cart, - checkoutUrl, - } -} - -export async function createCart( - lines: { merchandiseId: string; quantity: number; productId?: string }[] -): Promise { - let bigCommerceCart: BigCommerceCart - - const res = await bigCommerceFetch({ - query: createCartMutation, - variables: { - createCartInput: { - lineItems: lines.map(({ merchandiseId, quantity, productId }) => ({ - productEntityId: parseInt(productId!, 10), - variantEntityId: parseInt(merchandiseId, 10), - quantity, - })), - }, - }, - cache: "no-store", - }) - bigCommerceCart = res.body.data.cart.createCart.cart - const { cart, productsByIdList, checkoutUrl } = await getBigCommerceProductsWithCheckoutInformation( - bigCommerceCart.entityId - ) - if (!cart || !productsByIdList) return null - return bigCommerceToBKDFCart(cart, productsByIdList, checkoutUrl) -} - -export async function addCartItem( - cartId: string, - lines: { merchandiseId: string; quantity: number; productId?: string }[] -): Promise { - await postDBEntry("dummyCartEndpoint", { - operation: "add", - cartId, - lineItems: lines.map(({ merchandiseId, quantity, productId }) => ({ - product_id: productId, - variant_id: merchandiseId, - quantity, - })), - }) - - const { cart, productsByIdList, checkoutUrl } = await getBigCommerceProductsWithCheckoutInformation(cartId) - if (!cart || !productsByIdList) return null - return bigCommerceToBKDFCart(cart, productsByIdList, checkoutUrl) -} - -export async function updateCartItem( - cartId: string, - line: { merchandiseId: string; productId: string; quantity: number; entityId: string } -): Promise { - await postDBEntry("dummyCartEndpoint", { - operation: "update", - lineItem: { - product_id: line.productId, - variant_id: line.merchandiseId, - quantity: line.quantity, - }, - cartId, - entityId: line.entityId, - }) - - const { cart, productsByIdList, checkoutUrl } = await getBigCommerceProductsWithCheckoutInformation(cartId) - if (!cart || !productsByIdList) return null - return bigCommerceToBKDFCart(cart, productsByIdList, checkoutUrl) -} - -export async function deleteCartItem(cartId: string, lineId: string, lastItem = false): Promise { - await postDBEntry("dummyCartEndpoint", { - operation: "delete", - cartId, - entityId: lineId, - }) - if (lastItem) return - const { cart, productsByIdList, checkoutUrl } = await getBigCommerceProductsWithCheckoutInformation(cartId) - if (!cart || !productsByIdList) return null - return bigCommerceToBKDFCart(cart, productsByIdList, checkoutUrl) -} - -export async function getCart(cartId: string): Promise { - const { cart, productsByIdList, checkoutUrl } = await getBigCommerceProductsWithCheckoutInformation(cartId) - if (!cart || !productsByIdList) return null - return bigCommerceToBKDFCart(cart, productsByIdList, checkoutUrl) -} diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/categories.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/categories.ts deleted file mode 100644 index f733b27..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/categories.ts +++ /dev/null @@ -1,50 +0,0 @@ -import { bigCommerceFetch } from "." - -import { getStoreCategorieTreeQuery } from "./queries/category" -import { getMenuQuery } from "./queries/menu" - -export function mapBigcommerceCategoriesToNavigation( - bigCommerceCategories: BigCommerceCategory[] -): NavigationElement[] { - function convertCategoryToNavigationEntry(category: BigCommerceCategory): NavigationElement { - const navEl = { - name: category.name, - page: "/collections" + category.path, - external: false, - elements: category.children?.map(convertCategoryToNavigationEntry), - type: "bigcommerce" as const, // Change the type to "bigcommerce" - seo: category.seo, - } - return navEl - } - - return bigCommerceCategories.map(convertCategoryToNavigationEntry) -} - -export async function getBCGraphCategories(): Promise { - const res = await bigCommerceFetch({ - query: getStoreCategorieTreeQuery, - }) - return res?.body?.data?.site?.categoryTree -} - -export const getBCGraphCategoryEntityIdbyHandle = async (handle: string) => { - const resp = await bigCommerceFetch({ - query: getMenuQuery, - }) - const recursiveFindCollectionId = (list: BigCommerceCategoryTreeItem[], slug: string): number => { - const collectionId = list - .flatMap((item): number | null => { - if (item.path.includes(slug!)) return item.entityId - - if (item.children && item.children.length) return recursiveFindCollectionId(item.children!, slug) - - return null - }) - .filter((id) => typeof id === "number")[0] - - return collectionId! - } - - return recursiveFindCollectionId(resp.body.data.site.categoryTree, handle) -} diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/customer.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/customer.ts deleted file mode 100644 index 9eec175..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/customer.ts +++ /dev/null @@ -1,24 +0,0 @@ -import { bigCommerceFetch } from "." -import { pushErrors } from "./errors" -import { registerCustomerMutation } from "./mutations/customer" - -export async function registerBCGraphCustomer( - customerDetails: RegisterCustomerInput -): Promise { - const res = await bigCommerceFetch({ - query: registerCustomerMutation, - variables: { - registerCustomerInput: customerDetails, - }, - cache: "no-store", - }) - - const bigCommerceCustomer = res.body.data.customer.registerCustomer.customer - if (!bigCommerceCustomer) { - const errors = res.body.data.customer.registerCustomer.errors - if (errors) pushErrors(errors) - - return null - } - return bigCommerceCustomer -} diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/errors.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/errors.ts deleted file mode 100644 index ea055f7..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/errors.ts +++ /dev/null @@ -1,14 +0,0 @@ -import { newNotification } from "../../../store" - -export function pushErrors(errors: BigCommerceError[]) { - errors.forEach((error) => { - let html - if (error.__typename === "EmailAlreadyInUseError") - html = - "Diese Email-Adresse ist bereits in Verwendung. Bitte logge dich ein oder verwende eine andere Email-Adresse." - newNotification({ - class: "error", - html: html || error.message, - }) - }) -} diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/cart.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/cart.ts deleted file mode 100644 index 92e7469..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/cart.ts +++ /dev/null @@ -1,187 +0,0 @@ -const physicalItemFragment = /* GraphQL */ ` - fragment physicalItem on CartPhysicalItem { - entityId - parentEntityId - variantEntityId - productEntityId - sku - name - url - imageUrl - brand - quantity - isTaxable - discounts { - entityId - discountedAmount { - currencyCode - value - } - } - discountedAmount { - currencyCode - value - } - couponAmount { - currencyCode - value - } - listPrice { - currencyCode - value - } - originalPrice { - currencyCode - value - } - salePrice { - currencyCode - value - } - extendedListPrice { - currencyCode - value - } - extendedSalePrice { - currencyCode - value - } - isShippingRequired - selectedOptions { - entityId - name - ... on CartSelectedCheckboxOption { - value - valueEntityId - } - ... on CartSelectedDateFieldOption { - date { - utc - } - } - ... on CartSelectedFileUploadOption { - fileName - } - ... on CartSelectedMultiLineTextFieldOption { - text - } - ... on CartSelectedMultipleChoiceOption { - value - valueEntityId - } - ... on CartSelectedNumberFieldOption { - number - } - ... on CartSelectedTextFieldOption { - text - } - } - giftWrapping { - name - amount { - currencyCode - value - } - message - } - } -` - -const digitalItemFragment = /* GraphQL */ ` - fragment digitalItem on CartDigitalItem { - entityId - parentEntityId - variantEntityId - productEntityId - sku - name - url - imageUrl - brand - quantity - isTaxable - discounts { - entityId - discountedAmount { - currencyCode - value - } - } - discountedAmount { - currencyCode - value - } - couponAmount { - currencyCode - value - } - listPrice { - currencyCode - value - } - originalPrice { - currencyCode - value - } - salePrice { - currencyCode - value - } - extendedListPrice { - currencyCode - value - } - extendedSalePrice { - currencyCode - value - } - selectedOptions { - entityId - name - ... on CartSelectedCheckboxOption { - value - valueEntityId - } - ... on CartSelectedDateFieldOption { - date { - utc - } - } - ... on CartSelectedFileUploadOption { - fileName - } - ... on CartSelectedMultiLineTextFieldOption { - text - } - ... on CartSelectedMultipleChoiceOption { - value - valueEntityId - } - ... on CartSelectedNumberFieldOption { - number - } - ... on CartSelectedTextFieldOption { - text - } - } - } -` - -const customItemFragment = /* GraphQL */ ` - fragment customItem on CartCustomItem { - entityId - sku - name - quantity - extendedListPrice { - currencyCode - value - } - listPrice { - value - currencyCode - } - } -` - -export { customItemFragment, digitalItemFragment, physicalItemFragment } diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/categories.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/categories.ts deleted file mode 100644 index 01d3822..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/categories.ts +++ /dev/null @@ -1,8 +0,0 @@ -export const categoryField = /* GraphQL */ ` - fragment CategoryFields on CategoryTreeItem { - name - path - entityId - description - } -` diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/customer.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/customer.ts deleted file mode 100644 index 2fec448..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/customer.ts +++ /dev/null @@ -1,23 +0,0 @@ -const customerFragment = /* GraphQL */ ` - fragment customer on Customer { - firstName - lastName - email - phone - addresses { - edges { - node { - firstName - lastName - address1 - address2 - city - countryCode - phone - postalCode - } - } - } - } -` -export { customerFragment } diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/product.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/product.ts deleted file mode 100644 index 1ab0737..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/fragments/product.ts +++ /dev/null @@ -1,207 +0,0 @@ -const productOptionFragment = /* GraphQL */ ` - fragment productOption on CatalogProductOption { - __typename - entityId - displayName - isRequired - ... on MultipleChoiceOption { - displayStyle - values(first: 5) { - edges { - node { - entityId - isDefault - ... on SwatchOptionValue { - hexColors - imageUrl(width: 200) - label - isSelected - } - ... on MultipleChoiceOptionValue { - entityId - label - isSelected - } - ... on ProductPickListOptionValue { - entityId - label - isSelected - } - } - } - } - } - ... on NumberFieldOption { - entityId - displayName - } - ... on TextFieldOption { - entityId - displayName - } - ... on MultiLineTextFieldOption { - entityId - displayName - } - ... on FileUploadFieldOption { - entityId - displayName - } - ... on DateFieldOption { - entityId - displayName - } - ... on CheckboxOption { - entityId - displayName - } - } -` - -const productVariantFragment = /* GraphQL */ ` - fragment productVariant on Variant { - id - entityId - sku - upc - isPurchasable - defaultImage { - ...ImageFields - } - prices { - price { - value - currencyCode - } - priceRange { - min { - value - currencyCode - } - max { - value - currencyCode - } - } - } - options(first: 5) { - edges { - node { - entityId - displayName - values(first: 5) { - edges { - node { - entityId - label - } - } - } - } - } - } - } -` - -const productFragment = /* GraphQL */ ` - fragment product on Product { - id - entityId - sku - categories { - edges { - node { - name - description - path - entityId - } - } - } - upc - name - brand { - name - } - plainTextDescription - description - availabilityV2 { - status - description - } - defaultImage { - ...ImageFields - } - images(first: 50) { - edges { - node { - ...ImageFields - } - } - } - seo { - pageTitle - metaDescription - metaKeywords - } - path - prices { - price { - ...MoneyFields - } - salePrice { - ...MoneyFields - } - retailPrice { - ...MoneyFields - } - saved { - ...MoneyFields - } - priceRange { - min { - ...MoneyFields - } - max { - ...MoneyFields - } - } - } - createdAt { - utc - } - variants(first: 50) { - edges { - node { - ...productVariant - } - } - } - productOptions(first: 50) { - edges { - node { - ...productOption - } - } - } - reviews { - edges { - node { - rating - } - } - } - } - fragment ImageFields on Image { - url: url(width: 2000) - altText - } - fragment MoneyFields on Money { - value - currencyCode - } - ${productOptionFragment} - ${productVariantFragment} -` - -export { productFragment, productOptionFragment, productVariantFragment } diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/index.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/index.ts deleted file mode 100644 index 0e379ed..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/index.ts +++ /dev/null @@ -1,89 +0,0 @@ -import { obj2str } from "../../../../../../api/hooks/lib/ssr" -import { _fetch } from "../../../../api" -import { bigcommerceBaseURL, storefrontToken } from "../../../../config" -import { isBKDFCommerceError } from "../../type-guards" -const endpoint = `${bigcommerceBaseURL}/graphql` - -type ExtractVariables = T extends { variables: object } ? T["variables"] : never -export async function bigCommerceFetch({ - query, - variables, - headers, - cache = "force-cache", -}: { - query: string - variables?: ExtractVariables - headers?: HeadersInit - cache?: RequestCache -}): Promise<{ status: number; body: T } | never> { - const method = "POST" - const bodyReq = { - ...(query && { query }), - ...(variables && { variables }), - } - const cacheKey = obj2str({ endpoint: endpoint, options: bodyReq }) - const header = { - Accept: "application/json", - Authorization: `Bearer ${storefrontToken}`, - "Content-Type": "application/json", - ...headers, - } - // @ts-ignore - if (typeof window !== "undefined" && window.__SSR_CACHE__ && !location.pathname.includes("profile")) { - // @ts-ignore - const cache = window.__SSR_CACHE__[cacheKey] - if (cache) return Promise.resolve(cache) - } - - if (typeof window === "undefined") { - // server-side - try { - // @ts-ignore - const response = context.ssrRequestBigCommerce(cacheKey, endpoint, "", { - method, - headers: header, - body: bodyReq, - }) - return response - } catch (e) { - console.log(JSON.stringify(e)) - return Promise.reject(e) - } - } else { - // client-side - try { - const result = await _fetch(endpoint, { - method, - credentials: "include", - mode: "cors", - headers: header, - body: JSON.stringify(bodyReq), - cache, - }) - - const body = await result.json() - - if (body.errors) { - throw body.errors[0] - } - return { - status: result.status, - body, - } - } catch (e) { - console.log(JSON.stringify(e)) - if (isBKDFCommerceError(e)) { - throw { - status: e.status || 500, - message: e.message, - query, - } - } - - throw { - error: e, - query, - } - } - } -} diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/mapper.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/mapper.ts deleted file mode 100644 index 3f1b38b..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/mapper.ts +++ /dev/null @@ -1,306 +0,0 @@ -import { BigCommerceSortKeys, BKDFSortKeys, BKDFToBigCommerceSortKeys } from "../../../../config" - -type ProductsList = { productId: number; productData: BigCommerceProduct }[] - -const BKDFFromBigCommerceLineItems = (lineItems: BigCommerceCart["lineItems"]) => { - const { physicalItems, digitalItems, customItems } = lineItems - const cartItemMapper = ({ entityId, quantity, productEntityId }: PhysicalItem | CartCustomItem) => ({ - merchandiseId: productEntityId ? productEntityId.toString() : entityId.toString(), - quantity, - }) - - return [physicalItems, digitalItems, customItems].flatMap((list) => list.map(cartItemMapper)) -} - -const bigCommerceToBKDFOptions = (options: BigCommerceProductOption[]): BKDFProductOption[] => { - return options.map((option) => { - return { - id: option.entityId.toString(), - name: option.displayName.toString(), - values: option.values ? option.values.edges.map(({ node: value }) => value.label) : [], - } - }) -} -const bigCommerceToBKDFVariants = (variants: BigCommerceProductVariant[], productId: number): BKDFProductVariant[] => { - return variants.map((variant) => { - return { - parentId: productId.toString(), - id: variant.entityId.toString(), - sku: variant.sku, - title: "", - availableForSale: variant.isPurchasable, - defaultImage: variant.defaultImage, - selectedOptions: variant.options?.edges.map(({ node: option }) => ({ - name: option.displayName ?? "", - value: option.values.edges.map(({ node }) => node.label)[0] ?? "", - })) || [ - { - name: "", - value: "", - }, - ], - price: { - amount: - variant.prices?.price.value.toString() || variant.prices?.priceRange.max.value.toString() || "0", - currencyCode: variant.prices?.price.currencyCode || variant.prices?.priceRange.max.currencyCode || "", - }, - } - }) -} - -const bigCommerceToBKDFProduct = (product: BigCommerceProduct): BKDFProduct => { - const createBKDFProductImage = (img: { url: string; altText: string }) => { - return { - url: img ? img.url : "", - altText: img ? img.altText : "", - width: 2048, - height: 2048, - } - } - const options = product.productOptions.edges.length - ? bigCommerceToBKDFOptions(product.productOptions.edges.map((item: { node: any }) => item.node)) - : [] - const variants = product.variants.edges.length - ? bigCommerceToBKDFVariants( - product.variants.edges.map((item: { node: any }) => item.node), - product.entityId - ) - : [] - - return { - id: product.entityId.toString(), - sku: product.sku, - categories: product.categories.edges - .map(({ node }) => ({ - name: node.name, - description: node.description, - id: node.entityId, - path: node.path, - segments: node.path.split("/").length, - isKollektion: node.path.includes("kollektion"), - })) - .sort((a, b) => { - if (a.isKollektion && !b.isKollektion) return 1 - if (!a.isKollektion && b.isKollektion) return -1 - - if (b.segments !== a.segments) return b.segments - a.segments - return a.path.localeCompare(b.path) - }) - .map(({ name, description, id, path }) => ({ name, description, id, path })), - handle: product.path, - availableForSale: product.availabilityV2.status === "Available" ? true : false, - title: product.name, - description: product.plainTextDescription || "", - descriptionHtml: product.description ?? "", - options, - priceRange: { - maxVariantPrice: { - amount: product.prices.priceRange.max.value.toString() || product.prices.price.value.toString() || "0", - currencyCode: product.prices.priceRange.max.currencyCode || product.prices.price.currencyCode || "", - }, - minVariantPrice: { - amount: product.prices.priceRange.min.value.toString() || product.prices.price.value.toString() || "0", - currencyCode: product.prices.priceRange.min.currencyCode || product.prices.price.currencyCode || "", - }, - }, - salePrice: { - amount: product.prices.price?.value.toString() || "", - currencyCode: product.prices.price?.currencyCode || "", - }, - retailPrice: { - amount: product.prices.retailPrice?.value.toString() || "", - currencyCode: product.prices.retailPrice?.currencyCode || "", - }, - variants, - reviews: { - avgRating: product?.reviews?.edges?.length - ? product.reviews.edges.map(({ node }) => node.rating).reduce((sum, rating) => sum + rating, 0) / - product.reviews.edges.length - : null, - }, - images: product.images ? product.images.edges.map(({ node: img }) => createBKDFProductImage(img)) : [], - featuredImage: createBKDFProductImage(product.defaultImage), - seo: { - title: product.seo.pageTitle || product.name, - description: product.seo.metaDescription || "", - }, - tags: [product.seo.metaKeywords] || [], - updatedAt: product.createdAt.utc.toString(), - } -} - -const bigCommerceToBKDFProducts = (products: BigCommerceProduct[]) => { - const reshapedProducts = [] - - for (const product of products) { - if (product) { - const reshapedProduct = bigCommerceToBKDFProduct(product) - - if (reshapedProduct) { - reshapedProducts.push(reshapedProduct) - } - } - } - - return reshapedProducts -} - -const bigCommerceToBKDFCartItems = (lineItems: BigCommerceCart["lineItems"], products: ProductsList) => { - const getItemMapper = (products: ProductsList) => { - return (item: PhysicalItem): BKDFCartItem => { - const BKDFProductFallback = { - id: "", - handle: "", - availableForSale: false, - title: "", - description: "", - descriptionHtml: "", - options: [], - priceRange: { - maxVariantPrice: { amount: "", currencyCode: "" }, - minVariantPrice: { amount: "", currencyCode: "" }, - }, - variants: [], - featuredImage: { - url: "", - altText: "", - width: 0, - height: 0, - }, - images: [ - { - url: "", - altText: "", - width: 0, - height: 0, - }, - ], - seo: { title: "", description: "" }, - tags: [], - updatedAt: "", - sku: "", - categories: [], - } - let product: BKDFProduct - - const productData = products.filter( - ({ productId }) => productId === (item as PhysicalItem).productEntityId - )[0]?.productData - - product = productData ? bigCommerceToBKDFProduct(productData) : BKDFProductFallback - return { - id: item.entityId.toString(), // NOTE: used as lineId || lineItemId - quantity: item.quantity, - cost: { - totalAmount: { - amount: item.extendedListPrice.value.toString() || item.listPrice.value.toString() || "0", - currencyCode: item.extendedListPrice.currencyCode || item.listPrice.currencyCode || "", - }, - }, - merchandise: { - id: (item as PhysicalItem).variantEntityId!.toString(), - title: `${item.name}`, - selectedOptions: - product.variants?.find((v) => v.id === (item as PhysicalItem)?.variantEntityId?.toString()) - ?.selectedOptions || [], - product, - }, - } - } - } - const { physicalItems } = lineItems - const line1 = physicalItems.map((item) => getItemMapper(products)(item)) - return [...line1] -} - -const bigCommerceToBKDFCart = (cart: BigCommerceCart, products: ProductsList, checkoutUrl?: string): BKDFCart => { - return { - id: cart.entityId, - checkoutUrl: checkoutUrl ?? "", - cost: { - baseAmount: { amount: String(cart.baseAmount.value), currencyCode: cart.currencyCode }, - discountedAmount: { amount: String(cart.discountedAmount.value), currencyCode: cart.currencyCode }, - amount: { amount: String(cart.amount.value), currencyCode: cart.currencyCode }, - discounts: cart.discounts.map((d) => ({ - entityId: d.entityId, - discountedAmount: { amount: String(d.discountedAmount.value), currencyCode: cart.currencyCode }, - })), - }, - lines: bigCommerceToBKDFCartItems(cart.lineItems, products), - totalQuantity: cart.lineItems.totalQuantity, - } -} - -const bigCommerceToBKDFCollection = (collection: BigCommerceCollection): BKDFCollection => { - if (!collection) { - return { - handle: "", - title: "", - description: "", - seo: { - title: "", - description: "", - }, - updatedAt: "", - path: "", - } - } - - return { - handle: collection.entityId.toString() || collection.name, - title: collection.name, - description: collection.description, - seo: { - title: collection.seo.pageTitle, - description: collection.seo.metaDescription, - }, - updatedAt: new Date().toISOString(), - path: `/search${collection.path}`, - } -} - -export { - bigCommerceToBKDFCart, - bigCommerceToBKDFCollection, - bigCommerceToBKDFProduct, - bigCommerceToBKDFProducts, - BKDFFromBigCommerceLineItems, -} - -export const BKDFToBigCommerceSorting = ( - isReversed: boolean, - sortKey?: string -): keyof typeof BigCommerceSortKeys | null => { - const BKDFSorting: Record = { - RELEVANCE: "RELEVANCE", - BEST_SELLING: "BEST_SELLING", - CREATED_AT: "CREATED_AT", - PRICE: "PRICE", - } - - if (!sortKey || BKDFSorting[sortKey] === undefined) { - return null - } - - if (sortKey === BKDFSortKeys.PRICE) { - return isReversed ? BKDFToBigCommerceSortKeys.PRICE_ON_REVERSE : BKDFToBigCommerceSortKeys.PRICE - } - - return BKDFToBigCommerceSortKeys[sortKey as keyof typeof BKDFSortKeys] -} - -export const bigCommerceToBKDFPageContent = (page: BigCommercePage): BKDFPage => { - return { - id: page.entityId.toString(), - title: page.name, - handle: page.path.slice(1), - body: page.htmlBody ?? "", - bodySummary: page.plainTextSummary ?? "", - seo: { - title: page.seo.pageTitle, - description: page.seo.metaDescription, - }, - createdAt: new Date().toISOString(), - updatedAt: new Date().toISOString(), - } -} diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/mutations/cart.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/mutations/cart.ts deleted file mode 100644 index 4209b17..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/mutations/cart.ts +++ /dev/null @@ -1,26 +0,0 @@ -import { physicalItemFragment } from "../fragments/cart" - -const createCartMutation = /* GraphQL */ ` - mutation createCart($createCartInput: CreateCartInput!) { - cart { - createCart(input: $createCartInput) { - cart { - entityId - amount { - currencyCode - value - } - lineItems { - totalQuantity - physicalItems { - ...physicalItem - } - } - } - } - } - } - ${physicalItemFragment} -` - -export { createCartMutation } diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/mutations/customer.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/mutations/customer.ts deleted file mode 100644 index a7502ea..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/mutations/customer.ts +++ /dev/null @@ -1,153 +0,0 @@ -import { customerFragment } from "../fragments/customer" - -const registerCustomerMutation = /* GraphQL */ ` - mutation registerCustomer($registerCustomerInput: RegisterCustomerInput!) { - customer { - registerCustomer(input: $registerCustomerInput) { - customer { - ...customer - } - errors { - __typename - ... on ValidationError { - message - } - ... on CustomerRegistrationError { - message - } - ... on EmailAlreadyInUseError { - message - } - ... on AccountCreationDisabledError { - message - } - } - } - } - } - ${customerFragment} -` -const updateCustomerMutation = /* GraphQL */ ` - mutation updateCustomer($updateCustomerInput: UpdateCustomerInput!) { - customer { - updateCustomer(input: $updateCustomerInput) { - customer { - ...customer - } - } - } - } - ${customerFragment} -` - -const addCustomerAddressMutation = /* GraphQL */ ` - mutation addCustomerAddress($addCustomerAddressInput: AddCustomerAddressInput!) { - customer { - addCustomerAddress(input: $addCustomerAddressInput) { - customer { - ...customer - } - } - } - } - ${customerFragment} -` - -const updateCustomerAddressMutation = /* GraphQL */ ` - mutation updateCustomerAddress($updateCustomerAddressInput: UpdateCustomerAddressInput!) { - customer { - updateCustomerAddress(input: $updateCustomerAddressInput) { - customer { - ...customer - } - } - } - } - ${customerFragment} -` - -const deleteCustomerAddressMutation = /* GraphQL */ ` - mutation deleteCustomerAddress($deleteCustomerAddressInput: DeleteCustomerAddressInput!) { - customer { - deleteCustomerAddress(input: $deleteCustomerAddressInput) { - customer { - ...customer - } - } - } - } - ${customerFragment} -` - -const changePasswordMutation = /* GraphQL */ ` - mutation changePassword($changePasswordInput: ChangePasswordInput!) { - customer { - changePassword(input: $changePasswordInput) { - customer { - ...customer - } - } - } - } - ${customerFragment} -` - -const requestResetPasswordMutation = /* GraphQL */ ` - mutation requestResetPassword($requestResetPasswordInput: RequestResetPasswordInput!) { - customer { - requestResetPassword(input: $requestResetPasswordInput) { - errors { - __typename - ... on ValidationError { - message - } - } - } - } - } -` - -const resetPasswordMutation = /* GraphQL */ ` - mutation resetPassword($resetPasswordInput: ResetPasswordInput!) { - customer { - resetPassword(input: $resetPasswordInput) { - customer { - ...customer - } - } - } - } - ${customerFragment} -` - -const loginMutation = /* GraphQL */ ` - mutation login($email: String!, $password: String!) { - login(email: $email, password: $password) { - customer { - ...customer - } - } - } - ${customerFragment} -` - -const logoutMutation = /* GraphQL */ ` - mutation logout { - logout { - result - } - } -` - -export { - registerCustomerMutation, - updateCustomerMutation, - addCustomerAddressMutation, - updateCustomerAddressMutation, - deleteCustomerAddressMutation, - changePasswordMutation, - requestResetPasswordMutation, - resetPasswordMutation, - loginMutation, - logoutMutation, -} diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/mutations/wishlist.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/mutations/wishlist.ts deleted file mode 100644 index 01caab1..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/mutations/wishlist.ts +++ /dev/null @@ -1,94 +0,0 @@ -import { productFragment } from "../fragments/product" - -const addWishlistItemsMutation = /* GraphQL */ ` - mutation addWishlistItems($addWishlistItemsInput: AddWishlistItemsInput!) { - wishlist { - addWishlistItems(input: $addWishlistItemsInput) { - result { - items { - edges { - node { - product { - ...product - } - } - } - } - name - } - } - } - } - ${productFragment} -` - -const createWishlistMutation = /* GraphQL */ ` - mutation createWishlist($createWishlistInput: CreateWishlistInput!) { - wishlist { - createWishlist(input: $createWishlistInput) { - result { - entityId - name - } - } - } - } -` - -const deleteWishlistItemsMutation = /* GraphQL */ ` - mutation deleteWishlistItems($deleteWishlistItemsInput: DeleteWishlistItemsInput!) { - wishlist { - deleteWishlistItems(input: $deleteWishlistItemsInput) { - result { - items { - edges { - node { - product { - ...product - } - } - } - } - } - } - } - } - ${productFragment} -` - -const deleteWishlistsMutation = /* GraphQL */ ` - mutation deleteWishlists($deleteWishlistsInput: DeleteWishlistsInput!) { - wishlist { - deleteWishlists(input: $deleteWishlistsInput) - } - } -` - -const updateWishlistMutation = /* GraphQL */ ` - mutation updateWishlist($updateWishlistInput: UpdateWishlistInput!) { - wishlist { - updateWishlist(input: $updateWishlistInput) { - result { - items { - edges { - node { - product { - ...product - } - } - } - } - } - } - } - } - ${productFragment} -` - -export { - addWishlistItemsMutation, - createWishlistMutation, - deleteWishlistItemsMutation, - deleteWishlistsMutation, - updateWishlistMutation, -} diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/product.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/product.ts deleted file mode 100644 index 1855fc6..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/product.ts +++ /dev/null @@ -1,124 +0,0 @@ -import { bigCommerceFetch } from "." - -import { BKDFToBigCommerceSorting, bigCommerceToBKDFProduct, bigCommerceToBKDFProducts } from "./mapper" -import { - getFeaturedProductsQuery, - getNewestProductsQuery, - getPopularProductsQuery, - getProductByPathQuery, - getProductQuery, - getProductsByCategoryQuery, - getProductsRecommedationsQuery, - getStoreProductsQuery, - searchProductsQuery, -} from "./queries/product" - -export async function getBCGraphProducts({ - query, - reverse, - sortKey, -}: { - query?: string - reverse?: boolean - sortKey?: string -}): Promise { - const sort = BKDFToBigCommerceSorting(reverse ?? false, sortKey) - const res = await bigCommerceFetch({ - query: searchProductsQuery, - variables: { - filters: { - searchTerm: query || "", - }, - sort, - }, - }) - - const productList = res.body.data.site.search.searchProducts.products.edges.map((item) => item.node) - - return bigCommerceToBKDFProducts(productList) -} - -export async function getBCGraphProductsByIds(ids: string[]): Promise { - const res = await bigCommerceFetch({ - query: getStoreProductsQuery, - variables: { - entityIds: ids.map((id) => parseInt(id, 10)), - }, - }) - - return bigCommerceToBKDFProducts(res.body.data.site.products.edges.map((item) => item.node)) -} - -export async function getBCGraphProduct(id: string): Promise { - const res = await bigCommerceFetch({ - query: getProductQuery, - variables: { - productId: parseInt(id, 10), - }, - }) - - return bigCommerceToBKDFProduct(res.body.data.site.product) -} - -export async function getBCGraphProductByHandle(handle: string): Promise { - const res = await bigCommerceFetch({ - query: getProductByPathQuery, - variables: { - path: `/${handle}`, - }, - }) - - return bigCommerceToBKDFProduct(res.body.data.site.route.node) -} - -export async function getBCGraphProductsByCategory(categoryId: number): Promise { - const res = await bigCommerceFetch({ - query: getProductsByCategoryQuery, - variables: { - entityId: categoryId, - sortBy: "BEST_SELLING", - hideOutOfStock: false, - first: 20, - }, - }) - const productList = res.body.data.site.category.products.edges.map((item) => item.node) - return bigCommerceToBKDFProducts(productList) -} - -export async function getBCGraphProductRecommendations(productId: string): Promise { - const res = await bigCommerceFetch({ - query: getProductsRecommedationsQuery, - variables: { - productId: productId, - }, - }) - - const productList = res.body.data.site.product.relatedProducts.edges.map((item) => item.node) - - return bigCommerceToBKDFProducts(productList) -} - -export async function getBCGraphBestsellingProducts(): Promise { - const res = await bigCommerceFetch({ - query: getPopularProductsQuery, - }) - - return bigCommerceToBKDFProducts(res.body.data.site.bestSellingProducts.edges.map((item) => item.node)) -} - -export async function getBCGraphNewestProducts(): Promise { - const res = await bigCommerceFetch({ - query: getNewestProductsQuery, - }) - - return bigCommerceToBKDFProducts(res.body.data.site.newestProducts.edges.map((item) => item.node)) -} - -export async function getBCGraphFeaturedProducts(): Promise { - const res = await bigCommerceFetch({ - query: getFeaturedProductsQuery, - variables: {}, - }) - - return bigCommerceToBKDFProducts(res.body.data.site.featuredProducts.edges.map((item) => item.node)) -} diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/cart.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/cart.ts deleted file mode 100644 index d7be928..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/cart.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { physicalItemFragment } from "../fragments/cart" - -export const getCartQuery = /* GraphQL */ ` - query getCart($entityId: String!) { - site { - cart(entityId: $entityId) { - entityId - currencyCode - isTaxIncluded - amount { - currencyCode - value - } - lineItems { - physicalItems { - ...physicalItem - } - totalQuantity - } - createdAt { - utc - } - updatedAt { - utc - } - locale - } - } - } - ${physicalItemFragment} -` - -export const getCheckoutNodeQuery = /* GraphQL */ ` - query getCheckoutNode($nodeId: ID!) { - node(id: $nodeId) { - ... on Checkout { - entityId - subtotal { - currencyCode - value - } - taxTotal { - currencyCode - value - } - grandTotal { - currencyCode - value - } - } - } - } -` diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/category.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/category.ts deleted file mode 100644 index 3c5d9b2..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/category.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { categoryField } from "../fragments/categories" - -export const getCategoryQuery = /* GraphQL */ ` - query getCategory($entityId: Int!) { - site { - category(entityId: $entityId) { - entityId - name - path - description - seo { - metaDescription - metaKeywords - pageTitle - } - } - } - } -` - -export const getStoreCategorieTreeQuery = /* GraphQL */ ` - query CategoryTree4LevelsDeep { - site { - categoryTree { - ...CategoryFields - children { - ...CategoryFields - children { - ...CategoryFields - children { - ...CategoryFields - } - } - } - } - } - } - ${categoryField} -` diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/checkout.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/checkout.ts deleted file mode 100644 index d4b8b23..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/checkout.ts +++ /dev/null @@ -1,20 +0,0 @@ -export const getCheckoutQuery = /* GraphQL */ ` - query getCheckout($entityId: String) { - site { - checkout(entityId: $entityId) { - subtotal { - currencyCode - value - } - taxTotal { - currencyCode - value - } - grandTotal { - currencyCode - value - } - } - } - } -` diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/customer.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/customer.ts deleted file mode 100644 index 0f4a89a..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/customer.ts +++ /dev/null @@ -1,32 +0,0 @@ -import { productFragment } from "../fragments/product" - -const getCustomerQuery = /* GraphQL */ ` - query getCustomer($customerEntityId: Int!) { - customer(entityId: $customerEntityId) { - addressCount - phone - email - entityId - firstName - lastName - wishlists { - edges { - node { - items { - edges { - node { - product { - ...product - } - } - } - } - } - } - } - } - } - ${productFragment} -` - -export { getCustomerQuery } diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/menu.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/menu.ts deleted file mode 100644 index 53c0d1e..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/menu.ts +++ /dev/null @@ -1,21 +0,0 @@ -export const getMenuQuery = /* GraphQL */ ` - query getMenu { - site { - categoryTree { - ...CategoryFields - children { - ...CategoryFields - children { - ...CategoryFields - } - } - } - } - } - fragment CategoryFields on CategoryTreeItem { - hasChildren - entityId - name - path - } -` diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/product.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/product.ts deleted file mode 100644 index 1592054..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/product.ts +++ /dev/null @@ -1,141 +0,0 @@ -import { productFragment } from "../fragments/product" - -export const getProductQuery = /* GraphQL */ ` - query productById($productId: Int!) { - site { - product(entityId: $productId) { - ...product - } - } - } - ${productFragment} -` - -export const getStoreProductsQuery = /* GraphQL */ ` - query getStoreProducts($entityIds: [Int!]) { - site { - products(entityIds: $entityIds) { - edges { - node { - ...product - } - } - } - } - } - ${productFragment} -` - -export const getProductsByCategoryQuery = /* GraphQL */ ` - query getProductsCollection($entityId: Int!, $sortBy: CategoryProductSort, $hideOutOfStock: Boolean, $first: Int) { - site { - category(entityId: $entityId) { - products(sortBy: $sortBy, hideOutOfStock: $hideOutOfStock, first: $first) { - edges { - node { - ...product - } - } - } - } - } - } - ${productFragment} -` - -export const searchProductsQuery = /* GraphQL */ ` - query searchProducts($filters: SearchProductsFiltersInput!, $sort: SearchProductsSortInput) { - site { - search { - searchProducts(filters: $filters, sort: $sort) { - products { - edges { - node { - ...product - } - } - } - } - } - } - } - ${productFragment} -` - -export const getProductsRecommedationsQuery = /* GraphQL */ ` - query getProductsRecommedations($productId: ID) { - site { - product(id: $productId) { - relatedProducts { - edges { - node { - ...product - } - } - } - } - } - } - ${productFragment} -` - -export const getNewestProductsQuery = /* GraphQL */ ` - query getNewestProducts($first: Int) { - site { - newestProducts(first: $first) { - edges { - node { - ...product - } - } - } - } - } - ${productFragment} -` - -export const getFeaturedProductsQuery = /* GraphQL */ ` - query getFeaturedProducts($first: Int) { - site { - featuredProducts(first: $first) { - edges { - node { - ...product - } - } - } - } - } - ${productFragment} -` - -export const getPopularProductsQuery = /* GraphQL */ ` - query bestSellingProducts($first: Int) { - site { - bestSellingProducts(first: $first) { - edges { - node { - ...product - } - } - } - } - } - ${productFragment} -` - -export const getProductByPathQuery = /* GraphQL */ ` - query getProductByHandle($path: String!) { - site { - route(path: $path) { - node { - id - ... on Product { - ...product - } - } - } - } - } - ${productFragment} -` diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/wishlist.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/wishlist.ts deleted file mode 100644 index 8cbb800..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/queries/wishlist.ts +++ /dev/null @@ -1,25 +0,0 @@ -import { productFragment } from "../fragments/product" - -const getWishlistQuery = /* GraphQL */ ` - query getWishlist($customerEntityId: Int!) { - customer(entityId: $customerEntityId) { - wishlists { - edges { - node { - items { - edges { - node { - product { - ...product - } - } - } - } - } - } - } - } - } - ${productFragment} -` -export { getWishlistQuery } diff --git a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/wishlist.ts b/frontend/src/lib/functions/CommerceAPIs/bigCommerce/wishlist.ts deleted file mode 100644 index b50cf04..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/bigCommerce/wishlist.ts +++ /dev/null @@ -1,93 +0,0 @@ -import { bigCommerceFetch } from "." -import { - addWishlistItemsMutation, - createWishlistMutation, - deleteWishlistItemsMutation, - deleteWishlistsMutation, - updateWishlistMutation, -} from "./mutations/wishlist" -import { getWishlistQuery } from "./queries/wishlist" - -export async function addWishlistItems(wishlistDetails: AddWishlistItemsInput): Promise { - const res = await bigCommerceFetch({ - query: addWishlistItemsMutation, - variables: { - addWishlistItemsInput: wishlistDetails, - }, - cache: "no-store", - }) - - const wishlist = res.body.data.wishlist.addWishlistItems.result - if (!wishlist) return null - return wishlist -} - -export async function createWishlist( - wishlistDetails: CreateWishlistInput -): Promise<{ entityId: number; name: string } | null> { - const res = await bigCommerceFetch({ - query: createWishlistMutation, - variables: { - createWishlistInput: wishlistDetails, - }, - cache: "no-store", - }) - - const wishlist = res.body.data.wishlist.createWishlist.result - if (!wishlist) return null - return wishlist -} - -export async function deleteWishlistItems( - wishlistDetails: DeleteWishlistItemsInput -): Promise { - const res = await bigCommerceFetch({ - query: deleteWishlistItemsMutation, - variables: { - deleteWishlistItemsInput: wishlistDetails, - }, - cache: "no-store", - }) - - const wishlist = res.body.data.wishlist.deleteWishlistItems.result - if (!wishlist) return null - return wishlist -} - -export async function deleteWishlists(wishlistDetails: DeleteWishlistsInput): Promise { - const res = await bigCommerceFetch({ - query: deleteWishlistsMutation, - variables: { - deleteWishlistsInput: wishlistDetails, - }, - cache: "no-store", - }) - - return res.body.data.wishlist.deleteWishlists.result -} - -export async function updateWishlist(wishlistDetails: UpdateWishlistInput): Promise { - const res = await bigCommerceFetch({ - query: updateWishlistMutation, - variables: { - updateWishlistInput: wishlistDetails, - }, - cache: "no-store", - }) - - const wishlist = res.body.data.wishlist.updateWishlist.result - if (!wishlist) return null - return wishlist -} - -export async function getWishlist(customerEntityId: number): Promise { - const res = await bigCommerceFetch({ - query: getWishlistQuery, - variables: { customerEntityId }, - cache: "no-store", - }) - - const wishlistData = res.body.data.customer.wishlists.edges.map((edge) => edge.node) - if (!wishlistData) return null - return wishlistData[0] -} diff --git a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/actions.ts b/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/actions.ts deleted file mode 100644 index 5699734..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/actions.ts +++ /dev/null @@ -1,80 +0,0 @@ -import { api } from "../../../../api" -import { validateEmail } from "../../../components/pagebuilder/profile/helper" -import { newNotification } from "../../../store" - -export async function checkIfNewsletterSubscriber(email: string) { - const res = await api( - "action", - { - method: "POST", - }, - { - operation: "checkIfNewsletterSubscriber", - email, - } - ) - return res.data -} - -export async function subscribeToNewsletter(email: string) { - const res = await api( - "action", - { - method: "POST", - }, - { - operation: "subscribeToNewsletter", - email, - } - ) - return res.data -} - -export async function submitNewsletter(email: string, dataProt: boolean) { - if (typeof window !== "undefined") { - if (!dataProt) { - newNotification({ - html: "Bitte akzeptiere die Datenschutzbestimmungen", - class: "error", - }) - - throw new Error("No data protection") - } - if (!email) { - newNotification({ - html: "Bitte gib eine E-Mail Adresse ein", - class: "error", - }) - throw new Error("No email") - } - if (validateEmail(email)) { - newNotification({ - html: "Bitte gib eine gültige E-Mail Adresse ein", - class: "error", - }) - throw new Error("Invalid email") - } - const emailAlreadySubscribed = await checkIfNewsletterSubscriber(email) - if (emailAlreadySubscribed.data) { - newNotification({ - html: "Diese E-Mail Adresse ist bereits für den Newsletter angemeldet", - class: "warning", - }) - throw new Error("Email already subscribed") - } - subscribeToNewsletter(email).then((res) => { - if (res.status === 200) { - newNotification({ - html: "Du hast dich erfolgreich für den Newsletter angemeldet", - class: "success", - }) - } else { - newNotification({ - html: "Ein unerwarteter Fehler ist aufgetreten. Bitte versuche es später erneut oder aktualisiere die Seite. Sollte das Problem weiterhin bestehen, wende dich bitte an den Kundenservice.", - class: "error", - }) - throw new Error("Error subscribing to newsletter") - } - }) - } -} diff --git a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/customer.ts b/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/customer.ts deleted file mode 100644 index 49478f6..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/customer.ts +++ /dev/null @@ -1,415 +0,0 @@ -import { jwtDecode } from "jwt-decode" -import { api } from "../../../../api" -import { login, newNotification } from "../../../store" -import { getQueryParam } from "../../utils" -import { spaNavigate } from "../../../actions" - -export async function requestResetPassword(resetPasswordDetails: RequestResetPasswordInput): Promise { - await api( - "action", - { - method: "POST", - }, - { - operation: "requestPasswordReset", - ...resetPasswordDetails, - } - ) - return true -} - -export async function reportCustomerRecord(customerId: string, record: string): Promise { - await api( - "action", - { - method: "POST", - }, - { - operation: "reportRecord", - customerId, - record, - } - ) - return true -} - -export async function resetPassword(resetPasswordDetails: ResetPasswordInput): Promise { - const token = getQueryParam("token") - if (!token) { - newNotification({ - class: "error", - html: "Kein Token gefunden", - }) - throw new Error("Kein Token gefunden") - } - const tokenDecoded = jwtDecode(token) - const customerTibiId = tokenDecoded?.tibiId - if (!customerTibiId) { - newNotification({ - class: "error", - html: "Keine Kunden-ID im token gefunden", - }) - throw new Error("Keine Kunden-ID im token gefunden") - } - await api( - `bigCommerceCustomer/${customerTibiId}`, - { - method: "PUT", - useJwt: true, - jwtToUse: token, - }, - { - operation: "resetPassword", - ...resetPasswordDetails, - } - ) - return true -} - -export async function changePassword(customerTibiId: string, currentPassword: string, newPassword: string) { - const res = await api( - `bigCommerceCustomer/${customerTibiId}`, - { - method: "PUT", - useJwt: true, - noError: true, - }, - { - operation: "changePassword", - currentPassword, - newPassword, - } - ) - if (res.data.status === 200) { - newNotification({ - class: "success", - html: "Passwort wurde erfolgreich geändert.", - }) - return true - } else { - newNotification({ - class: "error", - html: "Fehler! Bitte prüfe deine Eingabe.", - }) - return false - } -} - -export async function changeEmail(customerTibiId: string, email: string, password: string) { - const res = await api( - `bigCommerceCustomer/${customerTibiId}`, - { - method: "PUT", - useJwt: true, - noError: true, - }, - { - operation: "updateEmail", - email, - password, - } - ) - if (res.data.status === 200) { - newNotification({ - class: "success", - html: "E-Mail wurde erfolgreich geändert.", - }) - return true - } else if (res.data.status === 409) { - newNotification({ - class: "error", - html: "E-Mail Adresse bereits vergeben.", - }) - return false - } else if (res.data.status === 403) { - newNotification({ - class: "error", - html: "Passwort falsch.", - }) - return false - } else { - newNotification({ - class: "error", - html: "Fehler! Bitte prüfe deine Eingabe.", - }) - return false - } -} - -export async function checkUsernameTaken(username: string): Promise { - const res = await api( - `action`, - { - method: "POST", - }, - { - operation: "checkUsernameTaken", - username, - } - ) - return res.data.data -} - -export async function changeUsername(customerTibiId: string, username: string, password: string) { - const res = await api( - `bigCommerceCustomer/${customerTibiId}`, - { - method: "PUT", - useJwt: true, - noError: true, - }, - { - operation: "updateUsername", - username, - password, - } - ) - if (res.data.status === 200) { - newNotification({ - class: "success", - html: "Benutzername wurde erfolgreich geändert.", - }) - return true - } else if (res.data.status === 409) { - newNotification({ - class: "error", - html: "Benutzername bereits vergeben.", - }) - return false - } else if (res.data.status === 403) { - newNotification({ - class: "error", - html: "Passwort falsch.", - }) - return false - } else { - newNotification({ - class: "error", - html: "Fehler! Bitte prüfe deine Eingabe.", - }) - return false - } -} - -export async function postLogin(loginDetails: LoginInput): Promise { - const r = await api( - "login", - { - method: "POST", - }, - loginDetails - ) - - if (r && r.data?.token) { - const _l: Login = { - created: new Date(r.data.created), - tokenString: r.data.token, - tokenData: jwtDecode(r.data.token), - customer: r.data.customer, - } - login.set(_l) - - return _l - } - console.error("Login failed") -} - -export async function postLogout() { - const r = await api( - "login?logout=true", - { - method: "POST", - }, - {} - ) - login.set(null) - newNotification({ - class: "success", - html: "Erfolgreich ausgeloggt.", - }) - spaNavigate("/profile/login") -} - -export async function getCustomer(customerEntityId: string): Promise { - const res = await api(`bigCommerceCustomer/${customerEntityId}`, { - method: "GET", - useJwt: true, - }) - return res.data.data -} - -export async function getCustomerById(customerEntityId: string): Promise { - const res = await api(`bigCommerceCustomer/${customerEntityId}?foreign=true`, { - method: "GET", - }) - return res.data.data -} - -export async function getCustomerByUsername(username: string): Promise { - const res = await api(`bigCommerceCustomer`, { - method: "GET", - - params: { - username, - }, - }) - - return res.data.data -} -export async function updateCustomer( - customerEntityId: string, - customer: Partial -): Promise { - const res = await api( - `bigCommerceCustomer/${customerEntityId}`, - { - method: "PUT", - useJwt: true, - }, - { customer: customer, operation: "updateCustomer" } - ) - if (res.data.status === 200) { - newNotification({ - class: "success", - html: "Kundendaten wurden erfolgreich aktualisiert.", - }) - } else { - newNotification({ - class: "error", - html: "Kundendaten konnten nicht aktualisiert werden.", - }) - } - - return res.data.data -} -export async function updateInternalCustomer(customerEntityId: string, customer: Partial): Promise { - const res = await api( - `bigCommerceCustomer/${customerEntityId}`, - { - method: "PUT", - useJwt: true, - }, - { customer: customer, operation: "updateInternalCustomer" } - ) - if (res.status === 200 || !!res.data.bigCommerceId) { - newNotification({ - class: "success", - html: "Kundendaten wurden erfolgreich aktualisiert.", - }) - - login.update((l) => { - if (l) l.customer = res.data - return l - }) - - return res.data - } else { - newNotification({ - class: "error", - html: "Kundendaten konnten nicht aktualisiert werden.", - }) - } - - return res.data -} - -export async function updateCustomerAddress( - customerEntityId: string, - address: BigCommerceAddress -): Promise { - const res = await api( - `bigCommerceCustomer/${customerEntityId}`, - { - method: "PUT", - useJwt: true, - }, - { address: address, operation: "updateCustomerAddress" } - ).catch((e) => { - newNotification({ - class: "error", - html: "Adresse konnte nicht aktualisiert werden.", - }) - }) - if (res.data.status === 200) { - newNotification({ - class: "success", - html: "Adresse wurde erfolgreich aktualisiert.", - }) - } else { - newNotification({ - class: "error", - html: "Adresse konnte nicht aktualisiert werden.", - }) - } - - return res.data.data -} - -export async function deleteCustomerAddress(customerEntityId: string, addressId: number): Promise { - const res = await api( - `bigCommerceCustomer/${customerEntityId}`, - { - method: "PUT", - useJwt: true, - }, - { addressId: addressId, operation: "deleteCustomerAddress" } - ) - if (res.data.status === 200) { - newNotification({ - class: "success", - html: "Adresse wurde erfolgreich gelöscht.", - }) - return true - } else - newNotification({ - class: "error", - html: "Adresse konnte nicht gelöscht werden.", - }) - return false -} - -export async function addCustomerAddress( - customerEntityId: string, - address: BigCommerceAddress -): Promise { - const res = await api( - `bigCommerceCustomer/${customerEntityId}`, - { - method: "PUT", - useJwt: true, - }, - { address: address, operation: "addCustomerAddress" } - ) - if (res.data.status === 200) { - newNotification({ - class: "success", - html: "Adresse wurde erfolgreich hinzugefügt.", - }) - } else { - newNotification({ - class: "error", - html: "Adresse konnte nicht hinzugefügt werden.", - }) - } - - return res.data.data -} - -export async function getCustomerAddress( - customerEntityId: string, - customerAddressId: number -): Promise { - const res = await api(`bigCommerceCustomer/${customerEntityId}?address=${customerAddressId}`, { - method: "GET", - useJwt: true, - }) - return res.data.data -} - -export async function getCustomerAddresses(customerEntityId: string): Promise { - const res = await api(`bigCommerceCustomer/${customerEntityId}?addresses=true`, { - method: "GET", - useJwt: true, - }) - return res.data.data -} diff --git a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/helpCenter.ts b/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/helpCenter.ts deleted file mode 100644 index 1134695..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/helpCenter.ts +++ /dev/null @@ -1,30 +0,0 @@ -import { api } from "../../../../api" -import { newNotification } from "../../../store" - -export async function getHelpCenterChapters(): Promise { - const res = await api(`helpCenterChapter`, { - method: "GET", - }) - return res.data -} -export async function createContactRequest(contactRequest: ContactRequest, _sId: string, _s: string): Promise { - const contactObj: Contact = { - status: "new", - request: contactRequest, - _sId, - _s, - } - await api( - "contact", - { - method: "POST", - }, - contactObj - ).catch((e) => { - newNotification({ - html: "Ein unerwarteter Fehler ist aufgetreten. Bitte versuche es später erneut oder aktualisiere die Seite. Sollte das Problem weiterhin bestehen, wende dich bitte per E-Mail an den Kundenservice.", - class: "error", - }) - throw e - }) -} diff --git a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/orders.ts b/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/orders.ts deleted file mode 100644 index 303018f..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/orders.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { api } from "../../../../api" - -export async function getTibiRestOrders(): Promise { - const res = await api(`bigCommerceOrder`, { - method: "GET", - useJwt: true, - }) - return res.data.data -} - -export async function getTibiRestOrder(orderId: string): Promise { - const res = await api(`bigCommerceOrder/${orderId}`, { - method: "GET", - useJwt: true, - }) - return res.data.data -} - -export async function getOrderReturnRequests(bigCommerceId: number): Promise { - const res = await api(`orderReturnRequest`, { - method: "GET", - useJwt: true, - params: { - orderId: bigCommerceId, - }, - }) - return res.data -} - -export async function getOrderRevokeRequests(bigCommerceId: number): Promise { - const res = await api(`orderRevokeRequest`, { - method: "GET", - useJwt: true, - params: { - orderId: bigCommerceId, - }, - }) - return res.data -} - -export async function createOrderReturnRequest(returnRequest: OrderReturnRequest) { - return api( - `orderReturnRequest`, - { - method: "POST", - useJwt: true, - }, - returnRequest - ) -} - -export async function deleteOrderReturnRequest(returnRequestId: string) { - return api(`orderReturnRequest/${returnRequestId}`, { - method: "DELETE", - useJwt: true, - }) -} - -export async function createOrderRevokeRequest(orderRevokeRequest: OrderRevokeRequest) { - return api( - `orderRevokeRequest`, - { - method: "POST", - useJwt: true, - }, - orderRevokeRequest - ) -} diff --git a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/product.ts b/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/product.ts deleted file mode 100644 index bdc2b2c..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/product.ts +++ /dev/null @@ -1,12 +0,0 @@ -import { api } from "../../../../api" - -export async function getTibiProduct(bigCommerceId: number): Promise { - const res = await api(`bigCommerceProduct`, { - method: "GET", - params: { - bigCommerceProductId: String(bigCommerceId), - }, - }) - if ("data" in res.data) return res.data.data - else return res.data[0] -} diff --git a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/rating.ts b/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/rating.ts deleted file mode 100644 index 22f75b2..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/rating.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { api } from "../../../../api" - -export async function getTibiRatings(bigCommerceOrderId: number): Promise { - const res = await api(`rating`, { - method: "GET", - useJwt: true, - params: { - orderId: String(bigCommerceOrderId), - }, - }) - return res.data -} -export async function createRating(rating: ProductRating): Promise { - const res = await api( - `rating`, - { - method: "POST", - useJwt: true, - }, - rating - ) - return res.data -} -export async function updateRating(rating: ProductRating): Promise { - const res = await api( - `rating/${rating.id}`, - { - method: "PUT", - useJwt: true, - }, - rating - ) - return res.data -} diff --git a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/store.ts b/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/store.ts deleted file mode 100644 index b559995..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/store.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { api } from "../../../../api" - -export async function checkIfStoreIsOpen(): Promise { - const res = await api(`shopStatus`, { - method: "GET", - }) - return res.data[0] -} diff --git a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/wishlist.ts b/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/wishlist.ts deleted file mode 100644 index e2cbedd..0000000 --- a/frontend/src/lib/functions/CommerceAPIs/tibiEndpoints/wishlist.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { api } from "../../../../api" -import { wishlist } from "../../../store" - -export async function addWishlistEntry(productId: number, variantId: number): Promise { - const res = await api( - `dummyWishlistEntryEndpoint`, - { - method: "post", - useJwt: true, - }, - { - productId: Number(productId), - variantId: Number(variantId), - } - ) - getWishlist().then(wishlist.set) - return res.data.data -} - -export async function removeWishlistEntry(productId: number, variantId: number): Promise { - const res = await api( - `dummyWishlistEntryEndpoint`, - { - method: "post", - useJwt: true, - }, - { - productId, - variantId, - delete: true, - } - ) - getWishlist().then(wishlist.set) - return res.data.data -} - -export async function getWishlist(): Promise { - const res = await api(`dummyWishlistEntryEndpoint`, { - method: "GET", - useJwt: true, - }) - return res.data.data -} diff --git a/frontend/src/lib/functions/helper/SEO.ts b/frontend/src/lib/functions/helper/SEO.ts deleted file mode 100644 index 8b7aa3a..0000000 --- a/frontend/src/lib/functions/helper/SEO.ts +++ /dev/null @@ -1,3 +0,0 @@ -function getProductSEOProps() { - return -} diff --git a/frontend/src/lib/functions/helper/product.ts b/frontend/src/lib/functions/helper/product.ts deleted file mode 100644 index 7136b01..0000000 --- a/frontend/src/lib/functions/helper/product.ts +++ /dev/null @@ -1,192 +0,0 @@ -import OverlayFavoriteList from "../../components/pagebuilder/favorite/OverlayFavoriteList.svelte" -import OverlayCart from "../../components/pagebuilder/cart/OverlayCart.svelte" -import { newNotification, overlays } from "../../store" -import { addCartItem, createCart } from "../CommerceAPIs/bigCommerce/cart" -import { deleteCookie, getCookie, setCookie } from "../utils" -import OverlayCartRecommendations from "../../components/pagebuilder/cart/OverlayCartRecommendations.svelte" - -export function showCartOverlay() { - overlays.update((current) => [ - { id: "cart", content: OverlayCart, title: "Warenkorb", properties: {} }, - { - id: "cartRecommendations", - content: OverlayCartRecommendations, - title: "Weitere Produkte", - properties: {}, - hideTillDispatch: true, - }, - ]) -} -export function showFavoriteOverlay() { - overlays.update((current) => [ - { id: "favorite", content: OverlayFavoriteList, title: "Favoriten", properties: { favorite: true } }, - ]) -} - -async function createCartHelper(selectedVariant: Partial, quantity = 1) { - const { id } = await createCart([ - { merchandiseId: selectedVariant?.id, quantity, productId: selectedVariant.parentId }, - ]) - newNotification({ - class: "success", - html: "Artikel wurde zum Warenkorb hinzugefügt", - }) - if (id) setCookie("cartId", id) - showCartOverlay() -} -export async function addProductToCart(selectedVariant: Partial, quantity = 1) { - const cartId = getCookie("cartId") - - if (!selectedVariant?.id) { - newNotification({ - class: "error", - html: "Fehlende Produktvarianten-ID", - }) - return "Missing product variant ID" - } - - try { - if (cartId) { - try { - await addCartItem(cartId, [ - { merchandiseId: selectedVariant?.id, quantity, productId: selectedVariant.parentId }, - ]) - } catch (e) { - if (e?.data?.status == 404) { - deleteCookie("cartId") - await createCartHelper(selectedVariant, quantity) - } else { - throw e - } - return - } - - newNotification({ - class: "success", - html: "Artikel wurde zum Warenkorb hinzugefügt", - }) - showCartOverlay() - } else { - await createCartHelper(selectedVariant, quantity) - } - } catch (e) { - newNotification({ - class: "error", - html: "Fehler beim Hinzufügen des Artikels zum Warenkorb", - }) - return "Error adding item to cart" - } -} - -function getAllOptionTypes(product: BKDFProduct): OptionNames[] { - const optionTypes = new Set() - for (const variant of product.variants) { - for (const option of variant.selectedOptions) { - optionTypes.add(option.name) - } - } - return Array.from(optionTypes) -} - -export function checkWheterAllOptionsAreSelected(product: BKDFProduct, selectedOptions: BKDFProductSelectedOption[]) { - const optionTypes = getAllOptionTypes(product) - return optionTypes.every((optionType) => - selectedOptions.find((selectedOption) => selectedOption.name === optionType) - ) -} - -export function getUnselectedOptions(product: BKDFProduct, selectedOptions: BKDFProductSelectedOption[]) { - const optionTypes = getAllOptionTypes(product) - return optionTypes.filter( - (optionType) => !selectedOptions.find((selectedOption) => selectedOption.name === optionType) - ) -} - -export function getCurrentVariantGivenSelectedOptions( - product: BKDFProduct, - selectedOptions: BKDFProductSelectedOption[] -) { - return product.variants.find((variant) => - variant.selectedOptions.every( - (selectedOption) => - selectedOptions.find((option) => option.name === selectedOption.name)?.value === selectedOption.value - ) - ) -} -export function getCurrentVariant(product: BKDFProduct, selectedOptions: BKDFProductSelectedOption[]) { - if (checkWheterAllOptionsAreSelected(product, selectedOptions)) { - // @ts-ignore - return getCurrentVariantGivenSelectedOptions(product, selectedOptions) - } - return null -} - -export function getProductVariantsThatDifferInOptions( - options: string[], - variants: BKDFProductVariant[] -): BKDFProductVariant[] { - const result: BKDFProductVariant[] = [] - for (const variant of variants) { - for (const option of options) { - const optionValue = variant.selectedOptions.find((selectedOption) => selectedOption.name === option)?.value - if ( - optionValue && - !result.find( - (resultVariant) => - resultVariant.selectedOptions.find((selectedOption) => selectedOption.name === option) - ?.value === optionValue - ) - ) - result.push(variant) - } - } - - return result.length - ? result.filter((variant, index, self) => self.findIndex((v) => v.id === variant.id) === index) - : [variants[0]] -} -export function getProductVariantsThatDifferInOptionsGivenSelectedOption( - selectedOption: BKDFProductSelectedOption, - variants: BKDFProductVariant[] -): BKDFProductVariant[] { - const result: BKDFProductVariant[] = [] - for (const variant of variants) { - const optionValue = variant.selectedOptions.find((option) => option.name === selectedOption.name)?.value - if (optionValue && optionValue === selectedOption.value) result.push(variant) - } - return result.length - ? result.filter((variant, index, self) => self.findIndex((v) => v.id === variant.id) === index) - : [] -} - -export function mapVariantImages(product: BKDFProduct, variants: BKDFProductVariant[]) { - const variantImageMappedObject: any = {} - for (const variant of variants) { - variantImageMappedObject[variant.id] = product.images.filter((image) => { - try { - return ( - image.altText && - JSON.parse(image.altText).Farbe === - variant.selectedOptions.find((option) => option.name === "Farbe")?.value - ) - } catch (e) { - return false - } - }) - } - return variantImageMappedObject -} -export function getAllSizesForColor(product: BKDFProduct, color: string) { - const sizes = new Set() - for (const variant of product.variants) { - if ( - variant.selectedOptions.find((option) => option.name === "Farbe")?.value === color && - variant.selectedOptions.find((option) => option.name === "Größe")?.value - ) { - sizes.add(variant.selectedOptions.find((option) => option.name === "Größe")?.value) - } - } - return Array.from(sizes) -} -export const getOptionValues = (product: BKDFProduct, optionName: OptionNames) => - product?.options?.find((o) => o?.name === optionName)?.values || [] diff --git a/frontend/src/lib/functions/type-guards.ts b/frontend/src/lib/functions/type-guards.ts deleted file mode 100644 index 578bc6a..0000000 --- a/frontend/src/lib/functions/type-guards.ts +++ /dev/null @@ -1,27 +0,0 @@ -export interface BKDFCommerceErrorLike { - status: number - message: Error - cause?: Error -} - -export const isObject = (object: unknown): object is Record => { - return typeof object === "object" && object !== null && !Array.isArray(object) -} - -export const isBKDFCommerceError = (error: unknown): error is BKDFCommerceErrorLike => { - if (!isObject(error)) return false - - if (error instanceof Error) return true - - return findError(error) -} - -function findError(error: T): boolean { - if (Object.prototype.toString.call(error) === "[object Error]") { - return true - } - - const prototype = Object.getPrototypeOf(error) as T | null - - return prototype === null ? false : findError(prototype) -} diff --git a/frontend/src/lib/functions/uploadProcess.ts b/frontend/src/lib/functions/uploadProcess.ts deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/src/lib/store.ts b/frontend/src/lib/store.ts index 96904c3..192cf4f 100644 --- a/frontend/src/lib/store.ts +++ b/frontend/src/lib/store.ts @@ -135,16 +135,9 @@ login.subscribe((l) => { email: l?.customer?.email || l?.tokenData?.email || "anonymous", }) }) -export const wishlist = writable(null) export const modules = writable([]) -export const loadingStore = writable({ active: false, loaded: 0, total: 0 }) -export const shopStatus = writable({ - status: "open", - password: "", - loggedIn: false, -}) + export const backgroundImages = writable<{ standard?: string }>({}) -export const selfImprovementChapters = writable([]) export const isMobile = writable(false) export const actionApproval = writable(null) diff --git a/frontend/src/routes/Cart.svelte b/frontend/src/routes/Cart.svelte deleted file mode 100644 index e69de29..0000000 diff --git a/frontend/src/routes/HelpCenter.svelte b/frontend/src/routes/HelpCenter.svelte deleted file mode 100644 index 2caa9f2..0000000 --- a/frontend/src/routes/HelpCenter.svelte +++ /dev/null @@ -1,89 +0,0 @@ - - - - -
    -
    - {#if location.path.toLowerCase() == "/helpcenter" || location.path.toLowerCase() == "/helpcenter/"} - -
      - {#if loading} - - {:else if chapters} - {#each chapters as chapter} - - {/each} - {:else} -

      Es wurden keine Kapitel gefunden.

      - {/if} -
    - {:else} - - {/if} -
    -
    - - - diff --git a/frontend/src/routes/KrassKraftChapter.svelte b/frontend/src/routes/KrassKraftChapter.svelte deleted file mode 100644 index badd780..0000000 --- a/frontend/src/routes/KrassKraftChapter.svelte +++ /dev/null @@ -1,27 +0,0 @@ - - -
    - {#if $location.path.includes("challenge")} - - {:else if chapter} - - {/if} -
    - - diff --git a/frontend/src/routes/Product.svelte b/frontend/src/routes/Product.svelte deleted file mode 100644 index a1dcc51..0000000 --- a/frontend/src/routes/Product.svelte +++ /dev/null @@ -1,75 +0,0 @@ - - -{#if product} - - - - - - - - -{:else} - -{/if} - - diff --git a/frontend/src/routes/Products.svelte b/frontend/src/routes/Products.svelte deleted file mode 100644 index 8d45f22..0000000 --- a/frontend/src/routes/Products.svelte +++ /dev/null @@ -1,119 +0,0 @@ - - -{#if categoryId} - -{/if} - - -

    -

    {products.length} Produkte

    -
    - -
    - -
    -
    -
      - {#each products as product} - - {/each} -
    -
    - - diff --git a/frontend/src/routes/Profile.svelte b/frontend/src/routes/Profile.svelte deleted file mode 100644 index e65dcc1..0000000 --- a/frontend/src/routes/Profile.svelte +++ /dev/null @@ -1,7 +0,0 @@ - diff --git a/frontend/src/routes/PublicProfile.svelte b/frontend/src/routes/PublicProfile.svelte deleted file mode 100644 index 5d99406..0000000 --- a/frontend/src/routes/PublicProfile.svelte +++ /dev/null @@ -1,135 +0,0 @@ - - - - -
    -
    - {#if loading} - - {:else if cs} -

    - {cs.username} -

    - - - - {:else} -

    Profil wurde nicht gefunden!

    - {/if} -
    -
    - - diff --git a/frontend/src/routes/RatingConfirm.svelte b/frontend/src/routes/RatingConfirm.svelte deleted file mode 100644 index 3a78eae..0000000 --- a/frontend/src/routes/RatingConfirm.svelte +++ /dev/null @@ -1,26 +0,0 @@ - - -
    -
    -
    {$_("ratings.rating")}
    -

    {$_("ratings.thanks")}

    - -
    -

    - {@html $_("ratings.rating-confirm")} -

    - zurück -
    -
    -
    diff --git a/frontend/src/routes/RedirectToPublicProfile.svelte b/frontend/src/routes/RedirectToPublicProfile.svelte deleted file mode 100644 index 1f2bc96..0000000 --- a/frontend/src/routes/RedirectToPublicProfile.svelte +++ /dev/null @@ -1,14 +0,0 @@ - - - diff --git a/package.json b/package.json index 586b936..11a8bd4 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,21 @@ { - "name": "binkrassdufass", + "name": "renz-shop-2020", "version": "1.0.0", - "main": "README.md", - "repository": "https://gitbase.de/cms/tibi_starter", - "author": "Robin Grenzdörfer", - "license": "MIT", - "packageManager": "yarn@3.2.4", + "main": "frontend/src/index.ts", + "author": "Webmakers GmbH", + "private": true, + "license": "", "scripts": { "validate": "svelte-check && tsc --noEmit", "dev": "node scripts/esbuild-wrapper.js watch", "start": "node scripts/esbuild-wrapper.js start", "start:ssr": "SSR=1 node scripts/esbuild-wrapper.js start", + "start:remoteapi": "API_BASE=https://dev.renzshop.testversion.online/api node scripts/esbuild-wrapper.js start", + "docker:start": "docker compose -f docker-compose-local.yml up; docker compose -f docker-compose-local.yml down", + "docker:up": "docker compose -f docker-compose-local.yml up -d", + "docker:down": "docker compose -f docker-compose-local.yml down", + "docker:logs": "docker compose -f docker-compose-local.yml logs -f", + "docker:yarnupgrade": "docker compose -f docker-compose-local.yml run --rm yarnstart sh -c 'cd /data && yarn upgrade-interactive'", "build": "node scripts/esbuild-wrapper.js build", "build:admin": "node scripts/esbuild-wrapper.js build esbuild.config.admin.js", "build:legacy": "node scripts/esbuild-wrapper.js build esbuild.config.legacy.js && babel _temp/index.js -o _temp/index.babeled.js && esbuild _temp/index.babeled.js --outfile=frontend/dist/index.es5.js --target=es5 --bundle --minify --sourcemap", @@ -19,56 +24,71 @@ "upload:sourcemaps": "scripts/upload-sourcemaps.sh" }, "devDependencies": { - "@babel/cli": "^7.24.1", - "@babel/core": "^7.24.4", - "@babel/preset-env": "^7.24.4", - "@playwright/test": "^1.45.0", + "@babel/cli": "^7.27.2", + "@babel/core": "^7.27.1", + "@babel/plugin-transform-async-to-generator": "^7.27.1", + "@babel/preset-env": "^7.27.2", "@tsconfig/svelte": "^5.0.4", - "@types/lodash": "^4.17.0", - "@types/node": "^20.14.9", - "@typescript-eslint/parser": "^5.0.1", - "browser-sync": "^3.0.2", - "chokidar": "^3.6.0", + "@types/lodash": "^4.17.17", + "browser-sync": "^3.0.4", + "chokidar": "^4.0.3", "connect-history-api-fallback": "^2.0.0", - "esbuild": "^0.20.2", - "esbuild-svelte": "^0.8.0", - "eslint": "^8.52.0", - "fluent-svelte": "^1.6.0", - "http-proxy-middleware": "^3.0.0", - "less": "^4.2.0", - "live-server": "^1.2.2", - "mdi-svelte": "^1.1.2", + "copy-dir": "^1.3.0", + "esbuild": "^0.25.4", + "esbuild-svelte": "^0.9.2", + "http-proxy-middleware": "^3.0.5", + "less": "^4.3.0", "morgan": "^1.10.0", "node-fetch": "^3.3.2", - "p-debounce": "^4.0.0", - "postcss": "^8.4.31", - "prettier": "^2.8.4", - "prettier-plugin-svelte": "^2.9.0", - "sass": "^1.69.5", - "svelte": "^4.2.3", - "svelte-check": "^3.6.0", - "svelte-hmr": "^0.15.3", + "postcss": "^8.5.3", + "prettier": "^3.5.3", + "prettier-plugin-svelte": "^3.4.0", + "sass": "^1.89.0", + "svelte": "^5.32.1", + "svelte-check": "^4.2.1", + "svelte-lazy": "^1.2.11", "svelte-loading-spinners": "^0.3.6", - "svelte-material-icons": "^3.0.5", - "svelte-preprocess": "^5.1.0", + "svelte-preprocess": "^6.0.3", "svelte-preprocess-esbuild": "^3.0.1", - "swiper": "^9.2.0", - "tslib": "^2.6.2", - "typescript": "^4.4.4" + "svelte-scrollto": "^0.2.0", + "tslib": "^2.8.1", + "typescript": "^5.8.3" }, "dependencies": { "@mdi/js": "^7.4.47", - "@sentry/cli": "^2.31.0", - "@sentry/svelte": "^7.109.0", - "core-js": "3.33.2", - "cryptcha": "ssh://git@gitbase.de:2222/cms/cryptcha.git", + "@okrad/svelte-progressbar": "^2.2.0", + "@paypal/paypal-js": "^8.2.0", + "@sentry/cli": "^2.45.0", + "@sentry/svelte": "^9.22.0", + "@splidejs/svelte-splide": "^0.2.9", + "@tiptap/core": "^2.22.3", + "@tiptap/extension-color": "^2.22.3", + "@tiptap/extension-image": "^2.25.0", + "@tiptap/extension-paragraph": "^2.25.0", + "@tiptap/extension-placeholder": "^2.22.3", + "@tiptap/pm": "^2.22.3", + "@tiptap/starter-kit": "^2.22.3", + "@types/p-debounce": "^1.0.1", + "animejs": "^4.0.2", + "browser-image-compression": "^2.0.2", + "core-js": "3.42.0", + "cryptcha": "ssh://git@gitbase.de:2222/cms/cryptcha.git#commit=3b7eb945b62669bfed6cdf4e190824eaea515487", + "esbuild-plugin-copy": "^2.1.1", + "flatpickr": "^4.6.13", "jwt-decode": "^4.0.0", + "lodash": "^4.17.21", + "mdi-svelte": "^1.1.2", + "object-hash": "^3.0.0", "p-debounce": "^4.0.0", - "playwright": "^1.45.0", + "progressbar.js": "^1.1.1", "resize-observer-polyfill": "^1.5.1", - "simplebar": "^6.2.7", - "svelte-select": "^5.7.0", - "vanillajs-datepicker": "^1.3.4", - "video.js": "^8.17.3" - } + "simplebar": "^6.3.1", + "svelte-i18n": "^4.0.1", + "svelte-markdown": "^0.4.1", + "svelte-material-icons": "^3.0.5", + "svelte-range-slider-pips": "4", + "svelte-select": "^5.8.3", + "video.js": "^8.23.3" + }, + "packageManager": "yarn@3.2.0" } diff --git a/playwright.config.ts b/playwright.config.ts deleted file mode 100644 index 4a501ea..0000000 --- a/playwright.config.ts +++ /dev/null @@ -1,78 +0,0 @@ -import { defineConfig, devices } from '@playwright/test'; - -/** - * Read environment variables from file. - * https://github.com/motdotla/dotenv - */ -// import dotenv from 'dotenv'; -// dotenv.config({ path: path.resolve(__dirname, '.env') }); - -/** - * See https://playwright.dev/docs/test-configuration. - */ -export default defineConfig({ - testDir: './tests', - /* Run tests in files in parallel */ - fullyParallel: true, - /* Fail the build on CI if you accidentally left test.only in the source code. */ - forbidOnly: !!process.env.CI, - /* Retry on CI only */ - retries: process.env.CI ? 2 : 0, - /* Opt out of parallel tests on CI. */ - workers: process.env.CI ? 1 : undefined, - /* Reporter to use. See https://playwright.dev/docs/test-reporters */ - reporter: 'html', - /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ - use: { - /* Base URL to use in actions like `await page.goto('/')`. */ - // baseURL: 'http://127.0.0.1:3000', - - /* Collect trace when retrying the failed test. See https://playwright.dev/docs/trace-viewer */ - trace: 'on-first-retry', - }, - - /* Configure projects for major browsers */ - projects: [ - { - name: 'chromium', - use: { ...devices['Desktop Chrome'] }, - }, - - { - name: 'firefox', - use: { ...devices['Desktop Firefox'] }, - }, - - { - name: 'webkit', - use: { ...devices['Desktop Safari'] }, - }, - - /* Test against mobile viewports. */ - // { - // name: 'Mobile Chrome', - // use: { ...devices['Pixel 5'] }, - // }, - // { - // name: 'Mobile Safari', - // use: { ...devices['iPhone 12'] }, - // }, - - /* Test against branded browsers. */ - // { - // name: 'Microsoft Edge', - // use: { ...devices['Desktop Edge'], channel: 'msedge' }, - // }, - // { - // name: 'Google Chrome', - // use: { ...devices['Desktop Chrome'], channel: 'chrome' }, - // }, - ], - - /* Run your local dev server before starting the tests */ - // webServer: { - // command: 'npm run start', - // url: 'http://127.0.0.1:3000', - // reuseExistingServer: !process.env.CI, - // }, -}); diff --git a/playwright/example.test.js b/playwright/example.test.js deleted file mode 100644 index a978b08..0000000 --- a/playwright/example.test.js +++ /dev/null @@ -1,7 +0,0 @@ -const { test, expect } = require("@playwright/test") - -test("basic test", async ({ page }) => { - await page.goto("https://example.com") - const title = await page.title() - expect(title).toBe("Example Domain") -}) diff --git a/printfulguide.md b/printfulguide.md deleted file mode 100644 index 5190ff7..0000000 --- a/printfulguide.md +++ /dev/null @@ -1,9 +0,0 @@ - -Wenn in bigcommerce pordukte weitere varianten bekommen (Bspw. farbe...), dann müssen die manuell synchronisiert werden, da es ja zwei unterschiedliche produkte in printful sind - -Bei QR code produkten synchronisierung nicht vornehmen, und das in der Bestellung dann per hand mappen, da der QR code ja immer ein anderer ist. - -wenn order returned wird: -status auf approved & label hinterlegen -wenn angekommen, in bigcommerce jeweiligen produkte refunden / order -order return request status updaten \ No newline at end of file diff --git a/svelte.config.js b/svelte.config.js index 3012d41..ff1d48d 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,6 +1,5 @@ const { typescript } = require("svelte-preprocess-esbuild") const sveltePreprocess = require("svelte-preprocess") - module.exports = { preprocess: [ typescript({ @@ -8,7 +7,6 @@ module.exports = { }), sveltePreprocess({ sourceMap: true, - //postcss: true, typescript: false, scss: { includePaths: ["frontend/src/theme"], diff --git a/tests-examples/demo-todo-app.spec.ts b/tests-examples/demo-todo-app.spec.ts deleted file mode 100644 index 8641cb5..0000000 --- a/tests-examples/demo-todo-app.spec.ts +++ /dev/null @@ -1,437 +0,0 @@ -import { test, expect, type Page } from '@playwright/test'; - -test.beforeEach(async ({ page }) => { - await page.goto('https://demo.playwright.dev/todomvc'); -}); - -const TODO_ITEMS = [ - 'buy some cheese', - 'feed the cat', - 'book a doctors appointment' -] as const; - -test.describe('New Todo', () => { - test('should allow me to add todo items', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - // Create 1st todo. - await newTodo.fill(TODO_ITEMS[0]); - await newTodo.press('Enter'); - - // Make sure the list only has one todo item. - await expect(page.getByTestId('todo-title')).toHaveText([ - TODO_ITEMS[0] - ]); - - // Create 2nd todo. - await newTodo.fill(TODO_ITEMS[1]); - await newTodo.press('Enter'); - - // Make sure the list now has two todo items. - await expect(page.getByTestId('todo-title')).toHaveText([ - TODO_ITEMS[0], - TODO_ITEMS[1] - ]); - - await checkNumberOfTodosInLocalStorage(page, 2); - }); - - test('should clear text input field when an item is added', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - // Create one todo item. - await newTodo.fill(TODO_ITEMS[0]); - await newTodo.press('Enter'); - - // Check that input is empty. - await expect(newTodo).toBeEmpty(); - await checkNumberOfTodosInLocalStorage(page, 1); - }); - - test('should append new items to the bottom of the list', async ({ page }) => { - // Create 3 items. - await createDefaultTodos(page); - - // create a todo count locator - const todoCount = page.getByTestId('todo-count') - - // Check test using different methods. - await expect(page.getByText('3 items left')).toBeVisible(); - await expect(todoCount).toHaveText('3 items left'); - await expect(todoCount).toContainText('3'); - await expect(todoCount).toHaveText(/3/); - - // Check all items in one call. - await expect(page.getByTestId('todo-title')).toHaveText(TODO_ITEMS); - await checkNumberOfTodosInLocalStorage(page, 3); - }); -}); - -test.describe('Mark all as completed', () => { - test.beforeEach(async ({ page }) => { - await createDefaultTodos(page); - await checkNumberOfTodosInLocalStorage(page, 3); - }); - - test.afterEach(async ({ page }) => { - await checkNumberOfTodosInLocalStorage(page, 3); - }); - - test('should allow me to mark all items as completed', async ({ page }) => { - // Complete all todos. - await page.getByLabel('Mark all as complete').check(); - - // Ensure all todos have 'completed' class. - await expect(page.getByTestId('todo-item')).toHaveClass(['completed', 'completed', 'completed']); - await checkNumberOfCompletedTodosInLocalStorage(page, 3); - }); - - test('should allow me to clear the complete state of all items', async ({ page }) => { - const toggleAll = page.getByLabel('Mark all as complete'); - // Check and then immediately uncheck. - await toggleAll.check(); - await toggleAll.uncheck(); - - // Should be no completed classes. - await expect(page.getByTestId('todo-item')).toHaveClass(['', '', '']); - }); - - test('complete all checkbox should update state when items are completed / cleared', async ({ page }) => { - const toggleAll = page.getByLabel('Mark all as complete'); - await toggleAll.check(); - await expect(toggleAll).toBeChecked(); - await checkNumberOfCompletedTodosInLocalStorage(page, 3); - - // Uncheck first todo. - const firstTodo = page.getByTestId('todo-item').nth(0); - await firstTodo.getByRole('checkbox').uncheck(); - - // Reuse toggleAll locator and make sure its not checked. - await expect(toggleAll).not.toBeChecked(); - - await firstTodo.getByRole('checkbox').check(); - await checkNumberOfCompletedTodosInLocalStorage(page, 3); - - // Assert the toggle all is checked again. - await expect(toggleAll).toBeChecked(); - }); -}); - -test.describe('Item', () => { - - test('should allow me to mark items as complete', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - // Create two items. - for (const item of TODO_ITEMS.slice(0, 2)) { - await newTodo.fill(item); - await newTodo.press('Enter'); - } - - // Check first item. - const firstTodo = page.getByTestId('todo-item').nth(0); - await firstTodo.getByRole('checkbox').check(); - await expect(firstTodo).toHaveClass('completed'); - - // Check second item. - const secondTodo = page.getByTestId('todo-item').nth(1); - await expect(secondTodo).not.toHaveClass('completed'); - await secondTodo.getByRole('checkbox').check(); - - // Assert completed class. - await expect(firstTodo).toHaveClass('completed'); - await expect(secondTodo).toHaveClass('completed'); - }); - - test('should allow me to un-mark items as complete', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - // Create two items. - for (const item of TODO_ITEMS.slice(0, 2)) { - await newTodo.fill(item); - await newTodo.press('Enter'); - } - - const firstTodo = page.getByTestId('todo-item').nth(0); - const secondTodo = page.getByTestId('todo-item').nth(1); - const firstTodoCheckbox = firstTodo.getByRole('checkbox'); - - await firstTodoCheckbox.check(); - await expect(firstTodo).toHaveClass('completed'); - await expect(secondTodo).not.toHaveClass('completed'); - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - - await firstTodoCheckbox.uncheck(); - await expect(firstTodo).not.toHaveClass('completed'); - await expect(secondTodo).not.toHaveClass('completed'); - await checkNumberOfCompletedTodosInLocalStorage(page, 0); - }); - - test('should allow me to edit an item', async ({ page }) => { - await createDefaultTodos(page); - - const todoItems = page.getByTestId('todo-item'); - const secondTodo = todoItems.nth(1); - await secondTodo.dblclick(); - await expect(secondTodo.getByRole('textbox', { name: 'Edit' })).toHaveValue(TODO_ITEMS[1]); - await secondTodo.getByRole('textbox', { name: 'Edit' }).fill('buy some sausages'); - await secondTodo.getByRole('textbox', { name: 'Edit' }).press('Enter'); - - // Explicitly assert the new text value. - await expect(todoItems).toHaveText([ - TODO_ITEMS[0], - 'buy some sausages', - TODO_ITEMS[2] - ]); - await checkTodosInLocalStorage(page, 'buy some sausages'); - }); -}); - -test.describe('Editing', () => { - test.beforeEach(async ({ page }) => { - await createDefaultTodos(page); - await checkNumberOfTodosInLocalStorage(page, 3); - }); - - test('should hide other controls when editing', async ({ page }) => { - const todoItem = page.getByTestId('todo-item').nth(1); - await todoItem.dblclick(); - await expect(todoItem.getByRole('checkbox')).not.toBeVisible(); - await expect(todoItem.locator('label', { - hasText: TODO_ITEMS[1], - })).not.toBeVisible(); - await checkNumberOfTodosInLocalStorage(page, 3); - }); - - test('should save edits on blur', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).dblclick(); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill('buy some sausages'); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).dispatchEvent('blur'); - - await expect(todoItems).toHaveText([ - TODO_ITEMS[0], - 'buy some sausages', - TODO_ITEMS[2], - ]); - await checkTodosInLocalStorage(page, 'buy some sausages'); - }); - - test('should trim entered text', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).dblclick(); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill(' buy some sausages '); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Enter'); - - await expect(todoItems).toHaveText([ - TODO_ITEMS[0], - 'buy some sausages', - TODO_ITEMS[2], - ]); - await checkTodosInLocalStorage(page, 'buy some sausages'); - }); - - test('should remove the item if an empty text string was entered', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).dblclick(); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill(''); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Enter'); - - await expect(todoItems).toHaveText([ - TODO_ITEMS[0], - TODO_ITEMS[2], - ]); - }); - - test('should cancel edits on escape', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).dblclick(); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).fill('buy some sausages'); - await todoItems.nth(1).getByRole('textbox', { name: 'Edit' }).press('Escape'); - await expect(todoItems).toHaveText(TODO_ITEMS); - }); -}); - -test.describe('Counter', () => { - test('should display the current number of todo items', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - // create a todo count locator - const todoCount = page.getByTestId('todo-count') - - await newTodo.fill(TODO_ITEMS[0]); - await newTodo.press('Enter'); - - await expect(todoCount).toContainText('1'); - - await newTodo.fill(TODO_ITEMS[1]); - await newTodo.press('Enter'); - await expect(todoCount).toContainText('2'); - - await checkNumberOfTodosInLocalStorage(page, 2); - }); -}); - -test.describe('Clear completed button', () => { - test.beforeEach(async ({ page }) => { - await createDefaultTodos(page); - }); - - test('should display the correct text', async ({ page }) => { - await page.locator('.todo-list li .toggle').first().check(); - await expect(page.getByRole('button', { name: 'Clear completed' })).toBeVisible(); - }); - - test('should remove completed items when clicked', async ({ page }) => { - const todoItems = page.getByTestId('todo-item'); - await todoItems.nth(1).getByRole('checkbox').check(); - await page.getByRole('button', { name: 'Clear completed' }).click(); - await expect(todoItems).toHaveCount(2); - await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[2]]); - }); - - test('should be hidden when there are no items that are completed', async ({ page }) => { - await page.locator('.todo-list li .toggle').first().check(); - await page.getByRole('button', { name: 'Clear completed' }).click(); - await expect(page.getByRole('button', { name: 'Clear completed' })).toBeHidden(); - }); -}); - -test.describe('Persistence', () => { - test('should persist its data', async ({ page }) => { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - for (const item of TODO_ITEMS.slice(0, 2)) { - await newTodo.fill(item); - await newTodo.press('Enter'); - } - - const todoItems = page.getByTestId('todo-item'); - const firstTodoCheck = todoItems.nth(0).getByRole('checkbox'); - await firstTodoCheck.check(); - await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[1]]); - await expect(firstTodoCheck).toBeChecked(); - await expect(todoItems).toHaveClass(['completed', '']); - - // Ensure there is 1 completed item. - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - - // Now reload. - await page.reload(); - await expect(todoItems).toHaveText([TODO_ITEMS[0], TODO_ITEMS[1]]); - await expect(firstTodoCheck).toBeChecked(); - await expect(todoItems).toHaveClass(['completed', '']); - }); -}); - -test.describe('Routing', () => { - test.beforeEach(async ({ page }) => { - await createDefaultTodos(page); - // make sure the app had a chance to save updated todos in storage - // before navigating to a new view, otherwise the items can get lost :( - // in some frameworks like Durandal - await checkTodosInLocalStorage(page, TODO_ITEMS[0]); - }); - - test('should allow me to display active items', async ({ page }) => { - const todoItem = page.getByTestId('todo-item'); - await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check(); - - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - await page.getByRole('link', { name: 'Active' }).click(); - await expect(todoItem).toHaveCount(2); - await expect(todoItem).toHaveText([TODO_ITEMS[0], TODO_ITEMS[2]]); - }); - - test('should respect the back button', async ({ page }) => { - const todoItem = page.getByTestId('todo-item'); - await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check(); - - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - - await test.step('Showing all items', async () => { - await page.getByRole('link', { name: 'All' }).click(); - await expect(todoItem).toHaveCount(3); - }); - - await test.step('Showing active items', async () => { - await page.getByRole('link', { name: 'Active' }).click(); - }); - - await test.step('Showing completed items', async () => { - await page.getByRole('link', { name: 'Completed' }).click(); - }); - - await expect(todoItem).toHaveCount(1); - await page.goBack(); - await expect(todoItem).toHaveCount(2); - await page.goBack(); - await expect(todoItem).toHaveCount(3); - }); - - test('should allow me to display completed items', async ({ page }) => { - await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check(); - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - await page.getByRole('link', { name: 'Completed' }).click(); - await expect(page.getByTestId('todo-item')).toHaveCount(1); - }); - - test('should allow me to display all items', async ({ page }) => { - await page.getByTestId('todo-item').nth(1).getByRole('checkbox').check(); - await checkNumberOfCompletedTodosInLocalStorage(page, 1); - await page.getByRole('link', { name: 'Active' }).click(); - await page.getByRole('link', { name: 'Completed' }).click(); - await page.getByRole('link', { name: 'All' }).click(); - await expect(page.getByTestId('todo-item')).toHaveCount(3); - }); - - test('should highlight the currently applied filter', async ({ page }) => { - await expect(page.getByRole('link', { name: 'All' })).toHaveClass('selected'); - - //create locators for active and completed links - const activeLink = page.getByRole('link', { name: 'Active' }); - const completedLink = page.getByRole('link', { name: 'Completed' }); - await activeLink.click(); - - // Page change - active items. - await expect(activeLink).toHaveClass('selected'); - await completedLink.click(); - - // Page change - completed items. - await expect(completedLink).toHaveClass('selected'); - }); -}); - -async function createDefaultTodos(page: Page) { - // create a new todo locator - const newTodo = page.getByPlaceholder('What needs to be done?'); - - for (const item of TODO_ITEMS) { - await newTodo.fill(item); - await newTodo.press('Enter'); - } -} - -async function checkNumberOfTodosInLocalStorage(page: Page, expected: number) { - return await page.waitForFunction(e => { - return JSON.parse(localStorage['react-todos']).length === e; - }, expected); -} - -async function checkNumberOfCompletedTodosInLocalStorage(page: Page, expected: number) { - return await page.waitForFunction(e => { - return JSON.parse(localStorage['react-todos']).filter((todo: any) => todo.completed).length === e; - }, expected); -} - -async function checkTodosInLocalStorage(page: Page, title: string) { - return await page.waitForFunction(t => { - return JSON.parse(localStorage['react-todos']).map((todo: any) => todo.title).includes(t); - }, title); -} diff --git a/tests/ui/example.spec.ts b/tests/ui/example.spec.ts deleted file mode 100644 index 54a906a..0000000 --- a/tests/ui/example.spec.ts +++ /dev/null @@ -1,18 +0,0 @@ -import { test, expect } from '@playwright/test'; - -test('has title', async ({ page }) => { - await page.goto('https://playwright.dev/'); - - // Expect a title "to contain" a substring. - await expect(page).toHaveTitle(/Playwright/); -}); - -test('get started link', async ({ page }) => { - await page.goto('https://playwright.dev/'); - - // Click the get started link. - await page.getByRole('link', { name: 'Get started' }).click(); - - // Expects page to have a heading with the name of Installation. - await expect(page.getByRole('heading', { name: 'Installation' })).toBeVisible(); -}); diff --git a/types/bigCommerceRestAPITypes.d.ts b/types/bigCommerceRestAPITypes.d.ts deleted file mode 100644 index cefae09..0000000 --- a/types/bigCommerceRestAPITypes.d.ts +++ /dev/null @@ -1,620 +0,0 @@ -interface OAuthConfig { - clientId: string - clientSecret: string - authCallback: string - loginHost?: string -} - -interface RestClientConfig { - storeHash: string - accessToken: string - apiHost?: string - rateLimitConfig?: RateLimitConfig -} - -interface RateLimitStatus { - msToReset: number - nextWindowTime: Date - windowSize: number - requestsRemaining: number - requestsQuota: number -} - -type CallbackParams = { - [key: string]: unknown -} - -interface RateLimitConfig { - minRequestsRemaining: number - enableWait: boolean - callbackParams?: CallbackParams - callback?(params?: CallbackParams): void -} - -interface AuthCallbackQueryParams { - code: string - scope: string - context: string -} - -interface AuthResponsePayload { - access_token: string - scope: string - user: User - context: string - account_uuid: string -} - -interface User { - id: number - username: string - email: string -} - -interface VerifiedJwt { - aud: string - iss: string - iat: number - nbf: number - exp: number - jti: string - sub: string - user: { - id: number - email: string - } - owner: { - id: number - email: string - } - url: string -} - -interface FormField { - name: string - value: string -} - -interface OrderProduct { - name: string - name_customer?: string - name_merchant?: string - quantity: number - price_inc_tax: number - price_ex_tax: number - upc?: string - sku?: string -} - -interface OrderProductOptions { - id?: number - value?: string - display_name?: string - display_name_customer?: string - display_name_merchant?: string - display_value?: string - display_value_merchant?: string - display_value_customer?: string -} - -interface OrderProductsProductOptions extends Required { - option_id: number - order_product_id: number - product_option_id: number - type: string - name: string - display_style: string -} - -interface OrderProductsAppliedDiscounts { - id: string - amount: string - name: string - code: string | null - target: string -} - -type OrderProductsUpdate = Partial> & { - id?: number - product_id?: number - product_options?: OrderProductOptions[] - variant_id?: number - wrapping_name?: string - wrapping_message?: string - wrapping_cost_ex_tax?: number - wrapping_cost_inc_tax?: number -} - -interface OrderBillingAddress { - first_name?: string - last_name?: string - company?: string - street_1?: string - street_2?: string - city?: string - state?: string - zip: string - country?: string - country_iso2?: string - phone?: string - email?: string - form_fields?: FormField[] -} - -interface OrderShipmentItem { - order_product_id: number - product_id: number - quantity: number -} - -interface LinkedResource { - url: string - resource: string -} - -interface OrderStatus extends V2OrderCountResponseBase { - id: number - name: string - system_label: string - custom_label: string - system_description: string - sort_order: number -} -interface OrderShippingAddress { - first_name?: string - last_name?: string - company?: string - street_1?: string - street_2?: string - city?: string - state?: string - zip?: string - country?: string - country_iso2?: string - phone?: string - email?: string - shipping_method?: string -} -interface V2OrderResponseBase { - id: number - statusSetAt: Date - tibiId?: string - status?: PrintfulStates - date_modified: string - date_shipped: string - cart_id: string - status: string - subtotal_tax: string - shipping_cost_tax: string - shipping_cost_tax_class_id: number - handling_cost_tax: string - handling_cost_tax_class_id: number - wrapping_cost_tax: string - wrapping_cost_tax_class_id: number - payment_status: string - store_credit_amount: string - gift_certificate_amount: string - currency_id: number - currency_code: string - currency_exchange_rate: string - default_currency_id: number - default_currency_code: string - store_default_currency_code: string - store_default_to_transactional_exchange_rate: string - coupon_discount: string - shipping_address_count: number - is_email_opt_in: boolean - order_source: string - products: LinkedResource - productObjs?: V2OrderProductsResponseBase[] - shipping_addresses: LinkedResource - shipping_addressObjs?: V2OrderShippingAddressesResponseBase[] - coupons: LinkedResource - status_id: number - base_handling_cost: string - base_shipping_cost: string - base_wrapping_cost: string - billing_address: Required - channel_id: number - customer_id: number - customer_message: string - date_created: string - discount_amount: string - ebay_order_id: string - external_id: string - external_merchant_id: string - external_source: string - geoip_country: string - geoip_country_iso2: string - handling_cost_ex_tax: string - handling_cost_inc_tax: string - ip_address: string - ip_address_v6: string - is_deleted: boolean - items_shipped: number - items_total: number - order_is_digital: boolean - payment_method: string - payment_provider_id: string | number - refunded_amount: string - shipping_cost_ex_tax: string - shipping_cost_inc_tax: string - staff_notes: string - subtotal_ex_tax: string - subtotal_inc_tax: string - tax_provider_id: string - customer_locale: string - total_ex_tax: string - total_inc_tax: string - wrapping_cost_ex_tax: string - wrapping_cost_inc_tax: string - shipments?: PrintfulShipment[] -} - -interface V2OrderRequestBase { - products: OrderProduct[] - shipping_addresses?: OrderShippingAddress[] - base_handling_cost?: string - base_shipping_cost?: string - base_wrapping_cost?: string - billing_address: OrderBillingAddress - channel_id?: number - customer_id?: number - customer_message?: string - date_created?: string - default_currency_code?: string - discount_amount?: string - ebay_order_id?: string - external_id?: string - external_merchant_id?: string - external_source?: string - geoip_country?: string - geoip_country_iso2?: string - handling_cost_ex_tax?: string - handling_cost_inc_tax?: string - ip_address?: string - ip_address_v6?: string - is_deleted?: boolean - items_shipped?: number - items_total?: number - order_is_digital?: boolean - payment_method?: string - payment_provider_id?: string - refunded_amount?: string - shipping_cost_ex_tax?: string - shipping_cost_inc_tax?: string - staff_notes?: string - status_id?: number - subtotal_ex_tax?: string - subtotal_inc_tax?: string - tax_provider_id?: string - customer_locale?: string - total_ex_tax?: string - total_inc_tax?: string - wrapping_cost_ex_tax?: string - wrapping_cost_inc_tax?: string -} - -type V2OrderUpdateRequest = Partial> & { - products?: Partial - billing_address?: Partial -} - -interface V2OrderFiltersBase { - [key: string]: unknown - limit?: number - page?: number -} - -interface V2OrdersListFilters extends V2OrderFiltersBase { - cart_id?: string - channel_id?: number - customer_id?: number - email?: string - is_deleted?: boolean - max_date_created?: string - max_date_modified?: string - max_id?: number - max_total?: number - min_date_created?: string - min_date_modified?: string - min_id?: number - min_total?: number - payment_method?: string - sort?: string - status_id?: number -} - -interface V2OrderTaxesListFilters extends V2OrderFiltersBase { - details?: string -} - -interface V2OrderMessagesListFilters extends V2OrderFiltersBase { - customer_id?: number - is_flagged?: boolean - max_date_created?: string - max_id?: number - min_date_created?: string - min_id?: number - status?: string -} - -interface V2OrderCountResponseBase { - count: number -} - -interface V2OrderCountResponse extends V2OrderCountResponseBase { - statuses: OrderStatus[] -} - -interface V2OrderShipmentsResponseBase { - id: number - order_id: number - customer_id: number - order_address_id: number - date_created: string - tracking_number: string - shipping_method: string - shipping_provider: string - tracking_carrier: string - tracking_link: string - comments: string - billing_address: Required - shipping_address: Required - items: OrderShipmentItem[] -} - -interface V2OrderShippingAddressesResponseBase extends Required { - id: number - order_id: number - items_total: number - items_shipped: number - base_cost: string - cost_ex_tax: string - cost_inc_tax: string - cost_tax: string - cost_tax_class_id: number - base_handling_cost: string - handling_cost_ex_tax: string - handling_cost_inc_tax: string - handling_cost_tax: string - handling_cost_tax_class_id: number - shipping_zone_id: number - shipping_zone_name: string - form_fields: FormField[] - shipping_quotes: LinkedResource -} - -interface V2OrderProductsResponseBase { - id: number - order_id: number - product_id: number - order_address_id: number - name: string - sku: string - type: string - base_price: string - price_ex_tax: string - price_inc_tax: string - price_tax: string - base_total: string - total_ex_tax: string - total_inc_tax: string - total_tax: string - quantity: number - base_cost_price: string - cost_price_inc_tax: string - cost_price_ex_tax: string - weight: number | string - cost_price_tax: string - is_refunded: boolean - refunded_amount: string - return_id: number - wrapping_name: string - base_wrapping_cost: string - wrapping_cost_ex_tax: string - wrapping_cost_inc_tax: string - wrapping_cost_tax: string - wrapping_message: string - quantity_shipped: number - event_name: string - event_date: string - fixed_shipping_cost: string - ebay_item_id: string - ebay_transaction_id: string - option_set_id: number - parent_order_product_id: number - is_bundled_product: boolean - bin_picking_number: string - applied_discounts: OrderProductsAppliedDiscounts[] - product_options: OrderProductsProductOptions[] - external_id: string - upc: string - variant_id: number - name_customer: string - name_merchant: string -} - -interface V2OrderStatusResponseBase { - id: number - name: string - system_label: string - custom_label: string - system_description: string -} - -interface V2OrderShipmentsRequestBodyBase { - order_address_id: number - tracking_number?: string - shiping_method?: string - shipping_provider?: string - tracking_carrier?: string - comments?: string - items: Omit[] -} - -type V2OrderShipmentsUpdateRequest = Partial> - -interface V2OrderCouponsResponseBase { - id: number - coupon_id: number - order_id: number - code: string | null - amount: string | number - type: number - discount: number -} - -interface V2OrderTaxesResponseBase { - id: number - order_id: number - order_address_id: number - tax_rate_id: number - tax_class_id: number - name: string - class: string - rate: string - priority: number - priority_amount: number - line_amount: string - order_product_id: string - line_item_type: "item" | "shipping" | "handling" | "gift-wrapping" -} - -interface V2OrderMessagesResponseBase { - id: number - order_id: number - staff_id: number - customer_id: number - type: string - subject: string - message: string - status: string - is_flagged: boolean - date_created: string - customer: unknown -} -interface V2OrderShippingQuotesResponseBase { - id: string - uuid: string - timestamp: string - shipping_provider_id: string - shipping_provider_quote: [] | Record[] - provider_code: string - carrier_code: string - rate_code: string - rate_id: string - method_id: number -} - -interface ProductImage { - id: number - product_id: number - is_thumbnail: boolean - sort_order: number - description: string - image_file: string - url_zoom: string - url_standard: string - url_thumbnail: string - url_tiny: string - date_modified: string -} -interface RestApiCart { - id: string - parent_id: string | null - customer_id: number - email: string - currency: { - code: string - } - tax_included: boolean - base_amount: number - discount_amount: number - cart_amount: number - coupons: RestApiCoupon[] - discounts: RestApiDiscount[] - line_items: RestApiLineItems - created_time: string - updated_time: string - channel_id: number - locale: string -} - -interface RestApiCoupon { - code: string - id: string - coupon_type: "0" | "1" | "2" | "3" | "4" | "5" - discounted_amount: number -} - -interface RestApiDiscount { - id: string - discounted_amount: number -} - -interface RestApiLineItems { - physical_items: RestApiPhysicalItem[] - digital_items: RestApiItem[] - gift_certificates: RestApiGiftCertificate[] - custom_items: RestApiCustomItem[] -} - -interface RestApiPhysicalItem extends RestApiItem { - variant_id: number - product_id: number - weight: number - dimensions: { - height: number - width: number - depth: number - } -} - -interface RestApiItem { - id: string - sku: string - name: string - quantity: number - is_taxable: boolean - image_url: string - discounts: RestApiDiscount[] - coupon_amount: number - discount_amount: number - original_price: number - list_price: number - sale_price: number - extended_list_price: number - extended_sale_price: number - options: RestApiOption[] - url: string -} - -interface RestApiGiftCertificate { - // Add Gift Certificate specific fields here -} - -interface RestApiCustomItem { - // Add Custom Item specific fields here -} - -interface RestApiOption { - // Add Option specific fields here - gift_wrapping?: { - // Add Gift Wrapping details here - } -} - -interface RestWishlistItem { - id?: number - product_id: number - variant_id: number -} - -interface RestWishlist { - id: number - customer_id: number - is_public: boolean - name: string - items: RestWishlistItem[] -} diff --git a/types/bigCommerceTypes.d.ts b/types/bigCommerceTypes.d.ts deleted file mode 100644 index e52ad01..0000000 --- a/types/bigCommerceTypes.d.ts +++ /dev/null @@ -1,786 +0,0 @@ -type Connection = { - edges: Array> -} - -type Edge = { - node: T -} - -interface Address { - firstName: string - lastName: string - address1: string - address2?: string - city: string - countryCode: string - stateOrProvince: string - phone: string - postalCode: string -} -interface BigCommerceAddress { - address1: string - address2: string - address_type: string - city: string - company: string - country: string - country_code: string - customer_id: number - first_name: string - id: number - last_name: string - phone: string - postal_code: string - state_or_province: string - form_fields: [] -} - -interface RegisterCustomerInput { - firstName?: string - lastName?: string - email: string - password: string - phone?: string - address?: Address -} - -interface BigCommerceRegisterCustomerOperation { - customer: { - registerCustomer: { - input: RegisterCustomerInput - } - } -} - -interface BigCommerceCartOperation { - data: { - site: { - cart: BigCommerceCart - } - } - variables: { - entityId: string - } -} - -interface BigCommerceCreateCartOperation { - data: { - cart: { - createCart: { - cart: BigCommerceCart - } - } - } - variables: { - createCartInput: { - lineItems: CartItem[] - } - } -} - -interface BigCommerceAddToCartOperation { - data: { - cart: { - addCartLineItems: { - cart: BigCommerceCart - } - } - } - variables: { - addCartLineItemsInput: { - cartEntityId: string - data: { - lineItems: CartItem[] - } - } - } -} - -interface BigCommerceDeleteCartItemOperation { - data: { - cart: { - deleteCartLineItem: { - cart: BigCommerceCart - } - } - } - variables: { - deleteCartLineItemInput: { - cartEntityId: string - lineItemEntityId: string - } - } -} - -interface BigCommerceUpdateCartItemOperation { - data: { - cart: { - updateCartLineItem: { - cart: BigCommerceCart - } - } - } - variables: { - updateCartLineItemInput: { - cartEntityId: string - lineItemEntityId: string - data: { - lineItem: CartItem - } - } - } -} - -interface BigCommerceCheckoutOperation { - data: { - site: { - checkout: BigCommerceCheckout - } - } - variables: { - entityId: string - } -} - -interface BigCommerceProductOperation { - data: { - site: { - product: BigCommerceProduct - } - } - variables: { - productId: number - } -} - -interface BigCommerceProductByHandleOperation { - data: { - site: { - route: { - node: BigCommerceProduct - } - } - } - variables: { - path: string - } -} - -interface BigCommerceProductsOperation { - data: { - site: { - products: Connection - } - } - variables: { - entityIds: number[] | [] - } -} - -interface BigCommerceEntityIdOperation { - data: { - site: { - route: { - node: { - __typename: - | "Product" - | "Category" - | "Brand" - | "NormalPage" - | "ContactPage" - | "RawHtmlPage" - | "BlogIndexPage" - entityId: number - } - } - } - } - variables: { - path: string - } -} - -interface WishlistProduct { - addToWishlistUrl: string -} - -interface WishlistItem { - product: WishlistProduct -} - -interface Wishlist { - items: { - edges: { node: WishlistItem }[] - } -} - -interface Customer { - addressCount: number - phone: string - email: string - entityId: number - firstName: string - lastName: string - wishlists: { - edges: { node: Wishlist }[] - } -} - -interface BigCommerceWishlistQueryOperation { - data: { customer: { wishlists: { edges: { node: Wishlist }[] } } } - variables: { customerEntityId: number } -} - -interface BigCommerceCustomerQueryOperation { - data: { customer: Customer } - variables: { customerEntityId: number } -} - -interface BigCommerceRecommendationsOperation { - data: { - site: { - product: { - relatedProducts: Connection - } - } - } - variables: { - productId: number | string - } -} - -interface BigCommerceSearchProductsOperation { - data: { - site: { - search: { - searchProducts: { - products: Connection - } - } - } - } - variables: { - filters: { - searchTerm: string - } - sort: string | null - } -} - -interface BigCommerceMenuOperation { - data: { - site: { - categoryTree: BigCommerceCategoryTreeItem[] - } - } -} - -interface BigCommerceCategoryOperation { - data: { - site: { - categoryTree: BigCommerceCategory[] - } - } - variables: { - entityId: number - } -} - -interface BigCommerceProductsCategoryOperation { - data: { - site: { - category: { - products: Connection - } - } - } - variables: { - entityId: number - hideOutOfStock: boolean - sortBy: string - first: number - } -} - -interface BigCommerceNewestProductsOperation { - data: { - site: { - newestProducts: Connection - } - } - variables: { - first: number - } -} - -interface BigCommerceFeaturedProductsOperation { - data: { - site: { - featuredProducts: Connection - } - } - variables: { - first?: number - } -} - -interface BigCommercePopularProductsOperation { - data: { - site: { - bestSellingProducts: Connection - } - } - variables: { - first: number - } -} - -interface Category { - name: string - path: string - entityId: number - description: string - children: Category[] -} - -interface BigCommerceCategoryOperation { - data: { - site: { - categoryTree: Category[] - } - } -} - -interface BigCommercePageOperation { - data: { - site: { - content: { - page: BigCommercePage - } - } - } - variables: { entityId: number } -} - -interface BigCommercePagesOperation { - data: { - site: { - content: { - pages: Connection - } - } - } -} - -interface BigCommerceCheckout { - subtotal: BigCommerceMoney - grandTotal: BigCommerceMoney - taxTotal: BigCommerceMoney -} - -interface BigCommerceSEO { - pageTitle: string - metaDescription: string - metaKeywords: string -} - -interface BigCommerceCategory { - entityId: number - name: string - path: string - description: string - seo: BigCommerceSEO - children: BigCommerceCategory[] -} - -interface BigCommerceCart { - entityId: string - currencyCode: string - isTaxIncluded: boolean - baseAmount: BigCommerceMoney - discountedAmount: BigCommerceMoney - amount: BigCommerceMoney - discounts: CartDiscount[] - lineItems: CartLineItems - createdAt: { utc: Date } - updatedAt: { utc: Date } - locale: string -} - -interface CartLineItems { - physicalItems: PhysicalItem[] - digitalItems: PhysicalItem[] - customItems: CartCustomItem[] - giftCertificates: CartGiftCertificate[] - totalQuantity: number -} - -interface CartItem { - quantity: number - productEntityId: number - variantEntityId?: number -} - -interface BigCommerceCategoryTreeItem { - name: string - path: string - hasChildren: boolean - entityId: number - children?: BigCommerceCategoryTreeItem[] -} - -interface BigCommercePage { - __typename: "NormalPage" | "ContactPage" | "RawHtmlPage" | "BlogIndexPage" - entityId: number - name: string - isVisibleInNavigation: boolean - seo: BigCommerceSEO - path: string - plainTextSummary?: string - htmlBody?: string -} - -interface BigCommerceMoney { - value: number - currencyCode: string -} - -interface CartDiscount { - entityId: string - discountedAmount: BigCommerceMoney -} - -interface CartGiftCertificatePersonDetails { - name: string - email: string -} - -interface PhysicalItem { - entityId: number - parentEntityId: number | null - productEntityId: number - variantEntityId: number | null - sku: string - name: string - url: string - imageUrl: string | null - brand: string | null - quantity: number - isTaxable: boolean - listPrice: BigCommerceMoney - extendedListPrice: BigCommerceMoney - selectedOptions: { - entityId: number - name: string - value?: string - date?: { utc: Date } - text?: string - number?: string - fileName?: ScrollSetting - }[] - isShippingRequired: boolean -} - -interface CartCustomItem { - entityId: string - productEntityId: undefined - sku: string - name: string - quantity: number - listPrice: BigCommerceMoney - extendedListPrice: BigCommerceMoney -} - -interface CartGiftCertificate { - entityId: number - productEntityId: undefined - name: string - amount: BigCommerceMoney - isTaxable: boolean - message: string - sender: CartGiftCertificatePersonDetails - recipient: CartGiftCertificatePersonDetails -} - -interface BigCommerceProductVariant { - id: number - entityId: number - sku: string - upc: string | null - isPurchasable: boolean - defaultImage: { - url: string - altText: string - } - prices: { - price: BigCommerceMoney - priceRange: { - min: BigCommerceMoney - max: BigCommerceMoney - } - } - options: { - edges: Array<{ - node: { - entityId: number - displayName: string - values: { - edges: Array<{ - node: { - entityId: number - label: string - } - }> - } - } - }> - } -} - -interface BigCommerceProductOption { - __typename: string - entityId: number - displayName: string - isRequired: boolean - displayStyle: string - values: { - edges: Array<{ - node: { - entityId: number - label: string - isDefault: boolean - hexColors: string[] - imageUrl: string | null - isSelected: boolean - } - }> - } -} - -interface BigCommerceProduct { - id: number - entityId: number - sku: string - categories: { - edges: { - node: { - name: string - description: string - path: string - entityId: number - } - }[] - } - upc: string | null - - name: string - brand: { - name: string - } | null - plainTextDescription: string - description: string - availabilityV2: { - status: "Available" | "Unavailable" | "Preorder" - description: string - } - defaultImage: { - url: string - altText: string - } - images: { - edges: Array<{ - node: { - url: string - altText: string - } - }> - } - reviews: { - edges: Array<{ - node: { - rating: number - } - }> - } - seo: BigCommerceSEO - path: string - prices: { - price: BigCommerceMoney - salePrice: BigCommerceMoney | null - retailPrice: BigCommerceMoney | null - priceRange: { - min: BigCommerceMoney - max: BigCommerceMoney - } - } - createdAt: { - utc: Date - } - variants: Connection - productOptions: Connection -} -interface BigCommerceCustomer { - id: number - company: string - first_name: string - last_name: string - email: string - phone: string - store_credit: string - registration_ip_address: string - customer_group_id: number - notes: string - tax_exempt_category: string - authentication?: { - force_password_reset: boolean - new_password: string - } - form_fields: ( - | { - name: "birthday" - value: Date | string - customer_id?: number - } - | { - name: "gender" - value: "male" | "female" - customer_id?: number - } - | { - name: "username" - value: string - customer_id?: number - } - )[] - addresses: { - url: string - resource: string - } -} - -type BigCommerceError = { - __typename: "EmailAlreadyInUseError" - message: string -} - -interface BigCommerceRegisterCustomerOperation { - data: { - customer: { - registerCustomer: { - customer: BigCommerceCustomer - errors?: BigCommerceError[] - } - } - } - variables: { - registerCustomerInput: RegisterCustomerInput - } -} - -interface AddWishlistItemsInput { - entityId: number - items: { - productEntityId: number - }[] -} - -interface CreateWishlistInput { - name: string - isPublic: boolean -} - -interface DeleteWishlistItemsInput { - entityId: number - itemEntityIds: number[] -} - -interface DeleteWishlistsInput { - entityIds: number[] -} - -interface UpdateWishlistInput { - entityId: number - data: { - name: string - } -} - -interface BigCommerceWishlist { - entityId: number - name: string - items: { - edges: { - node: { - product: BigCommerceProduct - } - }[] - } -} - -interface BigCommerceAddWishlistItemsOperation { - data: { - wishlist: { - addWishlistItems: { - result: BigCommerceWishlist - } - } - } - variables: { - addWishlistItemsInput: AddWishlistItemsInput - } -} - -interface BigCommerceCreateWishlistOperation { - data: { - wishlist: { - createWishlist: { - result: { - entityId: number - name: string - } - } - } - } - variables: { - createWishlistInput: CreateWishlistInput - } -} - -interface BigCommerceDeleteWishlistItemsOperation { - data: { - wishlist: { - deleteWishlistItems: { - result: BigCommerceWishlist - } - } - } - variables: { - deleteWishlistItemsInput: DeleteWishlistItemsInput - } -} - -interface BigCommerceDeleteWishlistsOperation { - data: { - wishlist: { - deleteWishlists: { - result: boolean - } - } - } - variables: { - deleteWishlistsInput: DeleteWishlistsInput - } -} - -interface BigCommerceUpdateWishlistOperation { - data: { - wishlist: { - updateWishlist: { - result: BigCommerceWishlist - } - } - } - variables: { - updateWishlistInput: UpdateWishlistInput - } -} diff --git a/types/global.d.ts b/types/global.d.ts index 2ceec3f..08e8b15 100644 --- a/types/global.d.ts +++ b/types/global.d.ts @@ -74,12 +74,6 @@ interface FileField { size: number } -interface TagEntry { - id: string - name: string - color: string -} - interface DummyCartEndpoint { operation: "add" | "update" | "delete" cartId: string diff --git a/types/tibiCommerceRelated.d.ts b/types/tibiCommerceRelated.d.ts deleted file mode 100644 index 3a20040..0000000 --- a/types/tibiCommerceRelated.d.ts +++ /dev/null @@ -1,168 +0,0 @@ -interface LocalProduct { - id: string - bigCommerceSKU: string - bigCommerceId: number - previewImage: FileField - printfulProductId?: string - sizingChart: TSizeChart - forcedWarning: string - ratings?: ProductRating[] -} -type TSizeChart = SizeChart -interface SizeChart { - id: string - imageURL: string - imageDescription: string - generalDescription: string - availableSizes: string[] - columns: { - germanLabelTranslation?: string - label: string - sizes: string[] - }[] -} - -interface CompleteYourLook { - id: string - products: { - productImage: string - productReference: string - imageWidth: number - imageHeight: number - imageTop: number - imageLeft: number - } -} - -interface ProductRatingObject { - quality: number - priceQualityRatio: number - comfort: number - overall: number -} -interface ProductRating { - id?: string - bigcommerceOrderId: number - bigCommerceProductId: number - rating: ProductRatingObject - comment: string - title: string - review_date: Date - status: "pending" | "approved" | "rejected" - bigcommerceReviewId?: string -} - -interface Login { - created: Date - tokenString: string - tokenData: JWTLoginClaims - customer: Customer -} - -interface ServerLogin { - status: 403 | 500 | 200 - customer: Customer - created: Date - token: string - log: boolean -} - -interface SocialMediaLinks { - instagramLink: string - facebookLink: string - twitterLink: string - youtubeLink: string - tiktokLink: string -} - -interface PersonalRecord { - title: string - description: string - priority: number - ageAtRecording: number - recording: string | FileField - thumbnail: string | FileField -} - -interface Customer { - username: string - id: string - bigCommerceId: number - email: string - locked: boolean - currentToken: string - socialMediaAccounts: SocialMediaLinks - personalRecords: PersonalRecord[] -} - -interface JWTLoginClaims { - exp?: number - bigCommerceId: number - tibiId: string - email: string -} -interface JWTPwResetClaims { - exp?: number - bigCommerceId: number - tibiId: string - check: string -} - -interface JWTRefreshClaims { - bigCommerceId: number - tibiId: string - r: 1 -} -type PrintfulStates = "draft" | "pending" | "failed" | "canceled" | "inprocess" | "onhold" | "partial" | "fulfilled" - -interface PrintfulShipment { - trackingUrl: string - trackingNumber: string - carrier: string - sentAt: Date -} -interface Order { - status: PrintfulStates - statusSetAt: Date - id: string - cost?: string - bigCommerceId: number - customerBigCommerceId: number - customerTibiId: string - products: { - bigCommerceId: number - tibiId: string - }[] - shipments: PrintfulShipment[] -} - -interface OrderReturnRequest { - updateTime: Date - insertTime: Date - bigCommerceId: number - id?: string - status: "pending" | "approved" | "rejected" | "refunded" | "failed" - returnShppingLabels: { - cost: number - label: FileField - }[] - products: OrderReturnRequestProduct[] -} - -interface OrderReturnRequestProduct { - productId: numberOrderReturnRequestProduct - baseProductId: number - quantity: number - attachedImages: string[] - returnReason: string -} - -interface OrderRevokeRequest { - status: "pending" | "refunded" - bigCommerceId: number - printfulId?: string -} - -interface QRCode { - customer: string -}