@aurostack/stacks 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +209 -0
- package/cli/src/extract.mjs +165 -0
- package/cli/src/fsx.mjs +197 -0
- package/cli/src/generate.mjs +235 -0
- package/cli/src/hooks.mjs +55 -0
- package/cli/src/manifest.mjs +163 -0
- package/cli/src/strip.mjs +208 -0
- package/cli/src/tokens.mjs +102 -0
- package/cli/stack.mjs +672 -0
- package/package.json +37 -0
- package/templates/nest-api/files/.bin/db.ts +123 -0
- package/templates/nest-api/files/.bin/dc.ts +74 -0
- package/templates/nest-api/files/.bin/helpers.ts +49 -0
- package/templates/nest-api/files/.bin/secrets.ts +68 -0
- package/templates/nest-api/files/.bin/start.ts +47 -0
- package/templates/nest-api/files/.dockerignore +7 -0
- package/templates/nest-api/files/.env.example +91 -0
- package/templates/nest-api/files/.env.test.example +75 -0
- package/templates/nest-api/files/.forgejo/workflows/build-and-push.yml +41 -0
- package/templates/nest-api/files/.forgejo/workflows/test-e2e.yml +83 -0
- package/templates/nest-api/files/.forgejo/workflows/test.yml +53 -0
- package/templates/nest-api/files/.npmrc.example +1 -0
- package/templates/nest-api/files/.nvmrc +1 -0
- package/templates/nest-api/files/.prettierrc +8 -0
- package/templates/nest-api/files/.swcrc +15 -0
- package/templates/nest-api/files/.watchmanconfig +3 -0
- package/templates/nest-api/files/.yarnrc.yml +1 -0
- package/templates/nest-api/files/Dockerfile +40 -0
- package/templates/nest-api/files/__mocks__/activation-twofa.js +7 -0
- package/templates/nest-api/files/__mocks__/activation.js +7 -0
- package/templates/nest-api/files/__mocks__/forgot-password.js +7 -0
- package/templates/nest-api/files/__mocks__/main-layout.js +7 -0
- package/templates/nest-api/files/__mocks__/password-changed.js +7 -0
- package/templates/nest-api/files/__mocks__/reset-password.js +7 -0
- package/templates/nest-api/files/__mocks__/set-password.js +7 -0
- package/templates/nest-api/files/__mocks__/welcome.js +7 -0
- package/templates/nest-api/files/_gitignore +62 -0
- package/templates/nest-api/files/compose.test.yml +33 -0
- package/templates/nest-api/files/compose.yml +39 -0
- package/templates/nest-api/files/emails/activation-twofa.tsx +58 -0
- package/templates/nest-api/files/emails/activation.tsx +36 -0
- package/templates/nest-api/files/emails/forgot-password.tsx +29 -0
- package/templates/nest-api/files/emails/main-layout.tsx +134 -0
- package/templates/nest-api/files/emails/password-changed.tsx +24 -0
- package/templates/nest-api/files/emails/reset-password.tsx +24 -0
- package/templates/nest-api/files/emails/set-password.tsx +25 -0
- package/templates/nest-api/files/emails/welcome.tsx +39 -0
- package/templates/nest-api/files/eslint.config.mjs +28 -0
- package/templates/nest-api/files/global.d.ts +5 -0
- package/templates/nest-api/files/nest-cli.json +8 -0
- package/templates/nest-api/files/package.json +150 -0
- package/templates/nest-api/files/prisma/schema/auth.prisma +75 -0
- package/templates/nest-api/files/prisma/schema/base.prisma +17 -0
- package/templates/nest-api/files/prisma/schema/enum.prisma +17 -0
- package/templates/nest-api/files/prisma/schema/notification.prisma +14 -0
- package/templates/nest-api/files/prisma.config.ts +13 -0
- package/templates/nest-api/files/public/.gitkeep +0 -0
- package/templates/nest-api/files/seeders/index.ts +27 -0
- package/templates/nest-api/files/seeders/util.ts +88 -0
- package/templates/nest-api/files/src/__tests__/app.controller.spec.ts +29 -0
- package/templates/nest-api/files/src/app.controller.ts +40 -0
- package/templates/nest-api/files/src/app.module.ts +268 -0
- package/templates/nest-api/files/src/app.resolver.ts +32 -0
- package/templates/nest-api/files/src/app.setup.ts +178 -0
- package/templates/nest-api/files/src/common/__tests__/auth.service.spec.ts +31 -0
- package/templates/nest-api/files/src/common/__tests__/cache.service.spec.ts +214 -0
- package/templates/nest-api/files/src/common/__tests__/config.service.spec.ts +56 -0
- package/templates/nest-api/files/src/common/__tests__/generator.service.spec.ts +114 -0
- package/templates/nest-api/files/src/common/__tests__/health.controller.spec.ts +72 -0
- package/templates/nest-api/files/src/common/__tests__/helpers.spec.ts +124 -0
- package/templates/nest-api/files/src/common/__tests__/mail.service.spec.ts +75 -0
- package/templates/nest-api/files/src/common/__tests__/prisma.indicator.spec.ts +39 -0
- package/templates/nest-api/files/src/common/__tests__/prisma.service.spec.ts +15 -0
- package/templates/nest-api/files/src/common/__tests__/records.spec.ts +87 -0
- package/templates/nest-api/files/src/common/__tests__/schemas.spec.ts +142 -0
- package/templates/nest-api/files/src/common/__tests__/throttler-storage.service.spec.ts +80 -0
- package/templates/nest-api/files/src/common/common.module.ts +72 -0
- package/templates/nest-api/files/src/common/constants/index.ts +2 -0
- package/templates/nest-api/files/src/common/constants/options.ts +52 -0
- package/templates/nest-api/files/src/common/constants/pino.ts +24 -0
- package/templates/nest-api/files/src/common/controllers/health.controller.ts +54 -0
- package/templates/nest-api/files/src/common/controllers/index.ts +2 -0
- package/templates/nest-api/files/src/common/controllers/metrics.controller.ts +21 -0
- package/templates/nest-api/files/src/common/decorators/index.ts +2 -0
- package/templates/nest-api/files/src/common/decorators/misc.decorator.ts +49 -0
- package/templates/nest-api/files/src/common/decorators/multi-part.decorator.ts +6 -0
- package/templates/nest-api/files/src/common/dto/filters.dto.ts +25 -0
- package/templates/nest-api/files/src/common/dto/index.ts +1 -0
- package/templates/nest-api/files/src/common/entity/index.ts +2 -0
- package/templates/nest-api/files/src/common/entity/ok.entity.ts +11 -0
- package/templates/nest-api/files/src/common/entity/pagination.entity.ts +24 -0
- package/templates/nest-api/files/src/common/exceptions/index.ts +1 -0
- package/templates/nest-api/files/src/common/exceptions/prisma.exception.ts +57 -0
- package/templates/nest-api/files/src/common/guards/feature-flag.guard.ts +51 -0
- package/templates/nest-api/files/src/common/guards/index.ts +1 -0
- package/templates/nest-api/files/src/common/interceptors/index.ts +1 -0
- package/templates/nest-api/files/src/common/interceptors/metrics.interceptor.ts +37 -0
- package/templates/nest-api/files/src/common/misc/helpers.ts +26 -0
- package/templates/nest-api/files/src/common/misc/index.ts +3 -0
- package/templates/nest-api/files/src/common/misc/origin-builder.ts +56 -0
- package/templates/nest-api/files/src/common/misc/prisma.indicator.ts +24 -0
- package/templates/nest-api/files/src/common/modules/index.ts +3 -0
- package/templates/nest-api/files/src/common/modules/logger.module.ts +104 -0
- package/templates/nest-api/files/src/common/modules/metrics.module.ts +28 -0
- package/templates/nest-api/files/src/common/modules/queue.module.ts +23 -0
- package/templates/nest-api/files/src/common/processors/index.ts +1 -0
- package/templates/nest-api/files/src/common/processors/mail/index.ts +47 -0
- package/templates/nest-api/files/src/common/processors/mail/process.ts +225 -0
- package/templates/nest-api/files/src/common/schemas/fields.ts +76 -0
- package/templates/nest-api/files/src/common/schemas/index.ts +1 -0
- package/templates/nest-api/files/src/common/services/auth-rate-limit.storage.ts +79 -0
- package/templates/nest-api/files/src/common/services/auth.service.ts +16 -0
- package/templates/nest-api/files/src/common/services/cache.service.ts +118 -0
- package/templates/nest-api/files/src/common/services/config.service.ts +388 -0
- package/templates/nest-api/files/src/common/services/feature-flag.service.ts +117 -0
- package/templates/nest-api/files/src/common/services/generator.service.ts +54 -0
- package/templates/nest-api/files/src/common/services/index.ts +10 -0
- package/templates/nest-api/files/src/common/services/logger.service.ts +14 -0
- package/templates/nest-api/files/src/common/services/mail.service.ts +44 -0
- package/templates/nest-api/files/src/common/services/prisma.service.ts +106 -0
- package/templates/nest-api/files/src/common/services/throttler-storage.service.ts +112 -0
- package/templates/nest-api/files/src/common/types/email.ts +55 -0
- package/templates/nest-api/files/src/common/types/index.ts +3 -0
- package/templates/nest-api/files/src/common/types/misc.ts +20 -0
- package/templates/nest-api/files/src/common/types/prisma.ts +18 -0
- package/templates/nest-api/files/src/common/utils/enum.ts +39 -0
- package/templates/nest-api/files/src/common/utils/helpers.ts +139 -0
- package/templates/nest-api/files/src/common/utils/index.ts +5 -0
- package/templates/nest-api/files/src/common/utils/ip.ts +22 -0
- package/templates/nest-api/files/src/common/utils/records.ts +66 -0
- package/templates/nest-api/files/src/common/utils/redis.keys.ts +31 -0
- package/templates/nest-api/files/src/lib/__tests__/access.spec.ts +33 -0
- package/templates/nest-api/files/src/lib/access.ts +114 -0
- package/templates/nest-api/files/src/lib/auth.ts +76 -0
- package/templates/nest-api/files/src/lib/rate-limit.ts +20 -0
- package/templates/nest-api/files/src/main.ts +28 -0
- package/templates/nest-api/files/src/media/__tests__/media.service.spec.ts +60 -0
- package/templates/nest-api/files/src/media/__tests__/s3.service.spec.ts +159 -0
- package/templates/nest-api/files/src/media/entity/file.entity.ts +7 -0
- package/templates/nest-api/files/src/media/entity/index.ts +1 -0
- package/templates/nest-api/files/src/media/media.module.ts +20 -0
- package/templates/nest-api/files/src/media/processors/index.ts +44 -0
- package/templates/nest-api/files/src/media/services/index.ts +2 -0
- package/templates/nest-api/files/src/media/services/media.service.ts +29 -0
- package/templates/nest-api/files/src/media/services/s3.service.ts +168 -0
- package/templates/nest-api/files/src/notifications/controllers/index.ts +1 -0
- package/templates/nest-api/files/src/notifications/controllers/notifications.controller.ts +72 -0
- package/templates/nest-api/files/src/notifications/dto/index.ts +1 -0
- package/templates/nest-api/files/src/notifications/dto/notification.dto.ts +11 -0
- package/templates/nest-api/files/src/notifications/entity/index.ts +1 -0
- package/templates/nest-api/files/src/notifications/entity/notification.entity.ts +37 -0
- package/templates/nest-api/files/src/notifications/notifications.module.ts +11 -0
- package/templates/nest-api/files/src/notifications/services/index.ts +1 -0
- package/templates/nest-api/files/src/notifications/services/notifications.service.ts +98 -0
- package/templates/nest-api/files/src/realtime/__tests__/events.gateway.spec.ts +88 -0
- package/templates/nest-api/files/src/realtime/__tests__/rooms.spec.ts +29 -0
- package/templates/nest-api/files/src/realtime/__tests__/ws-permissions.guard.spec.ts +54 -0
- package/templates/nest-api/files/src/realtime/adapters/redis-io.adapter.ts +57 -0
- package/templates/nest-api/files/src/realtime/constants/index.ts +68 -0
- package/templates/nest-api/files/src/realtime/decorators/index.ts +1 -0
- package/templates/nest-api/files/src/realtime/decorators/ws-permissions.decorator.ts +14 -0
- package/templates/nest-api/files/src/realtime/gateways/events.gateway.ts +187 -0
- package/templates/nest-api/files/src/realtime/guards/index.ts +2 -0
- package/templates/nest-api/files/src/realtime/guards/ws-auth.guard.ts +20 -0
- package/templates/nest-api/files/src/realtime/guards/ws-permissions.guard.ts +35 -0
- package/templates/nest-api/files/src/realtime/misc/session-from-socket.ts +54 -0
- package/templates/nest-api/files/src/realtime/realtime.module.ts +26 -0
- package/templates/nest-api/files/src/realtime/services/presence.service.ts +56 -0
- package/templates/nest-api/files/src/realtime/services/realtime.service.ts +72 -0
- package/templates/nest-api/files/src/users/__tests__/current-user.controller.spec.ts +77 -0
- package/templates/nest-api/files/src/users/__tests__/current-user.service.spec.ts +159 -0
- package/templates/nest-api/files/src/users/__tests__/user.entity.spec.ts +175 -0
- package/templates/nest-api/files/src/users/__tests__/users.controller.spec.ts +89 -0
- package/templates/nest-api/files/src/users/__tests__/users.service.spec.ts +398 -0
- package/templates/nest-api/files/src/users/controllers/current-user.controller.ts +82 -0
- package/templates/nest-api/files/src/users/controllers/index.ts +2 -0
- package/templates/nest-api/files/src/users/controllers/users.controller.ts +40 -0
- package/templates/nest-api/files/src/users/decorators/index.ts +1 -0
- package/templates/nest-api/files/src/users/decorators/permissions.decorator.ts +24 -0
- package/templates/nest-api/files/src/users/dto/avatar.dto.ts +13 -0
- package/templates/nest-api/files/src/users/dto/filters.dto.ts +8 -0
- package/templates/nest-api/files/src/users/dto/index.ts +2 -0
- package/templates/nest-api/files/src/users/entity/index.ts +1 -0
- package/templates/nest-api/files/src/users/entity/user.entity.ts +53 -0
- package/templates/nest-api/files/src/users/services/current-user.service.ts +46 -0
- package/templates/nest-api/files/src/users/services/index.ts +2 -0
- package/templates/nest-api/files/src/users/services/users.service.ts +88 -0
- package/templates/nest-api/files/src/users/users.module.ts +10 -0
- package/templates/nest-api/files/test/app.spec.ts +102 -0
- package/templates/nest-api/files/test/auth.spec.ts +108 -0
- package/templates/nest-api/files/test/current-user.spec.ts +154 -0
- package/templates/nest-api/files/test/factory/app.ts +172 -0
- package/templates/nest-api/files/test/factory/constants.ts +22 -0
- package/templates/nest-api/files/test/factory/dto.ts +27 -0
- package/templates/nest-api/files/test/factory/entity.ts +70 -0
- package/templates/nest-api/files/test/factory/gen.ts +75 -0
- package/templates/nest-api/files/test/factory/util.ts +21 -0
- package/templates/nest-api/files/test/notifications.spec.ts +176 -0
- package/templates/nest-api/files/test/rate-limit.spec.ts +180 -0
- package/templates/nest-api/files/test/setup.ts +1 -0
- package/templates/nest-api/files/test/users.spec.ts +437 -0
- package/templates/nest-api/files/tsconfig.build.json +13 -0
- package/templates/nest-api/files/tsconfig.json +35 -0
- package/templates/nest-api/files/vitest.config.ts +53 -0
- package/templates/nest-api/template.json +452 -0
- package/templates/node-worker/files/.bin/db.ts +123 -0
- package/templates/node-worker/files/.bin/helpers.ts +49 -0
- package/templates/node-worker/files/.bin/secrets.ts +68 -0
- package/templates/node-worker/files/.dockerignore +5 -0
- package/templates/node-worker/files/.env.example +21 -0
- package/templates/node-worker/files/.forgejo/workflows/build-and-push.yml +41 -0
- package/templates/node-worker/files/.nvmrc +1 -0
- package/templates/node-worker/files/.prettierignore +4 -0
- package/templates/node-worker/files/.prettierrc +8 -0
- package/templates/node-worker/files/.yarnrc.yml +5 -0
- package/templates/node-worker/files/Dockerfile +63 -0
- package/templates/node-worker/files/Dockerfile.dev +59 -0
- package/templates/node-worker/files/_gitignore +48 -0
- package/templates/node-worker/files/ecosystem.config.cjs +10 -0
- package/templates/node-worker/files/eslint.config.js +37 -0
- package/templates/node-worker/files/package.json +67 -0
- package/templates/node-worker/files/prisma/_gitignore +1 -0
- package/templates/node-worker/files/prisma/schema/base.prisma +36 -0
- package/templates/node-worker/files/prisma.config.ts +13 -0
- package/templates/node-worker/files/src/config.ts +55 -0
- package/templates/node-worker/files/src/db.ts +118 -0
- package/templates/node-worker/files/src/index.ts +7 -0
- package/templates/node-worker/files/src/logger.ts +45 -0
- package/templates/node-worker/files/src/types.ts +23 -0
- package/templates/node-worker/files/src/utils/browser.ts +16 -0
- package/templates/node-worker/files/src/utils/date.ts +68 -0
- package/templates/node-worker/files/src/utils/helpers.ts +17 -0
- package/templates/node-worker/files/src/utils/number.ts +47 -0
- package/templates/node-worker/files/src/utils/worker.ts +29 -0
- package/templates/node-worker/files/src/workers/constants.ts +6 -0
- package/templates/node-worker/files/src/workers/example/index.ts +27 -0
- package/templates/node-worker/files/src/workers/index.ts +1 -0
- package/templates/node-worker/files/tsconfig.json +30 -0
- package/templates/node-worker/template.json +135 -0
- package/templates/py-worker/files/.dockerignore +176 -0
- package/templates/py-worker/files/.env.example +20 -0
- package/templates/py-worker/files/.forgejo/workflows/build-amd-push.yml +39 -0
- package/templates/py-worker/files/Dockerfile +10 -0
- package/templates/py-worker/files/README.md +3 -0
- package/templates/py-worker/files/_gitignore +176 -0
- package/templates/py-worker/files/config.py +89 -0
- package/templates/py-worker/files/models/decorators.py +42 -0
- package/templates/py-worker/files/models/enums.py +32 -0
- package/templates/py-worker/files/models/mixins.py +61 -0
- package/templates/py-worker/files/requirements.txt +18 -0
- package/templates/py-worker/files/utils/db.py +67 -0
- package/templates/py-worker/files/utils/logger.py +97 -0
- package/templates/py-worker/files/utils/misc.py +45 -0
- package/templates/py-worker/files/utils/worker.py +80 -0
- package/templates/py-worker/files/worker.py +41 -0
- package/templates/py-worker/files/workers/hello/process.py +22 -0
- package/templates/py-worker/template.json +87 -0
- package/templates/react-app/README.md +78 -0
- package/templates/react-app/derive.sh +128 -0
- package/templates/react-app/files/.bin/openapi.js +32 -0
- package/templates/react-app/files/.bin/secrets.js +47 -0
- package/templates/react-app/files/.dockerignore +16 -0
- package/templates/react-app/files/.editorconfig +12 -0
- package/templates/react-app/files/.env.example +34 -0
- package/templates/react-app/files/.forgejo/workflows/build-and-push.yml +55 -0
- package/templates/react-app/files/.forgejo/workflows/ci.yml +39 -0
- package/templates/react-app/files/.husky/pre-commit +1 -0
- package/templates/react-app/files/.nvmrc +1 -0
- package/templates/react-app/files/.prettierignore +6 -0
- package/templates/react-app/files/.prettierrc +9 -0
- package/templates/react-app/files/.yarnrc.yml +2 -0
- package/templates/react-app/files/Dockerfile +52 -0
- package/templates/react-app/files/_gitignore +33 -0
- package/templates/react-app/files/build.sh +53 -0
- package/templates/react-app/files/docker/nginx.conf +134 -0
- package/templates/react-app/files/eslint.config.mjs +75 -0
- package/templates/react-app/files/index.html +62 -0
- package/templates/react-app/files/openapi-ts.config.ts +22 -0
- package/templates/react-app/files/package.json +80 -0
- package/templates/react-app/files/src/app/nav.tsx +32 -0
- package/templates/react-app/files/src/app/providers.tsx +39 -0
- package/templates/react-app/files/src/app/router.tsx +142 -0
- package/templates/react-app/files/src/app/store.ts +20 -0
- package/templates/react-app/files/src/features/auth/components/auth-card.tsx +23 -0
- package/templates/react-app/files/src/features/auth/components/checkbox-field.tsx +32 -0
- package/templates/react-app/files/src/features/auth/components/google-button.tsx +41 -0
- package/templates/react-app/files/src/features/auth/components/or-divider.tsx +9 -0
- package/templates/react-app/files/src/features/auth/components/password-field.tsx +70 -0
- package/templates/react-app/files/src/features/auth/components/submit-button.tsx +16 -0
- package/templates/react-app/files/src/features/auth/lib/auth-actions.ts +68 -0
- package/templates/react-app/files/src/features/auth/lib/password-strength.ts +20 -0
- package/templates/react-app/files/src/features/auth/lib/redirect.ts +6 -0
- package/templates/react-app/files/src/features/auth/lib/schemas.ts +37 -0
- package/templates/react-app/files/src/features/seo/routes.ts +65 -0
- package/templates/react-app/files/src/lib/env.ts +28 -0
- package/templates/react-app/files/src/lib/paths.ts +58 -0
- package/templates/react-app/files/src/main.tsx +19 -0
- package/templates/react-app/files/src/routes/admin/home.tsx +24 -0
- package/templates/react-app/files/src/routes/auth/forgot-password.tsx +93 -0
- package/templates/react-app/files/src/routes/auth/login.tsx +87 -0
- package/templates/react-app/files/src/routes/auth/reset-password.tsx +83 -0
- package/templates/react-app/files/src/routes/auth/signup.tsx +117 -0
- package/templates/react-app/files/src/routes/auth/verified.tsx +31 -0
- package/templates/react-app/files/src/routes/auth/verify-email.tsx +97 -0
- package/templates/react-app/files/src/routes/home.tsx +17 -0
- package/templates/react-app/files/src/routes/legal/privacy.tsx +26 -0
- package/templates/react-app/files/src/routes/legal/terms.tsx +28 -0
- package/templates/react-app/files/src/routes/marketing/home.tsx +18 -0
- package/templates/react-app/files/src/routes/settings.tsx +10 -0
- package/templates/react-app/files/src/shared/api/base-api.ts +24 -0
- package/templates/react-app/files/src/shared/api/base-query.ts +29 -0
- package/templates/react-app/files/src/shared/api/config.ts +21 -0
- package/templates/react-app/files/src/shared/api/index.ts +15 -0
- package/templates/react-app/files/src/shared/api/realtime-events.ts +34 -0
- package/templates/react-app/files/src/shared/api/socket.ts +41 -0
- package/templates/react-app/files/src/shared/api/store.ts +39 -0
- package/templates/react-app/files/src/shared/api/upload-query.ts +115 -0
- package/templates/react-app/files/src/shared/auth/client.ts +27 -0
- package/templates/react-app/files/src/shared/auth/config.ts +28 -0
- package/templates/react-app/files/src/shared/auth/guards.tsx +75 -0
- package/templates/react-app/files/src/shared/auth/hooks.ts +13 -0
- package/templates/react-app/files/src/shared/auth/index.ts +20 -0
- package/templates/react-app/files/src/shared/auth/logout.ts +23 -0
- package/templates/react-app/files/src/shared/auth/provider.tsx +52 -0
- package/templates/react-app/files/src/shared/auth/redirect.ts +65 -0
- package/templates/react-app/files/src/shared/auth/slice.ts +54 -0
- package/templates/react-app/files/src/shared/hooks/index.ts +6 -0
- package/templates/react-app/files/src/shared/layouts/app-shell/app-shell.tsx +225 -0
- package/templates/react-app/files/src/shared/layouts/app-shell/user-menu.tsx +74 -0
- package/templates/react-app/files/src/shared/layouts/auth-layout.tsx +137 -0
- package/templates/react-app/files/src/shared/layouts/error-boundary.tsx +38 -0
- package/templates/react-app/files/src/shared/layouts/index.ts +23 -0
- package/templates/react-app/files/src/shared/layouts/marketing/marketing-layout.tsx +29 -0
- package/templates/react-app/files/src/shared/layouts/marketing/section-heading.tsx +38 -0
- package/templates/react-app/files/src/shared/layouts/marketing/section.tsx +30 -0
- package/templates/react-app/files/src/shared/layouts/states/app-shell-skeleton.tsx +47 -0
- package/templates/react-app/files/src/shared/layouts/states/empty.tsx +22 -0
- package/templates/react-app/files/src/shared/layouts/states/forbidden.tsx +14 -0
- package/templates/react-app/files/src/shared/layouts/states/loading.tsx +11 -0
- package/templates/react-app/files/src/shared/layouts/states/not-found.tsx +21 -0
- package/templates/react-app/files/src/shared/layouts/states/page-skeleton.tsx +39 -0
- package/templates/react-app/files/src/shared/layouts/states/route-fallback.tsx +26 -0
- package/templates/react-app/files/src/shared/layouts/states/state-screen.tsx +22 -0
- package/templates/react-app/files/src/shared/types/README.md +28 -0
- package/templates/react-app/files/src/shared/types/api/index.ts +9 -0
- package/templates/react-app/files/src/shared/types/api/zod.gen.ts +5 -0
- package/templates/react-app/files/src/shared/types/index.ts +4 -0
- package/templates/react-app/files/src/shared/ui/components/brand/logo.tsx +51 -0
- package/templates/react-app/files/src/shared/ui/components/brand/social-icons.tsx +37 -0
- package/templates/react-app/files/src/shared/ui/components/form/form.tsx +120 -0
- package/templates/react-app/files/src/shared/ui/components/ui/alert.tsx +25 -0
- package/templates/react-app/files/src/shared/ui/components/ui/button.tsx +43 -0
- package/templates/react-app/files/src/shared/ui/components/ui/calendar.tsx +78 -0
- package/templates/react-app/files/src/shared/ui/components/ui/card.tsx +44 -0
- package/templates/react-app/files/src/shared/ui/components/ui/checkbox.tsx +16 -0
- package/templates/react-app/files/src/shared/ui/components/ui/date-picker.tsx +76 -0
- package/templates/react-app/files/src/shared/ui/components/ui/input.tsx +22 -0
- package/templates/react-app/files/src/shared/ui/components/ui/label.tsx +19 -0
- package/templates/react-app/files/src/shared/ui/components/ui/modal.tsx +94 -0
- package/templates/react-app/files/src/shared/ui/components/ui/popover.tsx +31 -0
- package/templates/react-app/files/src/shared/ui/components/ui/progress.tsx +33 -0
- package/templates/react-app/files/src/shared/ui/components/ui/search-input.tsx +69 -0
- package/templates/react-app/files/src/shared/ui/components/ui/select.tsx +80 -0
- package/templates/react-app/files/src/shared/ui/components/ui/skeleton.tsx +12 -0
- package/templates/react-app/files/src/shared/ui/components/ui/sonner.tsx +23 -0
- package/templates/react-app/files/src/shared/ui/components/ui/spinner.tsx +8 -0
- package/templates/react-app/files/src/shared/ui/components/ui/textarea.tsx +22 -0
- package/templates/react-app/files/src/shared/ui/index.ts +45 -0
- package/templates/react-app/files/src/shared/ui/lib/utils.ts +7 -0
- package/templates/react-app/files/src/shared/ui/lib/zod-setup.ts +28 -0
- package/templates/react-app/files/src/shared/ui/meta/brand.ts +18 -0
- package/templates/react-app/files/src/shared/ui/meta/meta-context.ts +30 -0
- package/templates/react-app/files/src/shared/ui/meta/meta-provider.tsx +24 -0
- package/templates/react-app/files/src/shared/ui/meta/page-meta.tsx +69 -0
- package/templates/react-app/files/src/shared/ui/meta/use-meta-config.ts +11 -0
- package/templates/react-app/files/src/shared/ui/styles/globals.css +285 -0
- package/templates/react-app/files/src/shared/ui/styles/theme.css +48 -0
- package/templates/react-app/files/src/shared/ui/theme/init-script.ts +23 -0
- package/templates/react-app/files/src/shared/ui/theme/theme-colors.ts +14 -0
- package/templates/react-app/files/src/shared/ui/theme/theme-context.ts +60 -0
- package/templates/react-app/files/src/shared/ui/theme/theme-provider.tsx +101 -0
- package/templates/react-app/files/src/shared/ui/theme/theme-toggle.tsx +40 -0
- package/templates/react-app/files/src/shared/ui/theme/use-theme.ts +11 -0
- package/templates/react-app/files/src/vite-env.d.ts +13 -0
- package/templates/react-app/files/tsconfig.json +26 -0
- package/templates/react-app/files/tsconfig.node.json +25 -0
- package/templates/react-app/files/vite.config.ts +344 -0
- package/templates/react-app/overrides/src/routes/auth/forgot-password.tsx +93 -0
- package/templates/react-app/overrides/src/routes/auth/login.tsx +87 -0
- package/templates/react-app/overrides/src/routes/auth/signup.tsx +117 -0
- package/templates/react-app/overrides/src/routes/auth/verified.tsx +31 -0
- package/templates/react-app/overrides/src/routes/auth/verify-email.tsx +97 -0
- package/templates/react-app/overrides/src/shared/auth/config.ts +28 -0
- package/templates/react-app/overrides/src/shared/auth/guards.tsx +75 -0
- package/templates/react-app/overrides/src/shared/auth/index.ts +20 -0
- package/templates/react-app/overrides/src/shared/auth/redirect.ts +65 -0
- package/templates/react-app/overrides/src/shared/hooks/index.ts +6 -0
- package/templates/react-app/overrides/src/shared/types/README.md +28 -0
- package/templates/react-app/template.json +222 -0
- package/templates/react-monorepo/files/.dockerignore +19 -0
- package/templates/react-monorepo/files/.editorconfig +12 -0
- package/templates/react-monorepo/files/.forgejo/workflows/build-and-push.yml +98 -0
- package/templates/react-monorepo/files/.forgejo/workflows/ci.yml +35 -0
- package/templates/react-monorepo/files/.husky/pre-commit +1 -0
- package/templates/react-monorepo/files/.nvmrc +1 -0
- package/templates/react-monorepo/files/.prettierignore +6 -0
- package/templates/react-monorepo/files/.prettierrc +9 -0
- package/templates/react-monorepo/files/.yarnrc.yml +2 -0
- package/templates/react-monorepo/files/Dockerfile +90 -0
- package/templates/react-monorepo/files/_gitignore +35 -0
- package/templates/react-monorepo/files/apps/admin/.bin/secrets.js +57 -0
- package/templates/react-monorepo/files/apps/admin/.env.example +16 -0
- package/templates/react-monorepo/files/apps/admin/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/apps/admin/index.html +57 -0
- package/templates/react-monorepo/files/apps/admin/package.json +33 -0
- package/templates/react-monorepo/files/apps/admin/src/App.tsx +3 -0
- package/templates/react-monorepo/files/apps/admin/src/app/nav.tsx +14 -0
- package/templates/react-monorepo/files/apps/admin/src/app/providers.tsx +42 -0
- package/templates/react-monorepo/files/apps/admin/src/app/router.tsx +50 -0
- package/templates/react-monorepo/files/apps/admin/src/app/store.ts +15 -0
- package/templates/react-monorepo/files/apps/admin/src/lib/env.ts +12 -0
- package/templates/react-monorepo/files/apps/admin/src/main.tsx +14 -0
- package/templates/react-monorepo/files/apps/admin/src/routes/home.tsx +17 -0
- package/templates/react-monorepo/files/apps/admin/src/routes/settings.tsx +10 -0
- package/templates/react-monorepo/files/apps/admin/src/vite-env.d.ts +14 -0
- package/templates/react-monorepo/files/apps/admin/tsconfig.json +10 -0
- package/templates/react-monorepo/files/apps/admin/vite.config.ts +13 -0
- package/templates/react-monorepo/files/apps/auth/.bin/secrets.js +57 -0
- package/templates/react-monorepo/files/apps/auth/.env.example +16 -0
- package/templates/react-monorepo/files/apps/auth/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/apps/auth/index.html +57 -0
- package/templates/react-monorepo/files/apps/auth/package.json +32 -0
- package/templates/react-monorepo/files/apps/auth/src/App.tsx +3 -0
- package/templates/react-monorepo/files/apps/auth/src/app/providers.tsx +42 -0
- package/templates/react-monorepo/files/apps/auth/src/app/router.tsx +19 -0
- package/templates/react-monorepo/files/apps/auth/src/app/store.ts +15 -0
- package/templates/react-monorepo/files/apps/auth/src/components/auth-card.tsx +23 -0
- package/templates/react-monorepo/files/apps/auth/src/components/checkbox-field.tsx +32 -0
- package/templates/react-monorepo/files/apps/auth/src/components/google-button.tsx +41 -0
- package/templates/react-monorepo/files/apps/auth/src/components/or-divider.tsx +9 -0
- package/templates/react-monorepo/files/apps/auth/src/components/password-field.tsx +70 -0
- package/templates/react-monorepo/files/apps/auth/src/components/submit-button.tsx +16 -0
- package/templates/react-monorepo/files/apps/auth/src/lib/auth-actions.ts +68 -0
- package/templates/react-monorepo/files/apps/auth/src/lib/env.ts +8 -0
- package/templates/react-monorepo/files/apps/auth/src/lib/password-strength.ts +20 -0
- package/templates/react-monorepo/files/apps/auth/src/lib/redirect.ts +6 -0
- package/templates/react-monorepo/files/apps/auth/src/lib/schemas.ts +37 -0
- package/templates/react-monorepo/files/apps/auth/src/main.tsx +14 -0
- package/templates/react-monorepo/files/apps/auth/src/routes/forgot-password.tsx +91 -0
- package/templates/react-monorepo/files/apps/auth/src/routes/login.tsx +82 -0
- package/templates/react-monorepo/files/apps/auth/src/routes/reset-password.tsx +83 -0
- package/templates/react-monorepo/files/apps/auth/src/routes/signup.tsx +117 -0
- package/templates/react-monorepo/files/apps/auth/src/routes/verified.tsx +30 -0
- package/templates/react-monorepo/files/apps/auth/src/routes/verify-email.tsx +96 -0
- package/templates/react-monorepo/files/apps/auth/src/vite-env.d.ts +14 -0
- package/templates/react-monorepo/files/apps/auth/tsconfig.json +10 -0
- package/templates/react-monorepo/files/apps/auth/vite.config.ts +13 -0
- package/templates/react-monorepo/files/apps/client/.bin/secrets.js +57 -0
- package/templates/react-monorepo/files/apps/client/.env.example +16 -0
- package/templates/react-monorepo/files/apps/client/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/apps/client/index.html +57 -0
- package/templates/react-monorepo/files/apps/client/package.json +35 -0
- package/templates/react-monorepo/files/apps/client/src/App.tsx +3 -0
- package/templates/react-monorepo/files/apps/client/src/app/nav.tsx +14 -0
- package/templates/react-monorepo/files/apps/client/src/app/providers.tsx +42 -0
- package/templates/react-monorepo/files/apps/client/src/app/router.tsx +50 -0
- package/templates/react-monorepo/files/apps/client/src/app/store.ts +15 -0
- package/templates/react-monorepo/files/apps/client/src/lib/env.ts +12 -0
- package/templates/react-monorepo/files/apps/client/src/main.tsx +19 -0
- package/templates/react-monorepo/files/apps/client/src/routes/home.tsx +17 -0
- package/templates/react-monorepo/files/apps/client/src/routes/settings.tsx +10 -0
- package/templates/react-monorepo/files/apps/client/src/vite-env.d.ts +15 -0
- package/templates/react-monorepo/files/apps/client/tsconfig.json +10 -0
- package/templates/react-monorepo/files/apps/client/vite.config.ts +120 -0
- package/templates/react-monorepo/files/apps/landing/.bin/secrets.js +57 -0
- package/templates/react-monorepo/files/apps/landing/.env.example +20 -0
- package/templates/react-monorepo/files/apps/landing/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/apps/landing/index.html +51 -0
- package/templates/react-monorepo/files/apps/landing/package.json +33 -0
- package/templates/react-monorepo/files/apps/landing/src/App.tsx +3 -0
- package/templates/react-monorepo/files/apps/landing/src/app/providers.tsx +42 -0
- package/templates/react-monorepo/files/apps/landing/src/app/router.tsx +21 -0
- package/templates/react-monorepo/files/apps/landing/src/app/store.ts +18 -0
- package/templates/react-monorepo/files/apps/landing/src/features/seo/routes.ts +65 -0
- package/templates/react-monorepo/files/apps/landing/src/lib/env.ts +10 -0
- package/templates/react-monorepo/files/apps/landing/src/main.tsx +14 -0
- package/templates/react-monorepo/files/apps/landing/src/routes/home.tsx +18 -0
- package/templates/react-monorepo/files/apps/landing/src/vite-env.d.ts +15 -0
- package/templates/react-monorepo/files/apps/landing/tsconfig.json +10 -0
- package/templates/react-monorepo/files/apps/landing/vite.config.ts +169 -0
- package/templates/react-monorepo/files/build.sh +61 -0
- package/templates/react-monorepo/files/docker/nginx.conf +136 -0
- package/templates/react-monorepo/files/package.json +37 -0
- package/templates/react-monorepo/files/packages/.gitkeep +0 -0
- package/templates/react-monorepo/files/packages/api/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/packages/api/package.json +30 -0
- package/templates/react-monorepo/files/packages/api/src/base-api.ts +24 -0
- package/templates/react-monorepo/files/packages/api/src/base-query.ts +29 -0
- package/templates/react-monorepo/files/packages/api/src/config.ts +21 -0
- package/templates/react-monorepo/files/packages/api/src/index.ts +15 -0
- package/templates/react-monorepo/files/packages/api/src/realtime-events.ts +34 -0
- package/templates/react-monorepo/files/packages/api/src/socket.ts +41 -0
- package/templates/react-monorepo/files/packages/api/src/store.ts +39 -0
- package/templates/react-monorepo/files/packages/api/src/upload-query.ts +115 -0
- package/templates/react-monorepo/files/packages/api/tsconfig.json +4 -0
- package/templates/react-monorepo/files/packages/auth/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/packages/auth/package.json +33 -0
- package/templates/react-monorepo/files/packages/auth/src/client.ts +27 -0
- package/templates/react-monorepo/files/packages/auth/src/config.ts +22 -0
- package/templates/react-monorepo/files/packages/auth/src/guards.tsx +61 -0
- package/templates/react-monorepo/files/packages/auth/src/hooks.ts +13 -0
- package/templates/react-monorepo/files/packages/auth/src/index.ts +20 -0
- package/templates/react-monorepo/files/packages/auth/src/logout.ts +23 -0
- package/templates/react-monorepo/files/packages/auth/src/provider.tsx +52 -0
- package/templates/react-monorepo/files/packages/auth/src/redirect.ts +37 -0
- package/templates/react-monorepo/files/packages/auth/src/slice.ts +54 -0
- package/templates/react-monorepo/files/packages/auth/tsconfig.json +4 -0
- package/templates/react-monorepo/files/packages/config/README.md +47 -0
- package/templates/react-monorepo/files/packages/config/eslint/base.mjs +83 -0
- package/templates/react-monorepo/files/packages/config/package.json +37 -0
- package/templates/react-monorepo/files/packages/config/tailwind/theme.css +48 -0
- package/templates/react-monorepo/files/packages/config/tsconfig/base.json +22 -0
- package/templates/react-monorepo/files/packages/config/tsconfig/node.json +9 -0
- package/templates/react-monorepo/files/packages/config/tsconfig/react.json +9 -0
- package/templates/react-monorepo/files/packages/config/vite/index.d.ts +18 -0
- package/templates/react-monorepo/files/packages/config/vite/index.mjs +129 -0
- package/templates/react-monorepo/files/packages/hooks/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/packages/hooks/package.json +16 -0
- package/templates/react-monorepo/files/packages/hooks/src/index.ts +3 -0
- package/templates/react-monorepo/files/packages/hooks/tsconfig.json +4 -0
- package/templates/react-monorepo/files/packages/layouts/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/packages/layouts/package.json +30 -0
- package/templates/react-monorepo/files/packages/layouts/src/app-shell/app-shell.tsx +225 -0
- package/templates/react-monorepo/files/packages/layouts/src/app-shell/user-menu.tsx +74 -0
- package/templates/react-monorepo/files/packages/layouts/src/auth-layout.tsx +137 -0
- package/templates/react-monorepo/files/packages/layouts/src/error-boundary.tsx +38 -0
- package/templates/react-monorepo/files/packages/layouts/src/index.ts +23 -0
- package/templates/react-monorepo/files/packages/layouts/src/marketing/marketing-layout.tsx +29 -0
- package/templates/react-monorepo/files/packages/layouts/src/marketing/section-heading.tsx +38 -0
- package/templates/react-monorepo/files/packages/layouts/src/marketing/section.tsx +30 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/app-shell-skeleton.tsx +47 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/empty.tsx +22 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/forbidden.tsx +14 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/loading.tsx +11 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/not-found.tsx +21 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/page-skeleton.tsx +39 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/route-fallback.tsx +26 -0
- package/templates/react-monorepo/files/packages/layouts/src/states/state-screen.tsx +22 -0
- package/templates/react-monorepo/files/packages/layouts/tsconfig.json +4 -0
- package/templates/react-monorepo/files/packages/types/.bin/openapi.js +32 -0
- package/templates/react-monorepo/files/packages/types/.bin/secrets.js +57 -0
- package/templates/react-monorepo/files/packages/types/README.md +28 -0
- package/templates/react-monorepo/files/packages/types/eslint.config.mjs +3 -0
- package/templates/react-monorepo/files/packages/types/openapi-ts.config.ts +22 -0
- package/templates/react-monorepo/files/packages/types/package.json +29 -0
- package/templates/react-monorepo/files/packages/types/src/index.ts +4 -0
- package/templates/react-monorepo/files/packages/types/src/types/api/index.ts +9 -0
- package/templates/react-monorepo/files/packages/types/src/types/api/zod.gen.ts +5 -0
- package/templates/react-monorepo/files/packages/types/tsconfig.json +7 -0
- package/templates/react-monorepo/files/packages/ui/components.json +21 -0
- package/templates/react-monorepo/files/packages/ui/eslint.config.mjs +13 -0
- package/templates/react-monorepo/files/packages/ui/package.json +44 -0
- package/templates/react-monorepo/files/packages/ui/src/components/brand/logo.tsx +51 -0
- package/templates/react-monorepo/files/packages/ui/src/components/brand/social-icons.tsx +37 -0
- package/templates/react-monorepo/files/packages/ui/src/components/form/form.tsx +120 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/alert.tsx +25 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/button.tsx +43 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/calendar.tsx +78 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/card.tsx +44 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/checkbox.tsx +16 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/date-picker.tsx +76 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/input.tsx +22 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/label.tsx +19 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/modal.tsx +94 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/popover.tsx +31 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/progress.tsx +33 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/search-input.tsx +69 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/select.tsx +80 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/skeleton.tsx +12 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/sonner.tsx +23 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/spinner.tsx +8 -0
- package/templates/react-monorepo/files/packages/ui/src/components/ui/textarea.tsx +22 -0
- package/templates/react-monorepo/files/packages/ui/src/index.ts +45 -0
- package/templates/react-monorepo/files/packages/ui/src/lib/utils.ts +7 -0
- package/templates/react-monorepo/files/packages/ui/src/lib/zod-setup.ts +28 -0
- package/templates/react-monorepo/files/packages/ui/src/meta/brand.ts +18 -0
- package/templates/react-monorepo/files/packages/ui/src/meta/meta-context.ts +30 -0
- package/templates/react-monorepo/files/packages/ui/src/meta/meta-provider.tsx +24 -0
- package/templates/react-monorepo/files/packages/ui/src/meta/page-meta.tsx +69 -0
- package/templates/react-monorepo/files/packages/ui/src/meta/use-meta-config.ts +11 -0
- package/templates/react-monorepo/files/packages/ui/src/styles/globals.css +285 -0
- package/templates/react-monorepo/files/packages/ui/src/theme/init-script.ts +23 -0
- package/templates/react-monorepo/files/packages/ui/src/theme/theme-colors.ts +14 -0
- package/templates/react-monorepo/files/packages/ui/src/theme/theme-context.ts +60 -0
- package/templates/react-monorepo/files/packages/ui/src/theme/theme-provider.tsx +101 -0
- package/templates/react-monorepo/files/packages/ui/src/theme/theme-toggle.tsx +40 -0
- package/templates/react-monorepo/files/packages/ui/src/theme/use-theme.ts +11 -0
- package/templates/react-monorepo/files/packages/ui/tsconfig.json +9 -0
- package/templates/react-monorepo/files/turbo.json +24 -0
- package/templates/react-monorepo/template.json +230 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { Factory } from 'fishery';
|
|
2
|
+
import { faker as F } from '@faker-js/faker';
|
|
3
|
+
import { UserSession } from '@thallesp/nestjs-better-auth';
|
|
4
|
+
import { User } from '@db/client';
|
|
5
|
+
import { ok } from 'common/entity';
|
|
6
|
+
import { FileEntity } from 'media/entity'; // @feature media
|
|
7
|
+
|
|
8
|
+
export class Entity {
|
|
9
|
+
static get ok() {
|
|
10
|
+
return ok();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
static get user() {
|
|
14
|
+
return Factory.define<User>(() => ({
|
|
15
|
+
id: F.string.uuid(),
|
|
16
|
+
name: F.person.fullName(),
|
|
17
|
+
email: F.internet.email(),
|
|
18
|
+
image: F.image.avatar(),
|
|
19
|
+
emailVerified: F.datatype.boolean(),
|
|
20
|
+
banned: F.datatype.boolean(),
|
|
21
|
+
banReason: F.lorem.sentence(),
|
|
22
|
+
role: 'user',
|
|
23
|
+
banExpires: null,
|
|
24
|
+
onboardingCompletedAt: null,
|
|
25
|
+
createdAt: new Date(),
|
|
26
|
+
updatedAt: new Date()
|
|
27
|
+
}));
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
static get requestUser() {
|
|
31
|
+
return Factory.define<UserSession['user']>(() => ({
|
|
32
|
+
id: F.string.uuid(),
|
|
33
|
+
name: F.person.fullName(),
|
|
34
|
+
email: F.internet.email(),
|
|
35
|
+
image: F.image.avatar(),
|
|
36
|
+
emailVerified: F.datatype.boolean(),
|
|
37
|
+
banned: F.datatype.boolean(),
|
|
38
|
+
banReason: F.lorem.sentence(),
|
|
39
|
+
role: 'user',
|
|
40
|
+
banExpires: null,
|
|
41
|
+
createdAt: new Date(),
|
|
42
|
+
updatedAt: new Date()
|
|
43
|
+
}));
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
static get userSession() {
|
|
47
|
+
return Factory.define<UserSession>(() => {
|
|
48
|
+
const user = Entity.requestUser.build();
|
|
49
|
+
return {
|
|
50
|
+
user,
|
|
51
|
+
session: {
|
|
52
|
+
id: F.string.uuid(),
|
|
53
|
+
userId: user.id,
|
|
54
|
+
expiresAt: new Date(Date.now() + 1000 * 60 * 60), // 1 hour from now
|
|
55
|
+
token: F.string.alphanumeric(16),
|
|
56
|
+
createdAt: new Date(),
|
|
57
|
+
updatedAt: new Date()
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// @feature:start media
|
|
64
|
+
static get file() {
|
|
65
|
+
return Factory.define<FileEntity>(() => ({
|
|
66
|
+
path: F.image.avatar()
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
// @feature:end
|
|
70
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { createId as CUID } from '@paralleldrive/cuid2';
|
|
2
|
+
import { faker as F } from '@faker-js/faker';
|
|
3
|
+
import crypto from 'crypto';
|
|
4
|
+
import { generate } from 'randomstring';
|
|
5
|
+
|
|
6
|
+
interface EmailOptions {
|
|
7
|
+
firstName?: string | undefined;
|
|
8
|
+
lastName?: string | undefined;
|
|
9
|
+
provider?: string | undefined;
|
|
10
|
+
allowSpecialCharacters?: boolean | undefined;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface UsernameOptions {
|
|
14
|
+
firstName?: string | undefined;
|
|
15
|
+
lastName?: string | undefined;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface PasswordOptions {
|
|
19
|
+
length?: number | undefined;
|
|
20
|
+
memorable?: boolean | undefined;
|
|
21
|
+
pattern?: RegExp | undefined;
|
|
22
|
+
prefix?: string | undefined;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const DEFAULT_ROLES = ['superuser', 'admin', 'user'];
|
|
26
|
+
const SAMPLE_ROLES = [
|
|
27
|
+
...DEFAULT_ROLES,
|
|
28
|
+
'user_manager',
|
|
29
|
+
'moderator',
|
|
30
|
+
'analytics_user',
|
|
31
|
+
'guest',
|
|
32
|
+
'content_editor'
|
|
33
|
+
];
|
|
34
|
+
|
|
35
|
+
export class Gen {
|
|
36
|
+
static numeric(length: number) {
|
|
37
|
+
return generate({ charset: 'numeric', length });
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
static alphabet(size = 64) {
|
|
41
|
+
return crypto.randomBytes(size).toString('hex');
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
static uuid() {
|
|
45
|
+
return F.string.uuid();
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
static cuid() {
|
|
49
|
+
return CUID();
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
static fullName(sex?: 'female' | 'male') {
|
|
53
|
+
return `${F.person.firstName(sex)} ${F.person.lastName(sex)}`;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
static email(options?: EmailOptions) {
|
|
57
|
+
return F.internet.email(options);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
static username(options?: UsernameOptions) {
|
|
61
|
+
return F.internet.userName(options);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
static password(options?: PasswordOptions) {
|
|
65
|
+
return F.internet.password(options);
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
static defaultRole() {
|
|
69
|
+
return F.helpers.arrayElement(DEFAULT_ROLES);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
static role() {
|
|
73
|
+
return F.helpers.arrayElement(SAMPLE_ROLES);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { ExecutionContext } from '@nestjs/common';
|
|
2
|
+
import { createMock, DeepMocked } from '@golevelup/ts-vitest';
|
|
3
|
+
|
|
4
|
+
namespace Util {
|
|
5
|
+
export type Context = DeepMocked<ExecutionContext>;
|
|
6
|
+
|
|
7
|
+
export class ExceptionNotThrownError extends Error {
|
|
8
|
+
constructor() {
|
|
9
|
+
super('Exception not thrown');
|
|
10
|
+
this.name = 'ExceptionNotThrownError';
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export class Mock {
|
|
15
|
+
static executionContext() {
|
|
16
|
+
return createMock<ExecutionContext>();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { Util };
|
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
import { AppFactory } from '@test/factory/app';
|
|
2
|
+
import { TEST_ADMIN, TEST_USER } from '@test/factory/constants';
|
|
3
|
+
import { NotificationsService } from 'notifications/services/notifications.service';
|
|
4
|
+
|
|
5
|
+
describe('Notifications', () => {
|
|
6
|
+
let app: AppFactory;
|
|
7
|
+
let userCookie: string;
|
|
8
|
+
let adminCookie: string;
|
|
9
|
+
let userId: string;
|
|
10
|
+
|
|
11
|
+
// Seed through the service's write side — the same call other modules make —
|
|
12
|
+
// so these specs exercise the endpoints without depending on any producer.
|
|
13
|
+
const dispatch = (recipientId = userId, data: object = { message: 'Hi' }) =>
|
|
14
|
+
app.instance
|
|
15
|
+
.get(NotificationsService)
|
|
16
|
+
.dispatch(recipientId, 'system', data);
|
|
17
|
+
|
|
18
|
+
const listNotifications = (cookie: string, query = '') =>
|
|
19
|
+
app.request.get(`/v1/notifications${query}`).set('Cookie', cookie);
|
|
20
|
+
|
|
21
|
+
const unreadCount = (cookie: string) =>
|
|
22
|
+
app.request.get('/v1/notifications/unread-count').set('Cookie', cookie);
|
|
23
|
+
|
|
24
|
+
beforeAll(async () => {
|
|
25
|
+
app = await AppFactory.init();
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
afterAll(async () => {
|
|
29
|
+
await app.close();
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
beforeEach(async () => {
|
|
33
|
+
await app.refresh();
|
|
34
|
+
userCookie = (await app.signIn(TEST_USER.email, TEST_USER.password))
|
|
35
|
+
.cookie!;
|
|
36
|
+
adminCookie = (await app.signIn(TEST_ADMIN.email, TEST_ADMIN.password))
|
|
37
|
+
.cookie!;
|
|
38
|
+
const session = await app.request
|
|
39
|
+
.get('/auth/get-session')
|
|
40
|
+
.set('Cookie', userCookie);
|
|
41
|
+
userId = session.body.user.id;
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
describe('OpenAPI', () => {
|
|
45
|
+
it('lists the notification routes in /openapi-json', async () => {
|
|
46
|
+
const response = await app.request.get('/openapi-json');
|
|
47
|
+
expect(response.status).toBe(200);
|
|
48
|
+
const paths = Object.keys(response.body.paths ?? {});
|
|
49
|
+
expect(paths).toEqual(
|
|
50
|
+
expect.arrayContaining([
|
|
51
|
+
'/v1/notifications',
|
|
52
|
+
'/v1/notifications/unread-count',
|
|
53
|
+
'/v1/notifications/{id}/read',
|
|
54
|
+
'/v1/notifications/read-all'
|
|
55
|
+
])
|
|
56
|
+
);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
describe('OpenAPI components', () => {
|
|
61
|
+
it('documents the notification type from the Prisma enum', async () => {
|
|
62
|
+
const doc = (await app.request.get('/openapi-json')).body;
|
|
63
|
+
const { type } = doc.components.schemas.NotificationEntity.properties;
|
|
64
|
+
expect([...type.enum].sort()).toEqual(
|
|
65
|
+
['comment', 'mention', 'reply', 'system'].sort()
|
|
66
|
+
);
|
|
67
|
+
});
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
describe('GET /v1/notifications', () => {
|
|
71
|
+
it('rejects unauthenticated requests with 401', async () => {
|
|
72
|
+
const response = await listNotifications('');
|
|
73
|
+
expect(response.status).toBe(401);
|
|
74
|
+
});
|
|
75
|
+
|
|
76
|
+
it('starts empty for a fresh user', async () => {
|
|
77
|
+
const response = await listNotifications(userCookie);
|
|
78
|
+
expect(response.status).toBe(200);
|
|
79
|
+
expect(response.body.list).toEqual([]);
|
|
80
|
+
expect(response.body.total).toBe(0);
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
describe('dispatch', () => {
|
|
85
|
+
it('lists a dispatched notification for its recipient', async () => {
|
|
86
|
+
await dispatch(userId, { message: 'Welcome aboard' });
|
|
87
|
+
|
|
88
|
+
const response = await listNotifications(userCookie);
|
|
89
|
+
expect(response.status).toBe(200);
|
|
90
|
+
expect(response.body.total).toBe(1);
|
|
91
|
+
expect(response.body.list[0]).toMatchObject({
|
|
92
|
+
userId,
|
|
93
|
+
type: 'system',
|
|
94
|
+
readAt: null,
|
|
95
|
+
data: { message: 'Welcome aboard' }
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it("does not show one user's notifications to another", async () => {
|
|
100
|
+
await dispatch();
|
|
101
|
+
|
|
102
|
+
const response = await listNotifications(adminCookie);
|
|
103
|
+
expect(response.body.total).toBe(0);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
it('filters to unread with ?unread=true', async () => {
|
|
107
|
+
const first = await dispatch();
|
|
108
|
+
await dispatch();
|
|
109
|
+
await app.request
|
|
110
|
+
.patch(`/v1/notifications/${first!.id}/read`)
|
|
111
|
+
.set('Cookie', userCookie);
|
|
112
|
+
|
|
113
|
+
const response = await listNotifications(userCookie, '?unread=true');
|
|
114
|
+
expect(response.body.total).toBe(1);
|
|
115
|
+
});
|
|
116
|
+
});
|
|
117
|
+
|
|
118
|
+
describe('GET /v1/notifications/unread-count', () => {
|
|
119
|
+
it('counts only unread notifications', async () => {
|
|
120
|
+
const first = await dispatch();
|
|
121
|
+
await dispatch();
|
|
122
|
+
await dispatch();
|
|
123
|
+
await app.request
|
|
124
|
+
.patch(`/v1/notifications/${first!.id}/read`)
|
|
125
|
+
.set('Cookie', userCookie);
|
|
126
|
+
|
|
127
|
+
const response = await unreadCount(userCookie);
|
|
128
|
+
expect(response.status).toBe(200);
|
|
129
|
+
expect(response.body.count).toBe(2);
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
describe('PATCH /v1/notifications/:id/read', () => {
|
|
134
|
+
it('marks a single notification read and drops the unread count', async () => {
|
|
135
|
+
const { id } = (await dispatch())!;
|
|
136
|
+
|
|
137
|
+
const read = await app.request
|
|
138
|
+
.patch(`/v1/notifications/${id}/read`)
|
|
139
|
+
.set('Cookie', userCookie);
|
|
140
|
+
expect(read.status).toBe(200);
|
|
141
|
+
expect(read.body.readAt).toEqual(expect.any(String));
|
|
142
|
+
|
|
143
|
+
const count = await unreadCount(userCookie);
|
|
144
|
+
expect(count.body.count).toBe(0);
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
it("404s when marking another user's notification", async () => {
|
|
148
|
+
const { id } = (await dispatch())!;
|
|
149
|
+
|
|
150
|
+
// Admin has no such notification — it belongs to TEST_USER.
|
|
151
|
+
const response = await app.request
|
|
152
|
+
.patch(`/v1/notifications/${id}/read`)
|
|
153
|
+
.set('Cookie', adminCookie);
|
|
154
|
+
expect(response.status).toBe(404);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
|
|
158
|
+
describe('POST /v1/notifications/read-all', () => {
|
|
159
|
+
it('marks every notification read', async () => {
|
|
160
|
+
await dispatch();
|
|
161
|
+
await dispatch();
|
|
162
|
+
|
|
163
|
+
const response = await app.request
|
|
164
|
+
.post('/v1/notifications/read-all')
|
|
165
|
+
.set('Cookie', userCookie);
|
|
166
|
+
expect(response.status).toBe(200);
|
|
167
|
+
expect(response.body).toMatchObject({ status: 200, message: 'ok' });
|
|
168
|
+
|
|
169
|
+
const count = await unreadCount(userCookie);
|
|
170
|
+
expect(count.body.count).toBe(0);
|
|
171
|
+
|
|
172
|
+
const unread = await listNotifications(userCookie, '?unread=true');
|
|
173
|
+
expect(unread.body.total).toBe(0);
|
|
174
|
+
});
|
|
175
|
+
});
|
|
176
|
+
});
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { AppFactory } from '@test/factory/app';
|
|
2
|
+
import { TEST_USER } from '@test/factory/constants';
|
|
3
|
+
import { createAuthRateLimitStorage } from 'common/services';
|
|
4
|
+
import { AUTH_RATE_LIMIT_RULES } from 'lib/rate-limit';
|
|
5
|
+
|
|
6
|
+
// `GET /ping` on AppController carries @Throttle({ limit: 30, ttl: 60_000 }).
|
|
7
|
+
const PING = '/ping';
|
|
8
|
+
const PING_LIMIT = 30;
|
|
9
|
+
|
|
10
|
+
describe('Rate limiting', () => {
|
|
11
|
+
let app: AppFactory;
|
|
12
|
+
|
|
13
|
+
// .env.test turns throttling off so buckets cannot leak between specs; this
|
|
14
|
+
// spec is the one that needs it on, so it flips the flag before the app boots
|
|
15
|
+
// and restores it afterwards (spec files run one at a time).
|
|
16
|
+
const previous = process.env.RATE_LIMIT_ENABLED;
|
|
17
|
+
|
|
18
|
+
beforeAll(async () => {
|
|
19
|
+
process.env.RATE_LIMIT_ENABLED = 'true';
|
|
20
|
+
app = await AppFactory.init();
|
|
21
|
+
await app.refresh();
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
afterAll(async () => {
|
|
25
|
+
await app.close();
|
|
26
|
+
process.env.RATE_LIMIT_ENABLED = previous;
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
// Buckets live in Redis and outlive a single test.
|
|
30
|
+
beforeEach(async () => {
|
|
31
|
+
await app.cache.truncate();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
describe(`GET ${PING}`, () => {
|
|
35
|
+
it('allows requests up to the route limit', async () => {
|
|
36
|
+
for (let i = 0; i < PING_LIMIT; i++) {
|
|
37
|
+
const response = await app.request.get(PING);
|
|
38
|
+
expect(response.status).toBe(200);
|
|
39
|
+
}
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
it('returns 429 once the limit is exceeded', async () => {
|
|
43
|
+
for (let i = 0; i < PING_LIMIT; i++) {
|
|
44
|
+
await app.request.get(PING);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
const response = await app.request.get(PING);
|
|
48
|
+
expect(response.status).toBe(429);
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
it('sets Retry-After to the seconds remaining on the block', async () => {
|
|
52
|
+
for (let i = 0; i < PING_LIMIT; i++) {
|
|
53
|
+
await app.request.get(PING);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const response = await app.request.get(PING);
|
|
57
|
+
const retryAfter = Number(response.headers['retry-after']);
|
|
58
|
+
expect(retryAfter).toBeGreaterThan(0);
|
|
59
|
+
expect(retryAfter).toBeLessThanOrEqual(60);
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
it('exposes the remaining allowance while under the limit', async () => {
|
|
63
|
+
const response = await app.request.get(PING);
|
|
64
|
+
expect(response.status).toBe(200);
|
|
65
|
+
expect(Number(response.headers['x-ratelimit-limit'])).toBe(PING_LIMIT);
|
|
66
|
+
expect(Number(response.headers['x-ratelimit-remaining'])).toBe(
|
|
67
|
+
PING_LIMIT - 1
|
|
68
|
+
);
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('keeps counting per-route, so a different route is unaffected', async () => {
|
|
72
|
+
for (let i = 0; i < PING_LIMIT + 1; i++) {
|
|
73
|
+
await app.request.get(PING);
|
|
74
|
+
}
|
|
75
|
+
expect((await app.request.get(PING)).status).toBe(429);
|
|
76
|
+
|
|
77
|
+
// Anonymous, separate handler → separate bucket.
|
|
78
|
+
expect((await app.request.get('/')).status).not.toBe(429);
|
|
79
|
+
});
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
describe('storage', () => {
|
|
83
|
+
// Guards against silently falling back to throttler's in-memory storage,
|
|
84
|
+
// which would give each process its own buckets once we scale out.
|
|
85
|
+
it('keeps counters in Redis, not in process memory', async () => {
|
|
86
|
+
expect(await app.cache.db.keys('throttle:*')).toHaveLength(0);
|
|
87
|
+
|
|
88
|
+
await app.request.get(PING);
|
|
89
|
+
|
|
90
|
+
const keys = await app.cache.db.keys('throttle:default:*');
|
|
91
|
+
expect(keys).toHaveLength(1);
|
|
92
|
+
expect(await app.cache.db.get(keys[0])).toBe('1');
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('sets a TTL on the bucket so the window rolls over', async () => {
|
|
96
|
+
await app.request.get(PING);
|
|
97
|
+
|
|
98
|
+
const [key] = await app.cache.db.keys('throttle:default:*');
|
|
99
|
+
const ttl = await app.cache.db.pttl(key);
|
|
100
|
+
expect(ttl).toBeGreaterThan(0);
|
|
101
|
+
expect(ttl).toBeLessThanOrEqual(60_000);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('writes a block key once the limit is exceeded', async () => {
|
|
105
|
+
for (let i = 0; i < PING_LIMIT + 1; i++) {
|
|
106
|
+
await app.request.get(PING);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
expect(await app.cache.db.keys('throttle:default:*:block')).toHaveLength(
|
|
110
|
+
1
|
|
111
|
+
);
|
|
112
|
+
});
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// better-auth's own limiter on /auth/*, backed by createAuthRateLimitStorage.
|
|
116
|
+
describe('auth endpoints', () => {
|
|
117
|
+
const SIGN_IN = '/auth/sign-in/email';
|
|
118
|
+
const SIGN_IN_LIMIT = AUTH_RATE_LIMIT_RULES['/sign-in/email'].max;
|
|
119
|
+
|
|
120
|
+
// better-auth keys buckets on the client IP and skips limiting entirely
|
|
121
|
+
// when it cannot resolve one, so every request names its client.
|
|
122
|
+
const signIn = (ip = '203.0.113.7') =>
|
|
123
|
+
app.request
|
|
124
|
+
.post(SIGN_IN)
|
|
125
|
+
.set('x-forwarded-for', ip)
|
|
126
|
+
.send({ email: TEST_USER.email, password: 'wrong-password' });
|
|
127
|
+
|
|
128
|
+
it('returns 429 once the sign-in limit is exceeded', async () => {
|
|
129
|
+
for (let i = 0; i < SIGN_IN_LIMIT; i++) {
|
|
130
|
+
expect((await signIn()).status).not.toBe(429);
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const response = await signIn();
|
|
134
|
+
expect(response.status).toBe(429);
|
|
135
|
+
const retryAfter = Number(response.headers['x-retry-after']);
|
|
136
|
+
expect(retryAfter).toBeGreaterThan(0);
|
|
137
|
+
expect(retryAfter).toBeLessThanOrEqual(60);
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
it('keeps separate buckets per client IP', async () => {
|
|
141
|
+
for (let i = 0; i < SIGN_IN_LIMIT + 1; i++) await signIn();
|
|
142
|
+
|
|
143
|
+
expect((await signIn('198.51.100.9')).status).not.toBe(429);
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('keeps its counters in Redis with the rule window as TTL', async () => {
|
|
147
|
+
await signIn();
|
|
148
|
+
|
|
149
|
+
const keys = await app.cache.db.keys('auth:rl:*');
|
|
150
|
+
expect(keys).toHaveLength(1);
|
|
151
|
+
expect(await app.cache.db.get(keys[0])).toBe('1');
|
|
152
|
+
const ttl = await app.cache.db.pttl(keys[0]);
|
|
153
|
+
expect(ttl).toBeGreaterThan(0);
|
|
154
|
+
expect(ttl).toBeLessThanOrEqual(60_000);
|
|
155
|
+
});
|
|
156
|
+
|
|
157
|
+
it('admits exactly `max` concurrent requests', async () => {
|
|
158
|
+
// The storage checks and increments in one Redis call; a read-then-write
|
|
159
|
+
// would let every concurrent request see a below-limit count.
|
|
160
|
+
const storage = createAuthRateLimitStorage(app.cache);
|
|
161
|
+
const rule = { window: 60, max: 5 };
|
|
162
|
+
|
|
163
|
+
const results = await Promise.all(
|
|
164
|
+
Array.from({ length: 50 }, () => storage.consume('concurrency', rule))
|
|
165
|
+
);
|
|
166
|
+
|
|
167
|
+
expect(results.filter((r) => r.allowed)).toHaveLength(rule.max);
|
|
168
|
+
});
|
|
169
|
+
});
|
|
170
|
+
|
|
171
|
+
describe('exempt routes', () => {
|
|
172
|
+
it('does not throttle the index route', async () => {
|
|
173
|
+
// Well past any configured limit.
|
|
174
|
+
for (let i = 0; i < PING_LIMIT + 5; i++) {
|
|
175
|
+
const response = await app.request.get('/');
|
|
176
|
+
expect(response.status).not.toBe(429);
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import '@suites/doubles.vitest';
|