Compare commits

..

2 commits

Author SHA1 Message Date
4b12982597 add changeset 2023-09-30 22:22:32 +02:00
292a5bdb0c emails-and-messages redis apl support 2023-09-30 22:03:02 +02:00
13 changed files with 369 additions and 436 deletions

View file

@ -0,0 +1,8 @@
#changelog
---
"apps": minor
---
### Added
- `apps/emails-and-messages/.env.template`: Described the new environment variable and how it works
- `apps/emails-and-messages/src/saleor-app.ts`: Added case "redis" for switch(AplType), which takes advantage of the [RedisAPL PR](https://github.com/saleor/app-sdk/pull/287) I submitted

View file

@ -21,10 +21,10 @@
"@saleor/react-hook-form-macaw": "workspace:*",
"@sentry/nextjs": "7.67.0",
"@tanstack/react-query": "^4.29.19",
"@trpc/client": "10.38.5",
"@trpc/next": "10.38.5",
"@trpc/react-query": "10.38.5",
"@trpc/server": "10.38.5",
"@trpc/client": "10.38.1",
"@trpc/next": "10.38.1",
"@trpc/react-query": "10.38.1",
"@trpc/server": "10.38.1",
"@urql/exchange-auth": "^2.1.4",
"@vitejs/plugin-react": "4.0.4",
"contentful-management": "10.38.3",

View file

@ -18,10 +18,10 @@
"@saleor/macaw-ui": "0.8.0-pre.127",
"@sentry/nextjs": "7.67.0",
"@tanstack/react-query": "4.29.19",
"@trpc/client": "10.38.5",
"@trpc/next": "10.38.5",
"@trpc/react-query": "10.38.5",
"@trpc/server": "10.38.5",
"@trpc/client": "10.38.1",
"@trpc/next": "10.38.1",
"@trpc/react-query": "10.38.1",
"@trpc/server": "10.38.1",
"@urql/exchange-auth": "^2.1.4",
"@vitejs/plugin-react": "4.0.4",
"clsx": "^1.2.1",

View file

@ -7,6 +7,12 @@ APL=
REST_APL_ENDPOINT=
REST_APL_TOKEN=
# To use Redis as an APL store, set APP_API_BASE_URL and REDIS_URL.
# URL is in format redis[s]://[[username][:password]@][host][:port][/db-number],
# so for example redis://alice:foobared@awesome.redis.server:6380
# For saleor-platform, thats: `redis://redis:6379/1`
REDIS_URL=
APP_LOG_LEVEL=info
# Local development variables. When developped locally with Saleor inside docker, these can be set to:
@ -15,4 +21,5 @@ APP_LOG_LEVEL=info
# If developped with tunnels, set this empty, it will fallback to default Next's localhost:3000
# https://docs.saleor.io/docs/3.x/developer/extending/apps/local-app-development
APP_IFRAME_BASE_URL=
APP_API_BASE_URL=
APP_API_BASE_URL=

View file

@ -23,10 +23,10 @@
"@sendgrid/mail": "^7.7.0",
"@sentry/nextjs": "7.67.0",
"@tanstack/react-query": "4.29.19",
"@trpc/client": "10.38.5",
"@trpc/next": "10.38.5",
"@trpc/react-query": "10.38.5",
"@trpc/server": "10.38.5",
"@trpc/client": "10.38.1",
"@trpc/next": "10.38.1",
"@trpc/react-query": "10.38.1",
"@trpc/server": "10.38.1",
"@urql/exchange-auth": "^2.1.4",
"@vitejs/plugin-react": "4.0.4",
"dotenv": "^16.3.1",

View file

@ -1,4 +1,4 @@
import { APL, FileAPL, SaleorCloudAPL, UpstashAPL } from "@saleor/app-sdk/APL";
import { APL, FileAPL, RedisAPL, SaleorCloudAPL, UpstashAPL } from "@saleor/app-sdk/APL";
import { SaleorApp } from "@saleor/app-sdk/saleor-app";
const aplType = process.env.APL ?? "file";
@ -6,6 +6,12 @@ const aplType = process.env.APL ?? "file";
export let apl: APL;
switch (aplType) {
case "redis": {
if (!process.env.REDIS_URL) throw new Error("Missing redis url");
if (!process.env.APP_API_BASE_URL)
throw new Error("Redis relies on APP_API_BASE_URL to store keys, please set env variable");
apl = new RedisAPL(new URL(process.env.REDIS_URL), process.env.APP_API_BASE_URL);
}
case "upstash":
apl = new UpstashAPL();

View file

@ -1,5 +1,7 @@
{
"extends": ["//"],
"extends": [
"//"
],
"$schema": "https://turbo.build/schema.json",
"pipeline": {
"build": {
@ -21,7 +23,8 @@
"NEXT_PUBLIC_SENTRY_DSN",
"SENTRY_ENVIRONMENT",
"APP_IFRAME_BASE_URL",
"APP_API_BASE_URL"
"APP_API_BASE_URL",
"REDIS_URL"
]
}
}

View file

@ -20,10 +20,10 @@
"@saleor/trpc": "workspace:*",
"@sentry/nextjs": "7.67.0",
"@tanstack/react-query": "4.29.19",
"@trpc/client": "10.38.5",
"@trpc/next": "10.38.5",
"@trpc/react-query": "10.38.5",
"@trpc/server": "10.38.5",
"@trpc/client": "10.38.1",
"@trpc/next": "10.38.1",
"@trpc/react-query": "10.38.1",
"@trpc/server": "10.38.1",
"@urql/exchange-auth": "^2.1.4",
"@web-std/file": "^3.0.2",
"eslint": "8.46.0",

View file

@ -22,10 +22,10 @@
"@saleor/webhook-utils": "workspace:*",
"@sentry/nextjs": "7.67.0",
"@tanstack/react-query": "4.29.19",
"@trpc/client": "10.38.5",
"@trpc/next": "10.38.5",
"@trpc/react-query": "10.38.5",
"@trpc/server": "10.38.5",
"@trpc/client": "10.38.1",
"@trpc/next": "10.38.1",
"@trpc/react-query": "10.38.1",
"@trpc/server": "10.38.1",
"@urql/exchange-auth": "^2.1.4",
"@vitejs/plugin-react": "4.0.4",
"dotenv": "^16.3.1",

View file

@ -21,10 +21,10 @@
"@saleor/webhook-utils": "workspace:*",
"@sentry/nextjs": "7.67.0",
"@tanstack/react-query": "4.29.19",
"@trpc/client": "10.38.5",
"@trpc/next": "10.38.5",
"@trpc/react-query": "10.38.5",
"@trpc/server": "10.38.5",
"@trpc/client": "10.38.1",
"@trpc/next": "10.38.1",
"@trpc/react-query": "10.38.1",
"@trpc/server": "10.38.1",
"@types/debug": "^4.1.7",
"@urql/exchange-auth": "^2.1.4",
"algoliasearch": "4.19.1",

View file

@ -22,10 +22,10 @@
"@segment/analytics-node": "^1.1.0",
"@sentry/nextjs": "7.67.0",
"@tanstack/react-query": "^4.29.19",
"@trpc/client": "10.38.5",
"@trpc/next": "10.38.5",
"@trpc/react-query": "10.38.5",
"@trpc/server": "10.38.5",
"@trpc/client": "10.38.1",
"@trpc/next": "10.38.1",
"@trpc/react-query": "10.38.1",
"@trpc/server": "10.38.1",
"@urql/exchange-auth": "^2.1.4",
"@vitejs/plugin-react": "4.0.4",
"graphql": "16.7.1",

View file

@ -20,10 +20,10 @@
"@saleor/react-hook-form-macaw": "workspace:*",
"@sentry/nextjs": "7.67.0",
"@tanstack/react-query": "4.29.19",
"@trpc/client": "10.38.5",
"@trpc/next": "10.38.5",
"@trpc/react-query": "10.38.5",
"@trpc/server": "10.38.5",
"@trpc/client": "10.38.1",
"@trpc/next": "10.38.1",
"@trpc/react-query": "10.38.1",
"@trpc/server": "10.38.1",
"@urql/exchange-auth": "^2.1.4",
"avatax": "^23.7.0",
"dotenv": "^16.3.1",

File diff suppressed because it is too large Load diff