From eacd69c3d368e83fad23e3326ad0a381aeb674ff Mon Sep 17 00:00:00 2001 From: djkato Date: Fri, 3 Jan 2025 13:01:55 +0100 Subject: [PATCH] new years cleaning --- README.md | 59 +------------------------------ app-template-ui/README.md | 6 ++++ app-template/README.md | 2 +- bulk-price-manipulator/Cargo.toml | 2 +- bulk-price-manipulator/README.md | 4 ++- sdk/README.md | 4 +-- simple-payment-gateway/README.md | 17 +++++++-- sitemap-generator/README.md | 5 --- 8 files changed, 28 insertions(+), 71 deletions(-) create mode 100644 app-template-ui/README.md diff --git a/README.md b/README.md index b6cc018..f848fb7 100644 --- a/README.md +++ b/README.md @@ -16,64 +16,7 @@ This repo contains the following members: To use on bare-metal, clone this repo and just run build and run the apps. To use with Docker/k8s, you can find prebuilt docker images on the right sidebar next to the code tree under "Packages". -Simply add the package to your `docker-compose.yml`, for example like so: - -```yml -services: - app-payment-gateway: - image: ghcr.io/djkato/saleor-app-simple-payment-gateway:0.1.1 - env_file: - - docker-gateway.env - networks: - - saleor-app-tier - depends_on: - - redis-apl - ports: - - 3001:3000 - - app-sitemap-generator: - image: ghcr.io/djkato/saleor-app-sitemap-generator:1.0.0 - env_file: - - docker-sitemap.env - networks: - - saleor-app-tier - depends_on: - - redis-apl - ports: - - 3002:3000 - volumes: - - sitemaps:/sitemaps - - redis-apl: - image: bitnami/redis:latest - environment: - - ALLOW_EMPTY_PASSWORD=yes - - DISABLE_COMMANDS=FLUSHDB,FLUSHALL,CONFIG - ports: - - 6380:6379 - networks: - - saleor-app-tier - volumes: - - redis-apl:/bitnami/redis/data - -volumes: - redis-apl: - driver: local - driver_opts: - type: none - device: ./temp/volumes/redis/ - o: bind - sitemaps: - driver: local - driver_opts: - type: none - device: ./temp/docker-sitemaps/ - o: bind - -networks: - saleor-app-tier: - driver: bridge -``` +Simply add the package to your `docker-compose.yml`, for example check `docker-compose.yml` file in this repo. and set all necessary env variables according to the `env.example` file. diff --git a/app-template-ui/README.md b/app-template-ui/README.md new file mode 100644 index 0000000..9f867c4 --- /dev/null +++ b/app-template-ui/README.md @@ -0,0 +1,6 @@ +# Unofficial Saleor App Template with UI + +thanks WASM <3 + +To update the saleor schema, you can download it from [here](https://raw.githubusercontent.com/saleor/saleor/main/saleor/graphql/schema.graphql) +To generate typings for events and gql queries, use: https://generator.cynic-rs.dev/ diff --git a/app-template/README.md b/app-template/README.md index 02a223d..9b26bb5 100644 --- a/app-template/README.md +++ b/app-template/README.md @@ -1,4 +1,4 @@ # Unofficial Saleor App Template -To update the saleor schema, you can download it from [here](https://raw.githubusercontent.com/saleor/saleor/main/saleor/graphql/schema.graphql) and put into schema/schema.graphql +To update the saleor schema, you can download it from [here](https://raw.githubusercontent.com/saleor/saleor/main/saleor/graphql/schema.graphql) To generate typings for events and gql queries, use: https://generator.cynic-rs.dev/ diff --git a/bulk-price-manipulator/Cargo.toml b/bulk-price-manipulator/Cargo.toml index 4b17a39..3954f11 100644 --- a/bulk-price-manipulator/Cargo.toml +++ b/bulk-price-manipulator/Cargo.toml @@ -23,7 +23,7 @@ tracing-subscriber.workspace = true tracing-test = "0.2.5" dotenvy.workspace = true axum.workspace = true -saleor-app-sdk = { workspace = true, features = ["file_apl"] } +saleor-app-sdk = { workspace = true, features = ["file_apl", "tracing"] } tower = { workspace = true, features = ["util"] } tower-http = { workspace = true, features = ["fs", "trace"] } surf.workspace = true diff --git a/bulk-price-manipulator/README.md b/bulk-price-manipulator/README.md index be8026c..0681606 100644 --- a/bulk-price-manipulator/README.md +++ b/bulk-price-manipulator/README.md @@ -4,9 +4,11 @@ Only works for a single website. No locale support. **THERE IS NO UNDO! THINK BEFORE YOU COMMIT** +**APP QUERIES FOR ALL PRODUCT VARIANTS (first 99), AND CHANGES ALL VARIANTS PRICES REGARDLESS OF THE EXPRESSION. DON'T DDOS YOURSELF, USE DURING DOWN-TIME!** + To run the expressions, just install the app through dashboard. They run only once per installation (triggered on registering). To retriger, remove and add the app. App uses [evalexpr](https://github.com/ISibboI/evalexpr) for expressions. To learn what expressions are allowed, just check their github. It supports If statements and all the fancy stuff. -To see the supported variables that come from Saleor (eg. `variant.id`), check [src/updater/mod.rs](https://github.com/djkato/saleor-apps-rs/blob/7f5b00057a77dedc2f079cbe574ca99b0b89b5ff/bulk-price-manipulator/src/updater/mod.rs#L226), the strings after "set_value", are the variable names, their value definitions right underneath. +To see the supported variables that come from Saleor (eg. `variant.id`), check `src/updater/mod.rs` in the `create_context_map` function, the strings after "set_value", are the variable names, their value definitions right underneath. For getting the price of a variant, I recommend grabbing it from `variant.current_channel_listing.price.amount`. diff --git a/sdk/README.md b/sdk/README.md index f8a75f4..5b3b43b 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -2,7 +2,7 @@ SDK for building [Saleor Apps](https://github.com/saleor/apps), inspired by The [Official Saleor SDK](https://github.com/saleor/apps) -This repo is very likely to introduce breaking changes as it's very early in development. Made specifically for the [Saleor App Template for Rust](https://github.com/djkato/saleor-apps-rs) +This repo is very likely to introduce breaking changes as it's early in development. Made specifically for the [Saleor App Template for Rust](https://github.com/djkato/saleor-apps-rs) Current Coverage: ~80% @@ -16,4 +16,4 @@ Current Coverage: ~80% ## Usage -Check the git repo for example use in app-template +Check the git repo for example use in app-template or app-template-ui diff --git a/simple-payment-gateway/README.md b/simple-payment-gateway/README.md index 02a223d..1046470 100644 --- a/simple-payment-gateway/README.md +++ b/simple-payment-gateway/README.md @@ -1,4 +1,15 @@ -# Unofficial Saleor App Template +# Simple Payment Gateway -To update the saleor schema, you can download it from [here](https://raw.githubusercontent.com/saleor/saleor/main/saleor/graphql/schema.graphql) and put into schema/schema.graphql -To generate typings for events and gql queries, use: https://generator.cynic-rs.dev/ +Saleor app that acts as a simple payment gateway for payment methods that do not require automatic validation. + +The payment methods are toggleable with env variables. Currently it supports these methods: +- Accreditation +- Cash +- COD (Cash on Delivery) +- Inkaso +- Other +- Transfer + +It also does some simple logic checks to make sure that when delivery method is `ClickAndCollect`/warehouse pickup, `COD` isn't possible, and if it's any other delivery method `Cash` isn't possible. +Availabe payment methods get send during `PaymentGatewayInitialize`, where this gateway returns available payment methods inside the data field. +When checking out with `TransactionInitializeSession`, include the desired payment method in data like `{"payment_method": "method"}`. diff --git a/sitemap-generator/README.md b/sitemap-generator/README.md index fb264fe..a6d1f9e 100644 --- a/sitemap-generator/README.md +++ b/sitemap-generator/README.md @@ -2,8 +2,3 @@ Only works for a single website. No locale support and no sitemap-index. Outputs Only pure sitemap.txt file. Downside is limit of 50 000 links. Upside: Easy to write c: Partially supports relations of objects (Category-product), where the sitemap template can use info from both. - -# Unofficial Saleor App Template - -To update the saleor schema, you can download it from [here](https://raw.githubusercontent.com/saleor/saleor/main/saleor/graphql/schema.graphql) and put into schema/schema.graphql -To generate typings for events and gql queries, use: https://generator.cynic-rs.dev/