Skip to content

Commit

Permalink
new years cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
djkato committed Jan 3, 2025
1 parent b74eade commit eacd69c
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 71 deletions.
59 changes: 1 addition & 58 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
6 changes: 6 additions & 0 deletions app-template-ui/README.md
Original file line number Diff line number Diff line change
@@ -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/
2 changes: 1 addition & 1 deletion app-template/README.md
Original file line number Diff line number Diff line change
@@ -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/
2 changes: 1 addition & 1 deletion bulk-price-manipulator/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion bulk-price-manipulator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`.

Expand Down
4 changes: 2 additions & 2 deletions sdk/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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%

Expand All @@ -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
17 changes: 14 additions & 3 deletions simple-payment-gateway/README.md
Original file line number Diff line number Diff line change
@@ -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"}`.
5 changes: 0 additions & 5 deletions sitemap-generator/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/

0 comments on commit eacd69c

Please sign in to comment.