Skip to content

Open-source manufacturing ERP, MES and QMS. Quoting, MRP, inventory, shop floor, quality and lot/serial traceability on one Postgres schema, with a REST API and MCP server. Self-host or use Carbon Cloud.

💾 get permissions from redis cache

Brad Barbine13cc428ceac
diff --git a/README.md b/README.md
index a26d0b9491..9cb3733704 100644
--- a/README.md
+++ b/README.md
@@ -6,7 +6,7 @@ This mono-repository contains the source code for the Carbon ERP.
| Package Name | Description |
| ------------ | --------------- |
-| `carbon` | ERP Applicaiton |
+| `carbon` | ERP Application |
| `docs` | Documentation |
### Packages
@@ -18,6 +18,7 @@ This mono-repository contains the source code for the Carbon ERP.
| `@carbon/jest` | Jest preset configuration shared across apps and packages |
| `@carbon/logger` | Shared logger used across apps |
| `@carbon/react` | Shared web-based UI components |
+| `@carbon/redis` | Redis cache client |
| `@carbon/tsconfig` | Shared, extendable tsconfig configuration used across apps and packages |
| `@carbon/utils` | Shared utility functions used across apps and packages |
@@ -26,7 +27,9 @@ This mono-repository contains the source code for the Carbon ERP.
- [Turborepo](https://turbo.build)
- [Remix](https://remix.run)
- [Supabase](https://supabase.com/)
+- [Postgres] (https://postgresql.org/)
- [Chakra UI](https://chakra-ui.com/)
+- [Redis](https://redis.io)
- [Prisma](https://prisma.io/)
## Local Development
@@ -38,7 +41,7 @@ Then download and initialize the repository dependencies.
```bash
$ yarn # install dependencies
-$ yarn db:start # pull and start the database containers
+$ yarn db:start # pull and start the containers
```
Copy the environment variables from the initialization script to an `.env` file:
diff --git a/apps/carbon/app/routes/app.tsx b/apps/carbon/app/routes/app.tsx
index 1c694d1a18..d9ce92dd6f 100644
--- a/apps/carbon/app/routes/app.tsx
+++ b/apps/carbon/app/routes/app.tsx
@@ -6,39 +6,29 @@ import { Outlet, useLoaderData } from "@remix-run/react";
import { useEffect } from "react";
import { IconSidebar, Topbar } from "~/components/Navigation";
import { getSupabase, SupabaseProvider } from "~/lib/supabase";
-import { getPermissionsByClient, getUserByClient } from "~/services/auth";
+import { getPermissions, getUser } from "~/services/users";
import {
destroyAuthSession,
getSessionFlash,
requireAuthSession,
} from "~/services/session";
-import { makePermissionsFromClaims } from "~/services/users";
export async function loader({ request }: LoaderArgs) {
const { accessToken, expiresAt, expiresIn } = await requireAuthSession(
request
);
- // don't create a new client for every request
+ // share a client between requests
const client = getSupabase(accessToken);
// parallelize the requests
- const [sessionFlash, claims, user] = await Promise.all([
+ const [sessionFlash, permissions, user] = await Promise.all([
getSessionFlash(request),
- getPermissionsByClient(client),
- getUserByClient(client),
+ getPermissions(request, client),
+ getUser(request, client),
]);
- if (user?.error) {
- await destroyAuthSession(request);
- }
-
- if (claims?.error || user?.error || claims?.data === null) {
- await destroyAuthSession(request);
- }
-
- const permissions = makePermissionsFromClaims(claims?.data);
- if (permissions === null) {
+ if (!permissions || !user) {
await destroyAuthSession(request);
}
@@ -50,7 +40,7 @@ export async function loader({ request }: LoaderArgs) {
expiresAt,
},
- user: user?.data,
+ user,
permissions,
result: sessionFlash?.result,
},
diff --git a/apps/carbon/app/routes/app.users.employees.tsx b/apps/carbon/app/routes/app.users.employees.tsx
index 0a5ebf7ae2..2209a17a65 100644
--- a/apps/carbon/app/routes/app.users.employees.tsx
+++ b/apps/carbon/app/routes/app.users.employees.tsx
@@ -17,9 +17,9 @@ export async function loader({ request }: LoaderArgs) {
});
const url = new URL(request.url);
- const search = new URLSearchParams(url.search);
- const name = search.get("name");
- const type = search.get("type");
+ const searchParams = new URLSearchParams(url.search);
+ const name = searchParams.get("name");
+ const type = searchParams.get("type");
const [employees, employeeTypes] = await Promise.all([
getEmployees(client, { name, type }),
diff --git a/apps/carbon/app/services/auth/auth.server.ts b/apps/carbon/app/services/auth/auth.server.ts
index f1b02d358c..43a30beec6 100644
--- a/apps/carbon/app/services/auth/auth.server.ts
+++ b/apps/carbon/app/services/auth/auth.server.ts
@@ -1,32 +1,12 @@
-import type { Database } from "@carbon/database";
import { redirect } from "@remix-run/node";
-import type {
- AuthSession as SupabaseAuthSession,
- SupabaseClient,
-} from "@supabase/supabase-js";
+import type { AuthSession as SupabaseAuthSession } from "@supabase/supabase-js";
import { SERVER_URL } from "~/config/env";
import { REFRESH_ACCESS_TOKEN_THRESHOLD } from "~/config/env";
import { getSupabase, getSupabaseAdmin } from "~/lib/supabase";
-import { requireAuthSession, setSessionFlash } from "../session";
-import { makePermissionsFromClaims } from "../users";
+import { requireAuthSession, setSessionFlash } from "~/services/session";
+import { getPermissions } from "~/services/users";
import type { AuthSession } from "./types";
-export async function getUserByClient(client: SupabaseClient<Database>) {
- const {
- data: { user },
- } = await client.auth.getUser();
- return client
- .from("User")
- .select("email, firstName, lastName")
- .eq("email", user?.email)
- .single();
-}
-
-export async function getPermissionsByClient(client: SupabaseClient<Database>) {
- // TODO: map claims to permissions
- return client.rpc("get_my_claims");
-}
-
export async function createEmailAuthAccount(
email: string,
password: string,
@@ -46,36 +26,6 @@ export async function createEmailAuthAccount(
return data.user;
}
-export async function signInWithEmail(email: string, password: string) {
- const { data, error } = await getSupabaseAdmin().auth.signInWithPassword({
- email,
- password,
- });
-
- if (!data.session || error) return null;
-
- return makeAuthSession(data.session);
-}
-
-export async function sendMagicLink(email: string) {
- return getSupabaseAdmin().auth.signInWithOtp({
- email,
- options: {
- emailRedirectTo: `${SERVER_URL}/callback`,
- },
- });
-}
-
-export async function sendInviteByEmail(
- email: string,
- data?: Record<string, unknown>
-) {
- return getSupabaseAdmin().auth.admin.inviteUserByEmail(email, {
- redirectTo: `${SERVER_URL}/callback`,
- data,
- });
-}
-
export async function deleteAuthAccount(userId: string) {
const { error } = await getSupabaseAdmin().auth.admin.deleteUser(userId);
@@ -92,19 +42,26 @@ export async function getAuthAccountByAccessToken(accessToken: string) {
return data.user;
}
-export async function refreshAccessToken(
- refreshToken?: string
-): Promise<AuthSession | null> {
- if (!refreshToken) return null;
+function makeAuthSession(
+ supabaseSession: SupabaseAuthSession | null
+): AuthSession | null {
+ if (!supabaseSession) return null;
- const { data, error } = await getSupabaseAdmin().auth.setSession({
- access_token: "",
- refresh_token: refreshToken,
- });
+ if (!supabaseSession.refresh_token)
+ throw new Error("User should have a refresh token");
- if (!data.session || error) return null;
+ if (!supabaseSession.user?.email)
+ throw new Error("User should have an email");
- return makeAuthSession(data.session);
+ return {
+ accessToken: supabaseSession.access_token,
+ refreshToken: supabaseSession.refresh_token,
+ userId: supabaseSession.user.id,
+ email: supabaseSession.user.email,
+ expiresIn:
+ (supabaseSession.expires_in ?? 3600) - REFRESH_ACCESS_TOKEN_THRESHOLD,
+ expiresAt: supabaseSession.expires_at ?? -1,
+ };
}
export async function requirePermissions(
@@ -121,30 +78,7 @@ export async function requirePermissions(
// early exit if no requiredPermissions are required
if (Object.keys(requiredPermissions).length === 0) return { client };
- // TODO: use redis to cache permissions
- const getMyClaims = await client.rpc("get_my_claims");
-
- if (getMyClaims.error || getMyClaims.data === null) {
- throw redirect(
- "/app",
- await setSessionFlash(request, {
- success: false,
- message: "Failed to parse claims",
- })
- );
- }
-
- const myPermissions = makePermissionsFromClaims(getMyClaims.data);
-
- if (!myPermissions) {
- throw redirect(
- "/app",
- await setSessionFlash(request, {
- success: false,
- message: "Failed to parse claims",
- })
- );
- }
+ const myPermissions = await getPermissions(request, client);
const hasRequiredPermissions = Object.entries(requiredPermissions).every(
([action, permission]) => {
@@ -187,32 +121,55 @@ export async function resetPassword(accessToken: string, password: string) {
return true;
}
-export async function verifyAuthSession(authSession: AuthSession) {
- const authAccount = await getAuthAccountByAccessToken(
- authSession.accessToken
- );
+export async function sendInviteByEmail(
+ email: string,
+ data?: Record<string, unknown>
+) {
+ return getSupabaseAdmin().auth.admin.inviteUserByEmail(email, {
+ redirectTo: `${SERVER_URL}/callback`,
+ data,
+ });
+}
- return Boolean(authAccount);
+export async function sendMagicLink(email: string) {
+ return getSupabaseAdmin().auth.signInWithOtp({
+ email,
+ options: {
+ emailRedirectTo: `${SERVER_URL}/callback`,
+ },
+ });
}
-function makeAuthSession(
- supabaseSession: SupabaseAuthSession | null
-): AuthSession | null {
- if (!supabaseSession) return null;
+export async function signInWithEmail(email: string, password: string) {
+ const { data, error } = await getSupabaseAdmin().auth.signInWithPassword({
+ email,
+ password,
+ });
- if (!supabaseSession.refresh_token)
- throw new Error("User should have a refresh token");
+ if (!data.session || error) return null;
- if (!supabaseSession.user?.email)
- throw new Error("User should have an email");
+ return makeAuthSession(data.session);
+}
- return {
- accessToken: supabaseSession.access_token,
- refreshToken: supabaseSession.refresh_token,
- userId: supabaseSession.user.id,
- email: supabaseSession.user.email,
- expiresIn:
- (supabaseSession.expires_in ?? 3600) - REFRESH_ACCESS_TOKEN_THRESHOLD,
- expiresAt: supabaseSession.expires_at ?? -1,
- };
+export async function refreshAccessToken(
+ refreshToken?: string
+): Promise<AuthSession | null> {
+ if (!refreshToken) return null;
+
+ const { data, error } = await getSupabaseAdmin().auth.setSession({
+ access_token: "",
+ refresh_token: refreshToken,
+ });
+
+ if (!data.session || error) return null;
+
+ return makeAuthSession(data.session);
+}
+
+export async function verifyAuthSession(authSession: AuthSession) {
+ const authAccount = await getAuthAccountByAccessToken(
+ authSession.accessToken
+ );
+
+ return Boolean(authAccount);
}
diff --git a/apps/carbon/app/services/users/users.server.ts b/apps/carbon/app/services/users/users.server.ts
index e37a85d848..64193f9c8c 100644
--- a/apps/carbon/app/services/users/users.server.ts
+++ b/apps/carbon/app/services/users/users.server.ts
@@ -1,4 +1,6 @@
import type { Database, Json } from "@carbon/database";
+import { redis } from "@carbon/redis";
+import { redirect } from "@remix-run/node";
import type { SupabaseClient } from "@supabase/supabase-js";
import { getSupabaseAdmin } from "~/lib/supabase";
import type {
@@ -9,6 +11,7 @@ import type {
User,
} from "~/modules/Users/types";
import { deleteAuthAccount, sendInviteByEmail } from "~/services/auth";
+import { requireAuthSession, setSessionFlash } from "~/services/session";
import type { Result } from "~/types";
export async function createEmployeeAccount(
@@ -185,6 +188,72 @@ export async function getPermissionsByEmployeeType(
.eq("employeeTypeId", employeeTypeId);
}
+function getPermissionCacheKey(userId: string) {
+ return `permissions:${userId}`;
+}
+
+export async function getPermissions(
+ request: Request,
+ client: SupabaseClient<Database>
+) {
+ const { userId } = await requireAuthSession(request);
+
+ let permissions: Record<string, Permission> | null = JSON.parse(
+ (await redis.get(getPermissionCacheKey(userId))) || "null"
+ );
+
+ // if we don't have permissions from redis, get them from the database
+ if (!permissions) {
+ const claims = await getClaimsById(client, userId);
+ if (claims.error || claims.data === null) {
+ throw redirect(
+ "/app",
+ await setSessionFlash(request, {
+ success: false,
+ message: "Failed to parse claims",
+ })
+ );
+ }
+ // convert claims to permissions
+ permissions = makePermissionsFromClaims(claims.data);
+ // store permissions in redis
+
+ await redis.set(getPermissionCacheKey(userId), JSON.stringify(permissions));
+
+ if (!permissions) {
+ throw redirect(
+ "/app",
+ await setSessionFlash(request, {
+ success: false,
+ message: "Failed to parse claims",
+ })
+ );
+ }
+ }
+
+ return permissions;
+}
+
+export async function getUser(
+ request: Request,
+ client: SupabaseClient<Database>
+) {
+ const { userId } = await requireAuthSession(request);
+
+ const user = await getUserById(client, userId);
+ if (user?.error || user?.data === null) {
+ throw redirect(
+ "/app",
+ await setSessionFlash(request, {
+ success: false,
+ message: "Failed to get user",
+ })
+ );
+ }
+
+ return user.data;
+}
+
export async function getUserById(
client: SupabaseClient<Database>,
id: string
@@ -392,6 +461,8 @@ export async function updatePermissions(
};
}
+ await redis.del(getPermissionCacheKey(id));
+
return {
success: true,
message: "Permissions updated",
diff --git a/package.json b/package.json
index 72342ea49a..758f3185f8 100755
--- a/package.json
+++ b/package.json
@@ -13,9 +13,9 @@
"build": "turbo run build",
"build:packages": "turbo run build --filter=./packages/*",
"clean": "turbo run clean && rm -rf node_modules && rm -rf supabase",
- "db:init": "yarn workspace @carbon/database supabase init",
- "db:start": "yarn workspace @carbon/database supabase start",
- "db:kill": "yarn workspace @carbon/database supabase stop",
+ "db:init": "turbo run db:init",
+ "db:start": "turbo run db:start",
+ "db:kill": "turbo run db:kill",
"db:types": "yarn workspace @carbon/database db:types",
"db:migrate": "yarn workspace @carbon/database db:migrate",
"db:migrate:new": "yarn workspace @carbon/database db:migrate:new",
@@ -37,10 +37,14 @@
"predev": "tsx scripts/generate-types.ts"
},
"devDependencies": {
+ "npm-run-all": "^4.1.5",
"prettier": "^2.8.0",
"tsx": "^3.12.1",
"turbo": "^1.6.3",
"supabase": "^1.18.2"
},
- "packageManager": "[email protected]"
+ "packageManager": "[email protected]",
+ "engines": {
+ "node": ">=16"
+ }
}
diff --git a/packages/carbon-database/package.json b/packages/carbon-database/package.json
index 794f3ce806..b0e96a2c6c 100644
--- a/packages/carbon-database/package.json
+++ b/packages/carbon-database/package.json
@@ -36,7 +36,7 @@
"devDependencies": {
"@carbon/tsconfig": "*",
"@supabase/supabase-js": "^2.1.0",
- "@types/node": "^18.11.9",
+ "@types/node": "^16.17.1",
"@types/uuid": "^8.3.4",
"dotenv": "16.0.3",
"eslint": "^8.4.1",
diff --git a/packages/carbon-database/src/types.ts b/packages/carbon-database/src/types.ts
index 22f53f2c34..241a43691f 100644
--- a/packages/carbon-database/src/types.ts
+++ b/packages/carbon-database/src/types.ts
@@ -57,36 +57,36 @@ export interface Database {
}
EmployeeType: {
Row: {
- name: string
- updatedAt: string | null
id: string
+ name: string
color: string | null
protected: boolean
createdAt: string
+ updatedAt: string | null
}
Insert: {
- name: string
- updatedAt?: string | null
id?: string
+ name: string
color?: string | null
protected?: boolean
createdAt?: string
+ updatedAt?: string | null
}
Update: {
- name?: string
- updatedAt?: string | null
id?: string
+ name?: string
color?: string | null
protected?: boolean
createdAt?: string
+ updatedAt?: string | null
}
}
EmployeeTypePermission: {
Row: {
employeeTypeId: string
moduleId: string
- updatedAt: string | null
createdAt: string
+ updatedAt: string | null
create: boolean
delete: boolean
update: boolean
@@ -95,8 +95,8 @@ export interface Database {
Insert: {
employeeTypeId: string
moduleId: string
- updatedAt?: string | null
createdAt?: string
+ updatedAt?: string | null
create?: boolean
delete?: boolean
update?: boolean
@@ -105,8 +105,8 @@ export interface Database {
Update: {
employeeTypeId?: string
moduleId?: string
- updatedAt?: string | null
createdAt?: string
+ updatedAt?: string | null
create?: boolean
delete?: boolean
update?: boolean
@@ -115,22 +115,22 @@ export interface Database {
}
Feature: {
Row: {
- name: string
- updatedAt: string | null
id: string
+ name: string
createdAt: string
+ updatedAt: string | null
}
Insert: {
- name: string
- updatedAt?: string | null
id?: string
+ name: string
createdAt?: string
+ updatedAt?: string | null
}
Update: {
- name?: string
- updatedAt?: string | null
id?: string
+ name?: string
createdAt?: string
+ updatedAt?: string | null
}
}
User: {
@@ -140,8 +140,8 @@ export interface Database {
firstName: string
lastName: string
emailVerified: string | null
- updatedAt: string | null
createdAt: string
+ updatedAt: string | null
}
Insert: {
id: string
@@ -149,8 +149,8 @@ export interface Database {
firstName: string
lastName: string
emailVerified?: string | null
- updatedAt?: string | null
createdAt?: string
+ updatedAt?: string | null
}
Update: {
id?: string
@@ -158,8 +158,8 @@ export interface Database {
firstName?: string
lastName?: string
emailVerified?: string | null
- updatedAt?: string | null
createdAt?: string
+ updatedAt?: string | null
}
}
}
diff --git a/packages/carbon-database/supabase/.branches/_current_branch b/packages/carbon-database/supabase/.branches/_current_branch
new file mode 100644
index 0000000000..88d050b190
--- /dev/null
+++ b/packages/carbon-database/supabase/.branches/_current_branch
@@ -0,0 +1 @@
+main
\ No newline at end of file
diff --git a/packages/carbon-redis/.env b/packages/carbon-redis/.env
new file mode 120000
index 0000000000..c7360fb82d
--- /dev/null
+++ b/packages/carbon-redis/.env
@@ -0,0 +1 @@
+../../.env
\ No newline at end of file
diff --git a/packages/carbon-redis/.eslintrc.js b/packages/carbon-redis/.eslintrc.js
new file mode 100644
index 0000000000..1308cba140
--- /dev/null
+++ b/packages/carbon-redis/.eslintrc.js
@@ -0,0 +1,4 @@
+module.exports = {
+ root: true,
+ extends: ["carbon"],
+};
diff --git a/packages/carbon-redis/docker-compose.yml b/packages/carbon-redis/docker-compose.yml
new file mode 100644
index 0000000000..58b08d64d5
--- /dev/null
+++ b/packages/carbon-redis/docker-compose.yml
@@ -0,0 +1,13 @@
+version: "3.8"
+services:
+ carbon-redis:
+ image: redis:7.0-alpine
+ restart: always
+ ports:
+ - "6379:6379"
+ command: redis-server --save 20 1 --loglevel warning
+ volumes:
+ - cache:/data
+volumes:
+ cache:
+ driver: local
diff --git a/packages/carbon-redis/package.json b/packages/carbon-redis/package.json
new file mode 100644
index 0000000000..8f780631b9
--- /dev/null
+++ b/packages/carbon-redis/package.json
@@ -0,0 +1,35 @@
+{
+ "version": "1.0.0",
+ "name": "@carbon/redis",
+ "private": true,
+ "license": "MIT",
+ "sideEffects": false,
+ "main": "./dist/index.js",
+ "module": "./dist/index.mjs",
+ "types": "./dist/index.d.ts",
+ "files": [
+ "dist/**"
+ ],
+ "scripts": {
+ "build": "tsup",
+ "clean": "rimraf .turbo node_modules dist",
+ "db:start": "docker-compose up -d",
+ "db:kill": "docker-compose down",
+ "dev": "tsup --watch",
+ "lint": "TIMING=1 eslint \"src/**/*.ts*\""
+ },
+ "dependencies": {
+ "ioredis": "^5.2.4"
+ },
+ "devDependencies": {
+ "@carbon/tsconfig": "*",
+ "@types/node": "^16.17.1",
+ "dotenv": "16.0.3",
+ "eslint": "^8.4.1",
+ "eslint-config-carbon": "*",
+ "rimraf": "^3.0.2",
+ "tsup": "^6.5.0",
+ "tsx": "^3.12.1",
+ "typescript": "^4.9.3"
+ }
+}
diff --git a/packages/carbon-redis/src/client.ts b/packages/carbon-redis/src/client.ts
new file mode 100644
index 0000000000..7bb109be0d
--- /dev/null
+++ b/packages/carbon-redis/src/client.ts
@@ -0,0 +1,27 @@
+import type { Redis as RedisType } from "ioredis";
+import Redis from "ioredis";
+
+const REDIS_URL = process.env.REDIS_URL;
+let redis: RedisType;
+
+declare global {
+ var __redis: RedisType | undefined;
+}
+
+if (!REDIS_URL) {
+ throw new Error("REDIS_URL is not defined");
+}
+
+// this is needed because in development we don't want to restart
+// the server with every change, but we want to make sure we don't
+// create a new connection to the Redis with every change either.
+if (process.env.NODE_ENV === "production") {
+ redis = new Redis(REDIS_URL);
+} else {
+ if (!global.__redis) {
+ global.__redis = new Redis(REDIS_URL);
+ }
+ redis = global.__redis;
+}
+
+export default redis;
diff --git a/packages/carbon-redis/src/index.ts b/packages/carbon-redis/src/index.ts
new file mode 100644
index 0000000000..d1284a4e30
--- /dev/null
+++ b/packages/carbon-redis/src/index.ts
@@ -0,0 +1,3 @@
+import redis from "./client";
+
+export { redis };
diff --git a/packages/carbon-redis/tsconfig.json b/packages/carbon-redis/tsconfig.json
new file mode 100644
index 0000000000..60537146a3
--- /dev/null
+++ b/packages/carbon-redis/tsconfig.json
@@ -0,0 +1,11 @@
+{
+ "compilerOptions": {
+ "lib": ["ES2015"],
+ "module": "CommonJS",
+ "outDir": "./dist",
+ "rootDir": "./src"
+ },
+ "exclude": ["node_modules"],
+ "extends": "@carbon/tsconfig/base.json",
+ "include": ["src"]
+}
diff --git a/packages/carbon-redis/tsup.config.ts b/packages/carbon-redis/tsup.config.ts
new file mode 100644
index 0000000000..27be5a773f
--- /dev/null
+++ b/packages/carbon-redis/tsup.config.ts
@@ -0,0 +1,12 @@
+import { defineConfig } from "tsup";
+
+const isProduction = process.env.NODE_ENV === "production";
+
+export default defineConfig({
+ clean: true,
+ dts: true,
+ entry: ["src/index.ts"],
+ format: ["cjs", "esm"],
+ minify: isProduction,
+ sourcemap: true,
+});
diff --git a/yarn.lock b/yarn.lock
index 8f3d722a48..8f1ba9c24f 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2102,6 +2102,11 @@
resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45"
integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==
+"@ioredis/commands@^1.1.1":
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/@ioredis/commands/-/commands-1.2.0.tgz#6d61b3097470af1fdbbe622795b8921d42018e11"
+ integrity sha512-Sx1pU8EM64o2BrqNpEO1CNLtKQwyhuXuqyfH7oGKCk+1a33d2r5saW8zNwm3j6BTExtjrv2BxTgzzkMwts6vGg==
+
"@istanbuljs/load-nyc-config@^1.0.0":
version "1.1.0"
resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced"
@@ -3432,7 +3437,12 @@
resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.33.tgz#8c29a0036771569662e4635790ffa9e057db379b"
integrity sha512-qelS/Ra6sacc4loe/3MSjXNL1dNQ/GjxNHVzuChwMfmk7HuycRLVQN2qNY3XahK+fZc5E2szqQSKUyAF0E+2bg==
-"@types/node@^18.11.0", "@types/node@^18.11.9":
+"@types/node@^16.17.1":
+ version "16.18.6"
+ resolved "https://registry.yarnpkg.com/@types/node/-/node-16.18.6.tgz#87846192fd51b693368fad3e99123169225621d4"
+ integrity sha512-vmYJF0REqDyyU0gviezF/KHq/fYaUbFhkcNbQCuPGFQj6VTbXuHZoxs/Y7mutWe73C8AC6l9fFu8mSYiBAqkGA==
+
+"@types/node@^18.11.0":
version "18.11.9"
resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.9.tgz#02d013de7058cea16d36168ef2fc653464cfbad4"
integrity sha512-CRpX21/kGdzjOpFsZSkcrXMGIBWMGNIHXXBVFSH+ggkftxg+XYP20TESbh+zFvFj3EQOl5byk0HTRn1IL6hbqg==
@@ -4601,6 +4611,11 @@ clsx@^1.2.1:
resolved "https://registry.yarnpkg.com/clsx/-/clsx-1.2.1.tgz#0ddc4a20a549b59c93a4116bb26f5294ca17dc12"
integrity sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==
+cluster-key-slot@^1.1.0:
+ version "1.1.2"
+ resolved "https://registry.yarnpkg.com/cluster-key-slot/-/cluster-key-slot-1.1.2.tgz#88ddaa46906e303b5de30d3153b7d9fe0a0c19ac"
+ integrity sha512-RMr0FhtfXemyinomL4hrWcYJxmX6deFdCxpJzhDttxgO1+bcCnkk+9drydLVDmAMG7NE6aN/fl4F7ucU/90gAA==
+
co@^4.6.0:
version "4.6.0"
resolved "https://registry.yarnpkg.com/co/-/co-4.6.0.tgz#6ea6bdf3d853ae54ccb8e47bfa0bf3f9031fb184"
@@ -5081,6 +5096,11 @@ delayed-stream@~1.0.0:
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==
+denque@^2.0.1:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/denque/-/denque-2.1.0.tgz#e93e1a6569fb5e66f16a3c2a2964617d349d6ab1"
+ integrity sha512-HVQE3AAb/pxF8fQAoiqpvg9i3evqug3hoiwakOyZAwJm+6vZehbkYXZ0l4JxS+I3QxM97v5aaRNhj8v5oBhekw==
+
[email protected], depd@~2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/depd/-/depd-2.0.0.tgz#b696163cc757560d09cf22cc8fad1571b79e76df"
@@ -7423,6 +7443,21 @@ invariant@^2.2.4:
dependencies:
loose-envify "^1.0.0"
+ioredis@^5.2.4:
+ version "5.2.4"
+ resolved "https://registry.yarnpkg.com/ioredis/-/ioredis-5.2.4.tgz#9e262a668bc29bae98f2054c1e0d7efd86996b96"
+ integrity sha512-qIpuAEt32lZJQ0XyrloCRdlEdUUNGG9i0UOk6zgzK6igyudNWqEBxfH6OlbnOOoBBvr1WB02mm8fR55CnikRng==
+ dependencies:
+ "@ioredis/commands" "^1.1.1"
+ cluster-key-slot "^1.1.0"
+ debug "^4.3.4"
+ denque "^2.0.1"
+ lodash.defaults "^4.2.0"
+ lodash.isarguments "^3.1.0"
+ redis-errors "^1.2.0"
+ redis-parser "^3.0.0"
+ standard-as-callback "^2.1.0"
+
ip@^1.1.5:
version "1.1.8"
resolved "https://registry.yarnpkg.com/ip/-/ip-1.1.8.tgz#ae05948f6b075435ed3307acce04629da8cdbf48"
@@ -8557,6 +8592,16 @@ lodash.debounce@^4.0.8:
resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af"
integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow==
+lodash.defaults@^4.2.0:
+ version "4.2.0"
+ resolved "https://registry.yarnpkg.com/lodash.defaults/-/lodash.defaults-4.2.0.tgz#d09178716ffea4dde9e5fb7b37f6f0802274580c"
+ integrity sha512-qjxPLHd3r5DnsdGacqOMU6pb/avJzdh9tFX2ymgoZE27BmjXrNy/y4LoaiTeAb+O3gL8AfpJGtqfX/ae2leYYQ==
+
+lodash.isarguments@^3.1.0:
+ version "3.1.0"
+ resolved "https://registry.yarnpkg.com/lodash.isarguments/-/lodash.isarguments-3.1.0.tgz#2f573d85c6a24289ff00663b491c1d338ff3458a"
+ integrity sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==
+
lodash.merge@^4.6.2:
version "4.6.2"
resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a"
@@ -10701,6 +10746,18 @@ recast@^0.20.4:
source-map "~0.6.1"
tslib "^2.0.1"
+redis-errors@^1.0.0, redis-errors@^1.2.0:
+ version "1.2.0"
+ resolved "https://registry.yarnpkg.com/redis-errors/-/redis-errors-1.2.0.tgz#eb62d2adb15e4eaf4610c04afe1529384250abad"
+ integrity sha512-1qny3OExCf0UvUV/5wpYKf2YwPcOqXzkwKKSmKHiE6ZMQs5heeE/c8eXK+PNllPvmjgAbfnsbpkGZWy8cBpn9w==
+
+redis-parser@^3.0.0:
+ version "3.0.0"
+ resolved "https://registry.yarnpkg.com/redis-parser/-/redis-parser-3.0.0.tgz#b66d828cdcafe6b4b8a428a7def4c6bcac31c8b4"
+ integrity sha512-DJnGAeenTdpMEH6uAJRK/uiyEIH9WVsUmoLwzudwGJUwZPp80PDBWPHXSAGNPwNvIXAbe7MSUB1zQFugFml66A==
+ dependencies:
+ redis-errors "^1.0.0"
+
regenerate-unicode-properties@^10.1.0:
version "10.1.0"
resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c"
@@ -11499,6 +11556,11 @@ stack-utils@^2.0.2:
dependencies:
escape-string-regexp "^2.0.0"
+standard-as-callback@^2.1.0:
+ version "2.1.0"
+ resolved "https://registry.yarnpkg.com/standard-as-callback/-/standard-as-callback-2.1.0.tgz#8953fc05359868a77b5b9739a665c5977bb7df45"
+ integrity sha512-qoRRSyROncaz1z0mvYqIE4lCd9p2R90i6GxW3uZv5ucSu8tU7B5HXUP1gG8pVZsYNVaXjk8ClXHPttLyxAL48A==
+
static-extend@^0.1.1:
version "0.1.2"
resolved "https://registry.yarnpkg.com/static-extend/-/static-extend-0.1.2.tgz#60809c39cbff55337226fd5e0b520f341f1fb5c6"