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.
TypeScript ai-agentsbill-of-materialserpinventory-managementleanmanufacturingmanufacturing-execution-systemmcp-servermesmrpopen-source-erppostgresqlproduction-planningqmsquality-management-systemreact-routerself-hostedsupabasetraceabilitytypescript
feat: sst deployment
Brad Barbin2b0a24997ffb
diff --git a/.dockerignore b/.dockerignorenew file mode 100644index 0000000000..d98fe17111--- /dev/null+++ b/.dockerignore@@ -0,0 +1,3 @@++# sst+.sst\ No newline at end of filediff --git a/apps/academy/sst-env.d.ts b/apps/academy/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/apps/academy/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/apps/erp/sst-env.d.ts b/apps/erp/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/apps/erp/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/apps/mes/sst-env.d.ts b/apps/mes/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/apps/mes/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/apps/starter/sst-env.d.ts b/apps/starter/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/apps/starter/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/ci/sst-env.d.ts b/ci/sst-env.d.tsnew file mode 100644index 0000000000..f742a12004--- /dev/null+++ b/ci/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../sst-env.d.ts" />++import "sst"+export {}\ No newline at end of filediff --git a/examples/quote-configurator/sst-env.d.ts b/examples/quote-configurator/sst-env.d.tsnew file mode 100644index 0000000000..b6a7e9066e--- /dev/null+++ b/examples/quote-configurator/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst"+export {}\ No newline at end of filediff --git a/examples/upload-3d-model/sst-env.d.ts b/examples/upload-3d-model/sst-env.d.tsnew file mode 100644index 0000000000..b6a7e9066e--- /dev/null+++ b/examples/upload-3d-model/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst"+export {}\ No newline at end of filediff --git a/llm/cache/sst-deployment-infrastructure.md b/llm/cache/sst-deployment-infrastructure.mdnew file mode 100644index 0000000000..559c95cbf8--- /dev/null+++ b/llm/cache/sst-deployment-infrastructure.md@@ -0,0 +1,120 @@+# SST Deployment and Infrastructure Configuration++## Overview++Carbon uses SST (Serverless Stack) for AWS infrastructure deployment and management. The project is configured to deploy on AWS with containerized applications running on ECS clusters.++## SST Configuration++### Main Configuration File++**Location**: `/sst.config.ts`++The SST configuration deploys Carbon as containerized services on AWS using:+- **App Name**: `carbon`+- **Cloud Provider**: AWS (`home: "aws"`)+- **Region**: `us-gov-east-1` (AWS GovCloud)+- **Removal Policy**: `retain` for production, `remove` for other stages++### Infrastructure Components++#### VPC and Cluster+- **VPC**: `CarbonVpc` - Virtual Private Cloud for the application+- **Cluster**: `CarbonCluster` - ECS cluster running on the VPC++#### Services+1. **CarbonERPService**+ - **Port Mapping**: External port 80 → Internal port 3000+ - **Dockerfile**: `apps/erp/Dockerfile`+ - **Context**: Root directory (`./`)++2. **CarbonMESService**+ - **Port Mapping**: External port 80 → Internal port 3001+ - **Dockerfile**: `apps/mes/Dockerfile`+ - **Context**: Root directory (`./`)++#### Security - Web Application Firewall (WAF)+- **Rate Limiting**: 200 requests per IP+- **AWS Managed Rules**: Uses `AWSManagedRulesCommonRuleSet`+- **Scope**: Regional (ALB protection)+- **Metrics**: CloudWatch monitoring enabled++### Environment Variables++Both ERP and MES services receive identical environment variable configurations including:++#### Authentication & Database+- `SUPABASE_*` - Supabase database and auth configuration+- `SESSION_SECRET` - Session management++#### External Services+- `AUTODESK_*` - CAD integration+- `CLOUDFLARE_TURNSTILE_*` - Bot protection+- `EXCHANGE_RATES_API_KEY` - Currency exchange+- `NOVU_*` - Notifications+- `OPENAI_API_KEY` - AI features+- `POSTHOG_*` - Analytics+- `RESEND_API_KEY` - Email service+- `SLACK_*` - Slack integration+- `STRIPE_*` - Payment processing+- `TRIGGER_*` - Job queue (Trigger.dev)+- `UPSTASH_REDIS_*` - Redis KV store++#### Configuration+- `CARBON_EDITION` - Product edition+- `CONTROLLED_ENVIRONMENT` - Environment type+- `DOMAIN` - Application domain+- `VERCEL_*` - Vercel deployment context++## Container Configuration++### ERP Application (`apps/erp/Dockerfile`)+- **Base Image**: `node:20-alpine`+- **Build Process**: Multi-stage build+- **Port**: 3000+- **Build Command**: `npx turbo run build --filter=./apps/erp`++### MES Application (`apps/mes/Dockerfile`)+- **Base Image**: `node:20-alpine`+- **Build Process**: Multi-stage build+- **Port**: 3001 (note: Dockerfile shows 3001 expose but ENV shows 3000)+- **Build Command**: `npx turbo run build --filter=./apps/mes`++## Generated Files++SST generates type definition files (`sst-env.d.ts`) in each app and package directory for type safety when accessing SST resources.++**Example Resource Types**:+```typescript+declare module "sst" {+ export interface Resource {+ "ERPApi": {+ "type": "sst.aws.ApiGatewayV2"+ "url": string+ }+ }+}+```++## Dependencies++- **SST Version**: `3.17.14` (listed in root `package.json`)+- **Deployment Scripts**: `turbo run deploy` command available++## Current Branch Status++The project is currently on branch `feat/sst-cluster` which suggests active development of the SST cluster infrastructure.++## Deploy Command++The project includes a `deploy` script that uses Turbo to run deployments:+```bash+npm run deploy # Runs turbo run deploy+```++## Notes++- The deployment targets AWS GovCloud (us-gov-east-1), indicating potential government/federal compliance requirements+- Both applications share the same environment variables, suggesting a shared configuration approach+- WAF protection is configured with rate limiting and AWS managed security rules+- The infrastructure uses container-based deployment rather than serverless functions\ No newline at end of filediff --git a/package-lock.json b/package-lock.jsonindex 4eb0f3bc78..47fbf01caa 100644--- a/package-lock.json+++ b/package-lock.json@@ -11,7 +11,11 @@"examples/*","packages/*"],+ "dependencies": {+ "sst": "3.17.14"+ },"devDependencies": {+ "@types/aws-lambda": "8.10.152","csv-parse": "^5.5.0","eslint": "^8.23.1","eslint-config-carbon": "*",@@ -11898,6 +11902,11 @@"url": "https://github.com/sponsors/isaacs"}},+ "node_modules/@tsconfig/bun": {+ "version": "1.0.7",+ "resolved": "https://registry.npmjs.org/@tsconfig/bun/-/bun-1.0.7.tgz",+ "integrity": "sha512-udGrGJBNQdXGVulehc1aWT73wkR9wdaGBtB6yL70RJsqwW/yJhIg6ZbRlPOfIUiFNrnBuYLBi9CSmMKfDC7dvA=="+ },"node_modules/@tufjs/canonical-json": {"version": "1.0.0","resolved": "https://registry.npmjs.org/@tufjs/canonical-json/-/canonical-json-1.0.0.tgz",@@ -11953,6 +11962,12 @@"resolved": "https://registry.npmjs.org/@types/aria-query/-/aria-query-5.0.4.tgz","integrity": "sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw=="},+ "node_modules/@types/aws-lambda": {+ "version": "8.10.152",+ "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.152.tgz",+ "integrity": "sha512-soT/c2gYBnT5ygwiHPmd9a1bftj462NWVk2tKCc1PYHSIacB2UwbTS2zYG4jzag1mRDuzg/OjtxQjQ2NKRB6Rw==",+ "dev": true+ },"node_modules/@types/babel__core": {"version": "7.20.5","resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz",@@ -14658,6 +14673,82 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/aws-sdk": {+ "version": "2.1692.0",+ "resolved": "https://registry.npmjs.org/aws-sdk/-/aws-sdk-2.1692.0.tgz",+ "integrity": "sha512-x511uiJ/57FIsbgUe5csJ13k3uzu25uWQE+XqfBis/sB0SFoiElJWXRkgEAUh0U6n40eT3ay5Ue4oPkRMu1LYw==",+ "hasInstallScript": true,+ "dependencies": {+ "buffer": "4.9.2",+ "events": "1.1.1",+ "ieee754": "1.1.13",+ "jmespath": "0.16.0",+ "querystring": "0.2.0",+ "sax": "1.2.1",+ "url": "0.10.3",+ "util": "^0.12.4",+ "uuid": "8.0.0",+ "xml2js": "0.6.2"+ },+ "engines": {+ "node": ">= 10.0.0"+ }+ },+ "node_modules/aws-sdk/node_modules/buffer": {+ "version": "4.9.2",+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-4.9.2.tgz",+ "integrity": "sha512-xq+q3SRMOxGivLhBNaUdC64hDTQwejJ+H0T/NB1XMtTVEwNTrfFF3gAxiyW0Bu/xWEGhjVKgUcMhCrUy2+uCWg==",+ "dependencies": {+ "base64-js": "^1.0.2",+ "ieee754": "^1.1.4",+ "isarray": "^1.0.0"+ }+ },+ "node_modules/aws-sdk/node_modules/events": {+ "version": "1.1.1",+ "resolved": "https://registry.npmjs.org/events/-/events-1.1.1.tgz",+ "integrity": "sha512-kEcvvCBByWXGnZy6JUlgAp2gBIUjfCAV6P6TgT1/aaQKcmuAEC4OZTV1I4EWQLz2gxZw76atuVyvHhTxvi0Flw==",+ "engines": {+ "node": ">=0.4.x"+ }+ },+ "node_modules/aws-sdk/node_modules/ieee754": {+ "version": "1.1.13",+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz",+ "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg=="+ },+ "node_modules/aws-sdk/node_modules/isarray": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz",+ "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ=="+ },+ "node_modules/aws-sdk/node_modules/punycode": {+ "version": "1.3.2",+ "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.3.2.tgz",+ "integrity": "sha512-RofWgt/7fL5wP1Y7fxE7/EmTLzQVnB0ycyibJ0OOHIlJqTNzglYFxVwETOcIoJqJmpDXJ9xImDv+Fq34F/d4Dw=="+ },+ "node_modules/aws-sdk/node_modules/url": {+ "version": "0.10.3",+ "resolved": "https://registry.npmjs.org/url/-/url-0.10.3.tgz",+ "integrity": "sha512-hzSUW2q06EqL1gKM/a+obYHLIO6ct2hwPuviqTTOcfFVc61UbfJ2Q32+uGL/HCPxKqrdGB5QUwIe7UqlDgwsOQ==",+ "dependencies": {+ "punycode": "1.3.2",+ "querystring": "0.2.0"+ }+ },+ "node_modules/aws-sdk/node_modules/uuid": {+ "version": "8.0.0",+ "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz",+ "integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw==",+ "bin": {+ "uuid": "dist/bin/uuid"+ }+ },+ "node_modules/aws4fetch": {+ "version": "1.0.18",+ "resolved": "https://registry.npmjs.org/aws4fetch/-/aws4fetch-1.0.18.tgz",+ "integrity": "sha512-3Cf+YaUl07p24MoQ46rFwulAmiyCwH2+1zw1ZyPAX5OtJ34Hh185DwB8y/qRLb6cYYYtSFJ9pthyLc0MD4e8sQ=="+ },"node_modules/axe-core": {"version": "4.10.2","resolved": "https://registry.npmjs.org/axe-core/-/axe-core-4.10.2.tgz",@@ -20530,6 +20621,14 @@"url": "https://opencollective.com/unified"}},+ "node_modules/hono": {+ "version": "4.7.4",+ "resolved": "https://registry.npmjs.org/hono/-/hono-4.7.4.tgz",+ "integrity": "sha512-Pst8FuGqz3L7tFF+u9Pu70eI0xa5S3LPUmrNd5Jm8nTHze9FxLTK9Kaj5g/k4UcwuJSXTP65SyHOPLrffpcAJg==",+ "engines": {+ "node": ">=16.9.0"+ }+ },"node_modules/hosted-git-info": {"version": "2.8.9","resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.9.tgz",@@ -23127,6 +23226,14 @@"resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz","integrity": "sha512-8wb9Yw966OSxApiCt0K3yNJL8pnNeIv+OEq2YMidz4FKP6nonSRoOXc80iXY4JaN2FC11B9qsNmDsm+ZOfMROA=="},+ "node_modules/jmespath": {+ "version": "0.16.0",+ "resolved": "https://registry.npmjs.org/jmespath/-/jmespath-0.16.0.tgz",+ "integrity": "sha512-9FzQjJ7MATs1tSpnco1K6ayiYE3figslrXA72G2HQ/n76RzvYlofyi5QM+iX4YRs/pu3yzxlVQSST23+dMDknw==",+ "engines": {+ "node": ">= 0.6.0"+ }+ },"node_modules/joi": {"version": "17.13.3","resolved": "https://registry.npmjs.org/joi/-/joi-17.13.3.tgz",@@ -27309,6 +27416,14 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/oidc-token-hash": {+ "version": "5.1.1",+ "resolved": "https://registry.npmjs.org/oidc-token-hash/-/oidc-token-hash-5.1.1.tgz",+ "integrity": "sha512-D7EmwxJV6DsEB6vOFLrBM2OzsVgQzgPWyHlV2OOAVj772n+WTXpudC9e9u5BVKQnYwaD30Ivhi9b+4UeBcGu9g==",+ "engines": {+ "node": "^10.13.0 || >=12.0.0"+ }+ },"node_modules/on-finished": {"version": "2.4.1","resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz",@@ -27421,6 +27536,357 @@"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-5.26.5.tgz","integrity": "sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA=="},+ "node_modules/opencontrol": {+ "version": "0.0.6",+ "resolved": "https://registry.npmjs.org/opencontrol/-/opencontrol-0.0.6.tgz",+ "integrity": "sha512-QeCrpOK5D15QV8kjnGVeD/BHFLwcVr+sn4T6KKmP0WAMs2pww56e4h+eOGHb5iPOufUQXbdbBKi6WV2kk7tefQ==",+ "dependencies": {+ "@modelcontextprotocol/sdk": "1.6.1",+ "@tsconfig/bun": "1.0.7",+ "hono": "4.7.4",+ "zod": "3.24.2",+ "zod-to-json-schema": "3.24.3"+ },+ "bin": {+ "opencontrol": "bin/index.mjs"+ }+ },+ "node_modules/opencontrol/node_modules/@modelcontextprotocol/sdk": {+ "version": "1.6.1",+ "resolved": "https://registry.npmjs.org/@modelcontextprotocol/sdk/-/sdk-1.6.1.tgz",+ "integrity": "sha512-oxzMzYCkZHMntzuyerehK3fV6A2Kwh5BD6CGEJSVDU2QNEhfLOptf2X7esQgaHZXHZY0oHmMsOtIDLP71UJXgA==",+ "dependencies": {+ "content-type": "^1.0.5",+ "cors": "^2.8.5",+ "eventsource": "^3.0.2",+ "express": "^5.0.1",+ "express-rate-limit": "^7.5.0",+ "pkce-challenge": "^4.1.0",+ "raw-body": "^3.0.0",+ "zod": "^3.23.8",+ "zod-to-json-schema": "^3.24.1"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/opencontrol/node_modules/accepts": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/accepts/-/accepts-2.0.0.tgz",+ "integrity": "sha512-5cvg6CtKwfgdmVqY1WIiXKc3Q1bkRqGLi+2W/6ao+6Y7gu/RCwRuAhGEzh5B4KlszSuTLgZYuqFqo5bImjNKng==",+ "dependencies": {+ "mime-types": "^3.0.0",+ "negotiator": "^1.0.0"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/opencontrol/node_modules/body-parser": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-2.2.0.tgz",+ "integrity": "sha512-02qvAaxv8tp7fBa/mw1ga98OGm+eCbqzJOKoRt70sLmfEEi+jyBYVTDGfCL/k06/4EMk/z01gCe7HoCH/f2LTg==",+ "dependencies": {+ "bytes": "^3.1.2",+ "content-type": "^1.0.5",+ "debug": "^4.4.0",+ "http-errors": "^2.0.0",+ "iconv-lite": "^0.6.3",+ "on-finished": "^2.4.1",+ "qs": "^6.14.0",+ "raw-body": "^3.0.0",+ "type-is": "^2.0.0"+ },+ "engines": {+ "node": ">=18"+ }+ },+ "node_modules/opencontrol/node_modules/content-disposition": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-1.0.0.tgz",+ "integrity": "sha512-Au9nRL8VNUut/XSzbQA38+M78dzP4D+eqg3gfJHMIHHYa3bg067xj1KxMUWj+VULbiZMowKngFFbKczUrNJ1mg==",+ "dependencies": {+ "safe-buffer": "5.2.1"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/opencontrol/node_modules/cookie": {+ "version": "0.7.2",+ "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.7.2.tgz",+ "integrity": "sha512-yki5XnKuf750l50uGTllt6kKILY4nQ1eNIQatoXEByZ5dWgnKqbnqmTrBE5B4N7lrMJKQ2ytWMiTO2o0v6Ew/w==",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/opencontrol/node_modules/express": {+ "version": "5.1.0",+ "resolved": "https://registry.npmjs.org/express/-/express-5.1.0.tgz",+ "integrity": "sha512-DT9ck5YIRU+8GYzzU5kT3eHGA5iL+1Zd0EutOmTE9Dtk+Tvuzd23VBU+ec7HPNSTxXYO55gPV/hq4pSBJDjFpA==",+ "dependencies": {+ "accepts": "^2.0.0",+ "body-parser": "^2.2.0",+ "content-disposition": "^1.0.0",+ "content-type": "^1.0.5",+ "cookie": "^0.7.1",+ "cookie-signature": "^1.2.1",+ "debug": "^4.4.0",+ "encodeurl": "^2.0.0",+ "escape-html": "^1.0.3",+ "etag": "^1.8.1",+ "finalhandler": "^2.1.0",+ "fresh": "^2.0.0",+ "http-errors": "^2.0.0",+ "merge-descriptors": "^2.0.0",+ "mime-types": "^3.0.0",+ "on-finished": "^2.4.1",+ "once": "^1.4.0",+ "parseurl": "^1.3.3",+ "proxy-addr": "^2.0.7",+ "qs": "^6.14.0",+ "range-parser": "^1.2.1",+ "router": "^2.2.0",+ "send": "^1.1.0",+ "serve-static": "^2.2.0",+ "statuses": "^2.0.1",+ "type-is": "^2.0.1",+ "vary": "^1.1.2"+ },+ "engines": {+ "node": ">= 18"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/opencontrol/node_modules/finalhandler": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-2.1.0.tgz",+ "integrity": "sha512-/t88Ty3d5JWQbWYgaOGCCYfXRwV1+be02WqYYlL6h0lEiUAMPM8o8qKGO01YIkOHzka2up08wvgYD0mDiI+q3Q==",+ "dependencies": {+ "debug": "^4.4.0",+ "encodeurl": "^2.0.0",+ "escape-html": "^1.0.3",+ "on-finished": "^2.4.1",+ "parseurl": "^1.3.3",+ "statuses": "^2.0.1"+ },+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/opencontrol/node_modules/fresh": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/fresh/-/fresh-2.0.0.tgz",+ "integrity": "sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/opencontrol/node_modules/iconv-lite": {+ "version": "0.6.3",+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz",+ "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==",+ "dependencies": {+ "safer-buffer": ">= 2.1.2 < 3.0.0"+ },+ "engines": {+ "node": ">=0.10.0"+ }+ },+ "node_modules/opencontrol/node_modules/media-typer": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-1.1.0.tgz",+ "integrity": "sha512-aisnrDP4GNe06UcKFnV5bfMNPBUw4jsLGaWwWfnH3v02GnBuXX2MCVn5RbrWo0j3pczUilYblq7fQ7Nw2t5XKw==",+ "engines": {+ "node": ">= 0.8"+ }+ },+ "node_modules/opencontrol/node_modules/merge-descriptors": {+ "version": "2.0.0",+ "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-2.0.0.tgz",+ "integrity": "sha512-Snk314V5ayFLhp3fkUREub6WtjBfPdCPY1Ln8/8munuLuiYhsABgBVWsozAG+MWMbVEvcdcpbi9R7ww22l9Q3g==",+ "engines": {+ "node": ">=18"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },+ "node_modules/opencontrol/node_modules/mime-types": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-3.0.1.tgz",+ "integrity": "sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==",+ "dependencies": {+ "mime-db": "^1.54.0"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/opencontrol/node_modules/negotiator": {+ "version": "1.0.0",+ "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-1.0.0.tgz",+ "integrity": "sha512-8Ofs/AUQh8MaEcrlq5xOX0CQ9ypTF5dl78mjlMNfOK08fzpgTHQRQPBxcPlEtIw0yRpws+Zo/3r+5WRby7u3Gg==",+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/opencontrol/node_modules/qs": {+ "version": "6.14.0",+ "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz",+ "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==",+ "dependencies": {+ "side-channel": "^1.1.0"+ },+ "engines": {+ "node": ">=0.6"+ },+ "funding": {+ "url": "https://github.com/sponsors/ljharb"+ }+ },+ "node_modules/opencontrol/node_modules/raw-body": {+ "version": "3.0.1",+ "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-3.0.1.tgz",+ "integrity": "sha512-9G8cA+tuMS75+6G/TzW8OtLzmBDMo8p1JRxN5AZ+LAp8uxGA8V8GZm4GQ4/N5QNQEnLmg6SS7wyuSmbKepiKqA==",+ "dependencies": {+ "bytes": "3.1.2",+ "http-errors": "2.0.0",+ "iconv-lite": "0.7.0",+ "unpipe": "1.0.0"+ },+ "engines": {+ "node": ">= 0.10"+ }+ },+ "node_modules/opencontrol/node_modules/raw-body/node_modules/iconv-lite": {+ "version": "0.7.0",+ "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.7.0.tgz",+ "integrity": "sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==",+ "dependencies": {+ "safer-buffer": ">= 2.1.2 < 3.0.0"+ },+ "engines": {+ "node": ">=0.10.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/express"+ }+ },+ "node_modules/opencontrol/node_modules/send": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/send/-/send-1.2.0.tgz",+ "integrity": "sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==",+ "dependencies": {+ "debug": "^4.3.5",+ "encodeurl": "^2.0.0",+ "escape-html": "^1.0.3",+ "etag": "^1.8.1",+ "fresh": "^2.0.0",+ "http-errors": "^2.0.0",+ "mime-types": "^3.0.1",+ "ms": "^2.1.3",+ "on-finished": "^2.4.1",+ "range-parser": "^1.2.1",+ "statuses": "^2.0.1"+ },+ "engines": {+ "node": ">= 18"+ }+ },+ "node_modules/opencontrol/node_modules/serve-static": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-2.2.0.tgz",+ "integrity": "sha512-61g9pCh0Vnh7IutZjtLGGpTA355+OPn2TyDv/6ivP2h/AdAVX9azsoxmg2/M6nZeQZNYBEwIcsne1mJd9oQItQ==",+ "dependencies": {+ "encodeurl": "^2.0.0",+ "escape-html": "^1.0.3",+ "parseurl": "^1.3.3",+ "send": "^1.2.0"+ },+ "engines": {+ "node": ">= 18"+ }+ },+ "node_modules/opencontrol/node_modules/type-is": {+ "version": "2.0.1",+ "resolved": "https://registry.npmjs.org/type-is/-/type-is-2.0.1.tgz",+ "integrity": "sha512-OZs6gsjF4vMp32qrCbiVSkrFmXtG/AZhY3t0iAMrMBiAZyV9oALtXO8hsrHbMXF9x6L3grlFuwW2oAz7cav+Gw==",+ "dependencies": {+ "content-type": "^1.0.5",+ "media-typer": "^1.1.0",+ "mime-types": "^3.0.0"+ },+ "engines": {+ "node": ">= 0.6"+ }+ },+ "node_modules/opencontrol/node_modules/zod": {+ "version": "3.24.2",+ "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.2.tgz",+ "integrity": "sha512-lY7CDW43ECgW9u1TcT3IoXHflywfVqDYze4waEz812jR/bZ8FHDsl7pFQoSZTz5N+2NqRXs8GBwnAwo3ZNxqhQ==",+ "funding": {+ "url": "https://github.com/sponsors/colinhacks"+ }+ },+ "node_modules/opencontrol/node_modules/zod-to-json-schema": {+ "version": "3.24.3",+ "resolved": "https://registry.npmjs.org/zod-to-json-schema/-/zod-to-json-schema-3.24.3.tgz",+ "integrity": "sha512-HIAfWdYIt1sssHfYZFCXp4rU1w2r8hVVXYIlmoa0r0gABLs5di3RCqPU5DDROogVz1pAdYBaz7HK5n9pSUNs3A==",+ "peerDependencies": {+ "zod": "^3.24.1"+ }+ },+ "node_modules/openid-client": {+ "version": "5.6.4",+ "resolved": "https://registry.npmjs.org/openid-client/-/openid-client-5.6.4.tgz",+ "integrity": "sha512-T1h3B10BRPKfcObdBklX639tVz+xh34O7GjofqrqiAQdm7eHsQ00ih18x6wuJ/E6FxdtS2u3FmUGPDeEcMwzNA==",+ "dependencies": {+ "jose": "^4.15.4",+ "lru-cache": "^6.0.0",+ "object-hash": "^2.2.0",+ "oidc-token-hash": "^5.0.3"+ },+ "funding": {+ "url": "https://github.com/sponsors/panva"+ }+ },+ "node_modules/openid-client/node_modules/jose": {+ "version": "4.15.9",+ "resolved": "https://registry.npmjs.org/jose/-/jose-4.15.9.tgz",+ "integrity": "sha512-1vUQX+IdDMVPj4k8kOxgUqlcK518yluMuGZwqlr44FS1ppZB/5GWh4rZG89erpOBOJjU/OBsnCVFfapsRz6nEA==",+ "funding": {+ "url": "https://github.com/sponsors/panva"+ }+ },+ "node_modules/openid-client/node_modules/lru-cache": {+ "version": "6.0.0",+ "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz",+ "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==",+ "dependencies": {+ "yallist": "^4.0.0"+ },+ "engines": {+ "node": ">=10"+ }+ },+ "node_modules/openid-client/node_modules/object-hash": {+ "version": "2.2.0",+ "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-2.2.0.tgz",+ "integrity": "sha512-gScRMn0bS5fH+IuwyIFgnh9zBdo4DV+6GhygmWM9HyNJSgS0hScp1f5vjtm7oIIOiT9trXrShAkLFSc2IqKNgw==",+ "engines": {+ "node": ">= 6"+ }+ },+ "node_modules/openid-client/node_modules/yallist": {+ "version": "4.0.0",+ "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz",+ "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A=="+ },"node_modules/openurl": {"version": "1.1.1","resolved": "https://registry.npmjs.org/openurl/-/openurl-1.1.1.tgz",@@ -29315,6 +29781,15 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/querystring": {+ "version": "0.2.0",+ "resolved": "https://registry.npmjs.org/querystring/-/querystring-0.2.0.tgz",+ "integrity": "sha512-X/xY82scca2tau62i9mDyU9K+I+djTMUsvwf7xnUX5GLvVzgJybOJf4Y6o9Zx3oJK/LSXg5tTZBjwzqVPaPO2g==",+ "deprecated": "The querystring API is considered Legacy. new code should use the URLSearchParams API instead.",+ "engines": {+ "node": ">=0.4.x"+ }+ },"node_modules/querystringify": {"version": "2.2.0","resolved": "https://registry.npmjs.org/querystringify/-/querystringify-2.2.0.tgz",@@ -31300,6 +31775,11 @@"postcss": "^8.3.11"}},+ "node_modules/sax": {+ "version": "1.2.1",+ "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.1.tgz",+ "integrity": "sha512-8I2a3LovHTOpm7NV5yOyO8IHqgVsfK4+UuySrXU8YXkSRX7k6hCV9b3HrkKCr3nMpgj+0bmocaJJWpvp1oc7ZA=="+ },"node_modules/saxes": {"version": "5.0.1","resolved": "https://registry.npmjs.org/saxes/-/saxes-5.0.1.tgz",@@ -32221,6 +32701,135 @@"node": "^14.17.0 || ^16.13.0 || >=18.0.0"}},+ "node_modules/sst": {+ "version": "3.17.14",+ "resolved": "https://registry.npmjs.org/sst/-/sst-3.17.14.tgz",+ "integrity": "sha512-HkyMnBj55DZjzgNFoHQ1XPr9vXi2UHWz3TkuboyCybpJQcR7vW4za8uDDDPivAcUyqQe2aP8pzuxL6+cAztqsg==",+ "dependencies": {+ "aws-sdk": "2.1692.0",+ "aws4fetch": "1.0.18",+ "jose": "5.2.3",+ "opencontrol": "0.0.6",+ "openid-client": "5.6.4"+ },+ "bin": {+ "sst": "bin/sst.mjs"+ },+ "optionalDependencies": {+ "sst-darwin-arm64": "3.17.14",+ "sst-darwin-x64": "3.17.14",+ "sst-linux-arm64": "3.17.14",+ "sst-linux-x64": "3.17.14",+ "sst-linux-x86": "3.17.14",+ "sst-win32-arm64": "3.17.14",+ "sst-win32-x64": "3.17.14",+ "sst-win32-x86": "3.17.14"+ }+ },+ "node_modules/sst-darwin-arm64": {+ "version": "3.17.14",+ "resolved": "https://registry.npmjs.org/sst-darwin-arm64/-/sst-darwin-arm64-3.17.14.tgz",+ "integrity": "sha512-ItOltB8HH+8XSS7FnQfR/yqsJVMr+/HvibBCNOf57WnjuNqWGLB4db/ESCeYuaQqpjpUt5lrT9ezflWrf4O9Tg==",+ "cpu": [+ "arm64"+ ],+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/sst-darwin-x64": {+ "version": "3.17.14",+ "resolved": "https://registry.npmjs.org/sst-darwin-x64/-/sst-darwin-x64-3.17.14.tgz",+ "integrity": "sha512-J22TN1Fa878qUXsZtPybzrUbGd68p6CjXpmpqMVTyKJ9u/purkO2TiXtcFs7Ow4nr1RuCXFKo3eQ1fHDeO9YUg==",+ "cpu": [+ "x64"+ ],+ "optional": true,+ "os": [+ "darwin"+ ]+ },+ "node_modules/sst-linux-arm64": {+ "version": "3.17.14",+ "resolved": "https://registry.npmjs.org/sst-linux-arm64/-/sst-linux-arm64-3.17.14.tgz",+ "integrity": "sha512-5wivBPIcRClHdWknp4z/lww7WyU27YkHEfF2lmt7dDS1XtM3VfTW1GdzQDsaox3wdIAmpKeYF5Wg79+cCRM/iA==",+ "cpu": [+ "arm64"+ ],+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/sst-linux-x64": {+ "version": "3.17.14",+ "resolved": "https://registry.npmjs.org/sst-linux-x64/-/sst-linux-x64-3.17.14.tgz",+ "integrity": "sha512-fAaTdD6eP3kuNzkGVdYu3MOuNJkpm1rOH5Um2R2gbjtHwZ0QwP8r0f1d/ghP2kHXdgJqiNwqBbZmOuRCqmCuRA==",+ "cpu": [+ "x64"+ ],+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/sst-linux-x86": {+ "version": "3.17.14",+ "resolved": "https://registry.npmjs.org/sst-linux-x86/-/sst-linux-x86-3.17.14.tgz",+ "integrity": "sha512-I0/IQmBk/4o1FVzMov9Ombxab4GzGNxGoyC3HTqDCRwC4jS9mnv5eTTpOQ57kGYehSnzUcflDPLZtVmKCc19+Q==",+ "cpu": [+ "x86"+ ],+ "optional": true,+ "os": [+ "linux"+ ]+ },+ "node_modules/sst-win32-arm64": {+ "version": "3.17.14",+ "resolved": "https://registry.npmjs.org/sst-win32-arm64/-/sst-win32-arm64-3.17.14.tgz",+ "integrity": "sha512-fueSfZqrGcPlhN0Lm5HpmDcCKr+JmMBBBjt38HlRU08ekY7lB05QAWNXgyBwXxLdXqVIFHCUaO2Mf4K+SMCv9A==",+ "cpu": [+ "arm64"+ ],+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/sst-win32-x64": {+ "version": "3.17.14",+ "resolved": "https://registry.npmjs.org/sst-win32-x64/-/sst-win32-x64-3.17.14.tgz",+ "integrity": "sha512-DO8U5Uno2iD1N+AgJPde4nTP8oIeBI/rTaW5yuxJSW8cMMzySi9vQ45wz9vyZDteoHzmSwtnoC8QhZMgs0gVnQ==",+ "cpu": [+ "x64"+ ],+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/sst-win32-x86": {+ "version": "3.17.14",+ "resolved": "https://registry.npmjs.org/sst-win32-x86/-/sst-win32-x86-3.17.14.tgz",+ "integrity": "sha512-Q+QKLERFU05wzYpcIhGX0XaLe+jsMuh95IQnrGDU8f82LM1KdWY+a62BaY1J4lbGpNrdZO22GXwIcqrFZOw8qA==",+ "cpu": [+ "x86"+ ],+ "optional": true,+ "os": [+ "win32"+ ]+ },+ "node_modules/sst/node_modules/jose": {+ "version": "5.2.3",+ "resolved": "https://registry.npmjs.org/jose/-/jose-5.2.3.tgz",+ "integrity": "sha512-KUXdbctm1uHVL8BYhnyHkgp3zDX5KW8ZhAKVFEfUbU2P8Alpzjb+48hHvjOdQIyPshoblhzsuqOwEEAbtHVirA==",+ "funding": {+ "url": "https://github.com/sponsors/panva"+ }+ },"node_modules/sswr": {"version": "2.1.0","resolved": "https://registry.npmjs.org/sswr/-/sswr-2.1.0.tgz",@@ -36057,6 +36666,26 @@"resolved": "https://registry.npmjs.org/xml-name-validator/-/xml-name-validator-3.0.0.tgz","integrity": "sha512-A5CUptxDsvxKJEU3yO6DuWBSJz/qizqzJKOMIfUJHETbBw/sFaDxgd6fxm1ewUaM0jZ444Fc5vC5ROYurg/4Pw=="},+ "node_modules/xml2js": {+ "version": "0.6.2",+ "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.6.2.tgz",+ "integrity": "sha512-T4rieHaC1EXcES0Kxxj4JWgaUQHDk+qwHcYOCFHfiwKz7tOVPLq7Hjq9dM1WCMhylqMEfP7hMcOIChvotiZegA==",+ "dependencies": {+ "sax": ">=0.6.0",+ "xmlbuilder": "~11.0.0"+ },+ "engines": {+ "node": ">=4.0.0"+ }+ },+ "node_modules/xmlbuilder": {+ "version": "11.0.1",+ "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz",+ "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==",+ "engines": {+ "node": ">=4.0"+ }+ },"node_modules/xmlchars": {"version": "2.2.0","resolved": "https://registry.npmjs.org/xmlchars/-/xmlchars-2.2.0.tgz",diff --git a/package.json b/package.jsonindex 30455c7b91..019c094820 100755--- a/package.json+++ b/package.json@@ -1,5 +1,6 @@{"devDependencies": {+ "@types/aws-lambda": "8.10.152","csv-parse": "^5.5.0","eslint": "^8.23.1","eslint-config-carbon": "*",@@ -26,8 +27,8 @@"private": true,"scripts": {"build": "turbo run build",- "build:packages": "turbo run build --filter=./packages/*","build:app": "turbo run build --filter=!www",+ "build:packages": "turbo run build --filter=./packages/*","ci:migrations": "npm run -w ci ci:migrations","clean": "turbo run clean && rimraf ./node_modules && rimraf ./package-lock.json","db:build": "run-s db:kill db:start setup",@@ -47,20 +48,20 @@"db:types": "npm run db:types -w @carbon/database","deploy": "turbo run deploy","dev": "run-p dev:erp dev:jobs dev:stripe",+ "dev:academy": "turbo run dev --filter=./apps/academy --filter=./packages/","dev:erp": "turbo run dev --filter=./apps/erp --filter=./packages/ ","dev:jobs": "npm run -w @carbon/jobs dev:jobs",- "dev:stripe": "npm run -w @carbon/stripe dev:stripe","dev:mes": "turbo run dev --filter=./apps/mes",- "dev:starter": "turbo run dev --filter=./apps/starter --filter=./packages/",- "dev:academy": "turbo run dev --filter=./apps/academy --filter=./packages/","dev:packages": "turbo run dev --filter=./packages/*",- "generate:types": "tsx scripts/generate-db-types.ts",- "generate:swagger": "tsx scripts/generate-swagger-docs.ts && npx prettier --write ./packages/database/src/swagger-docs-schema.ts ",+ "dev:starter": "turbo run dev --filter=./apps/starter --filter=./packages/",+ "dev:stripe": "npm run -w @carbon/stripe dev:stripe","format": "prettier --write \"**/*.{ts,tsx,md}\"",+ "generate:swagger": "tsx scripts/generate-swagger-docs.ts && npx prettier --write ./packages/database/src/swagger-docs-schema.ts ",+ "generate:types": "tsx scripts/generate-db-types.ts","lint": "turbo run lint","novu:sync": "npx novu@latest sync --bridge-url https://app.carbon.ms/api/novu --secret-key $NOVU_SECRET_KEY --api-url https://api.novu.co",- "predb:build": "tsx scripts/setup-env-files.ts","postdb:build": "run-s generate:types generate:swagger",+ "predb:build": "tsx scripts/setup-env-files.ts","prepare": "npx husky install","setup": "turbo run setup","test": "turbo run test",@@ -72,5 +73,8 @@"examples/*","packages/*"],- "packageManager": "[email protected]"+ "packageManager": "[email protected]",+ "dependencies": {+ "sst": "3.17.14"+ }}diff --git a/packages/auth/sst-env.d.ts b/packages/auth/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/auth/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/database/sst-env.d.ts b/packages/database/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/database/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/documents/sst-env.d.ts b/packages/documents/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/documents/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/ee/sst-env.d.ts b/packages/ee/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/ee/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/eslint-config-carbon/sst-env.d.ts b/packages/eslint-config-carbon/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/eslint-config-carbon/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/form/sst-env.d.ts b/packages/form/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/form/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/jest/sst-env.d.ts b/packages/jest/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/jest/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/jobs/sst-env.d.ts b/packages/jobs/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/jobs/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/kv/sst-env.d.ts b/packages/kv/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/kv/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/lib/sst-env.d.ts b/packages/lib/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/lib/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/logger/sst-env.d.ts b/packages/logger/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/logger/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/notifications/sst-env.d.ts b/packages/notifications/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/notifications/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/react/sst-env.d.ts b/packages/react/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/react/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/remix/sst-env.d.ts b/packages/remix/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/remix/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/stripe/sst-env.d.ts b/packages/stripe/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/stripe/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/tailwind/sst-env.d.ts b/packages/tailwind/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/tailwind/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/tsconfig/sst-env.d.ts b/packages/tsconfig/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/tsconfig/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/packages/utils/sst-env.d.ts b/packages/utils/sst-env.d.tsnew file mode 100644index 0000000000..cf5e5fbe51--- /dev/null+++ b/packages/utils/sst-env.d.ts@@ -0,0 +1,9 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++/// <reference path="../../sst-env.d.ts" />++import "sst";+export {};diff --git a/sst-env.d.ts b/sst-env.d.tsnew file mode 100644index 0000000000..3d633bac89--- /dev/null+++ b/sst-env.d.ts@@ -0,0 +1,30 @@+/* This file is auto-generated by SST. Do not edit. */+/* tslint:disable */+/* eslint-disable */+/* deno-fmt-ignore-file */++declare module "sst" {+ export interface Resource {+ "CarbonERPService": {+ "service": string+ "type": "sst.aws.Service"+ "url": string+ }+ "CarbonMESService": {+ "service": string+ "type": "sst.aws.Service"+ "url": string+ }+ "CarbonVpc2": {+ "type": "sst.aws.Vpc"+ }+ "ERPApi": {+ "type": "sst.aws.ApiGatewayV2"+ "url": string+ }+ }+}+/// <reference path="sst-env.d.ts" />++import "sst"+export {}\ No newline at end of filediff --git a/sst.config.ts b/sst.config.tsnew file mode 100644index 0000000000..4d6687a5ea--- /dev/null+++ b/sst.config.ts@@ -0,0 +1,180 @@+/// <reference path="./.sst/platform/config.d.ts" />++/**+ * ## AWS Load Balancer Web Application Firewall (WAF)+ *+ * Enable WAF for an AWS Load Balancer.+ *+ * The WAF is configured to enable a rate limit and enables AWS managed rules.+ *+ */+export default $config({+ app(input) {+ return {+ name: "carbon",+ home: "aws",+ region: "us-gov-east-1",+ removal: input?.stage === "production" ? "retain" : "remove",+ };+ },+ async run() {+ const vpc = new sst.aws.Vpc("CarbonVpc2");+ const cluster = new sst.aws.Cluster("CarbonCluster", {+ vpc,+ forceUpgrade: "v2",+ });+ const erp = cluster.addService("CarbonERPService", {+ image:+ "453096467244.dkr.ecr.us-gov-east-1.amazonaws.com/carbon/erp:latest",+ public: {+ ports: [{ listen: "80/http", forward: "3000/http" }],+ },+ environment: {+ AUTODESK_BUCKET_NAME: process.env.AUTODESK_BUCKET_NAME,+ AUTODESK_CLIENT_ID: process.env.AUTODESK_CLIENT_ID,+ AUTODESK_CLIENT_SECRET: process.env.AUTODESK_CLIENT_SECRET,+ CARBON_EDITION: process.env.CARBON_EDITION,+ CLOUDFLARE_TURNSTILE_SECRET_KEY:+ process.env.CLOUDFLARE_TURNSTILE_SECRET_KEY,+ CLOUDFLARE_TURNSTILE_SITE_KEY:+ process.env.CLOUDFLARE_TURNSTILE_SITE_KEY,+ CONTROLLED_ENVIRONMENT: process.env.CONTROLLED_ENVIRONMENT,+ DOMAIN: process.env.DOMAIN,+ EXCHANGE_RATES_API_KEY: process.env.EXCHANGE_RATES_API_KEY,+ NOVU_APPLICATION_ID: process.env.NOVU_APPLICATION_ID,+ NOVU_SECRET_KEY: process.env.NOVU_SECRET_KEY,+ OPENAI_API_KEY: process.env.OPENAI_API_KEY,+ POSTHOG_API_HOST: process.env.POSTHOG_API_HOST,+ POSTHOG_PROJECT_PUBLIC_KEY: process.env.POSTHOG_PROJECT_PUBLIC_KEY,+ RESEND_API_KEY: process.env.RESEND_API_KEY,+ SESSION_SECRET: process.env.SESSION_SECRET,+ SLACK_BOT_TOKEN: process.env.SLACK_BOT_TOKEN,+ SLACK_CLIENT_ID: process.env.SLACK_CLIENT_ID,+ SLACK_CLIENT_SECRET: process.env.SLACK_CLIENT_SECRET,+ SLACK_OAUTH_REDIRECT_URL: process.env.SLACK_OAUTH_REDIRECT_URL,+ SLACK_SIGNING_SECRET: process.env.SLACK_SIGNING_SECRET,+ SLACK_STATE_SECRET: process.env.SLACK_STATE_SECRET,+ STRIPE_BYPASS_COMPANY_IDS: process.env.STRIPE_BYPASS_COMPANY_IDS,+ STRIPE_SECRET_KEY: process.env.STRIPE_SECRET_KEY,+ STRIPE_WEBHOOK_SECRET: process.env.STRIPE_WEBHOOK_SECRET,+ SUPABASE_ANON_KEY: process.env.SUPABASE_ANON_KEY,+ SUPABASE_ANON_PUBLIC: process.env.SUPABASE_ANON_PUBLIC,+ SUPABASE_API_URL: process.env.SUPABASE_API_URL,+ SUPABASE_SERVICE_ROLE: process.env.SUPABASE_SERVICE_ROLE,+ SUPABASE_SERVICE_ROLE_KEY: process.env.SUPABASE_SERVICE_ROLE_KEY,+ SUPABASE_URL: process.env.SUPABASE_URL,+ TRIGGER_API_URL: process.env.TRIGGER_API_URL,+ TRIGGER_PROJECT_ID: process.env.TRIGGER_PROJECT_ID,+ TRIGGER_SECRET_KEY: process.env.TRIGGER_SECRET_KEY,+ UPSTASH_REDIS_REST_TOKEN: process.env.UPSTASH_REDIS_REST_TOKEN,+ UPSTASH_REDIS_REST_URL: process.env.UPSTASH_REDIS_REST_URL,+ VERCEL_ENV: process.env.VERCEL_ENV,+ VERCEL_URL: process.env.VERCEL_URL,+ },+ });++ const mes = cluster.addService("CarbonMESService", {+ image:+ "453096467244.dkr.ecr.us-gov-east-1.amazonaws.com/carbon/mes:latest",+ public: {+ ports: [{ listen: "80/http", forward: "3001/http" }],+ },+ environment: {+ AUTODESK_BUCKET_NAME: process.env.AUTODESK_BUCKET_NAME,+ AUTODESK_CLIENT_ID: process.env.AUTODESK_CLIENT_ID,+ AUTODESK_CLIENT_SECRET: process.env.AUTODESK_CLIENT_SECRET,+ CARBON_EDITION: process.env.CARBON_EDITION,+ CLOUDFLARE_TURNSTILE_SECRET_KEY:+ process.env.CLOUDFLARE_TURNSTILE_SECRET_KEY,+ CLOUDFLARE_TURNSTILE_SITE_KEY:+ process.env.CLOUDFLARE_TURNSTILE_SITE_KEY,+ CONTROLLED_ENVIRONMENT: process.env.CONTROLLED_ENVIRONMENT,+ DOMAIN: process.env.DOMAIN,+ EXCHANGE_RATES_API_KEY: process.env.EXCHANGE_RATES_API_KEY,+ NOVU_APPLICATION_ID: process.env.NOVU_APPLICATION_ID,+ NOVU_SECRET_KEY: process.env.NOVU_SECRET_KEY,+ OPENAI_API_KEY: process.env.OPENAI_API_KEY,+ POSTHOG_API_HOST: process.env.POSTHOG_API_HOST,+ POSTHOG_PROJECT_PUBLIC_KEY: process.env.POSTHOG_PROJECT_PUBLIC_KEY,+ RESEND_API_KEY: process.env.RESEND_API_KEY,+ SESSION_SECRET: process.env.SESSION_SECRET,+ SLACK_BOT_TOKEN: process.env.SLACK_BOT_TOKEN,+ SLACK_CLIENT_ID: process.env.SLACK_CLIENT_ID,+ SLACK_CLIENT_SECRET: process.env.SLACK_CLIENT_SECRET,+ SLACK_OAUTH_REDIRECT_URL: process.env.SLACK_OAUTH_REDIRECT_URL,+ SLACK_SIGNING_SECRET: process.env.SLACK_SIGNING_SECRET,+ SLACK_STATE_SECRET: process.env.SLACK_STATE_SECRET,+ STRIPE_BYPASS_COMPANY_IDS: process.env.STRIPE_BYPASS_COMPANY_IDS,+ STRIPE_SECRET_KEY: process.env.STRIPE_SECRET_KEY,+ STRIPE_WEBHOOK_SECRET: process.env.STRIPE_WEBHOOK_SECRET,+ SUPABASE_ANON_KEY: process.env.SUPABASE_ANON_KEY,+ SUPABASE_ANON_PUBLIC: process.env.SUPABASE_ANON_PUBLIC,+ SUPABASE_API_URL: process.env.SUPABASE_API_URL,+ SUPABASE_SERVICE_ROLE: process.env.SUPABASE_SERVICE_ROLE,+ SUPABASE_SERVICE_ROLE_KEY: process.env.SUPABASE_SERVICE_ROLE_KEY,+ SUPABASE_URL: process.env.SUPABASE_URL,+ TRIGGER_API_URL: process.env.TRIGGER_API_URL,+ TRIGGER_PROJECT_ID: process.env.TRIGGER_PROJECT_ID,+ TRIGGER_SECRET_KEY: process.env.TRIGGER_SECRET_KEY,+ UPSTASH_REDIS_REST_TOKEN: process.env.UPSTASH_REDIS_REST_TOKEN,+ UPSTASH_REDIS_REST_URL: process.env.UPSTASH_REDIS_REST_URL,+ VERCEL_ENV: process.env.VERCEL_ENV,+ VERCEL_URL: process.env.VERCEL_URL,+ },+ });++ const rateLimitRule = {+ name: "RateLimitRule",+ statement: {+ rateBasedStatement: {+ limit: 200,+ aggregateKeyType: "IP",+ },+ },+ priority: 1,+ action: { block: {} },+ visibilityConfig: {+ cloudwatchMetricsEnabled: true,+ sampledRequestsEnabled: true,+ metricName: "CarbonRateLimitRule",+ },+ };++ const awsManagedRules = {+ name: "AWSManagedRules",+ statement: {+ managedRuleGroupStatement: {+ name: "AWSManagedRulesCommonRuleSet",+ vendorName: "AWS",+ },+ },+ priority: 2,+ overrideAction: {+ none: {},+ },+ visibilityConfig: {+ cloudwatchMetricsEnabled: true,+ sampledRequestsEnabled: true,+ metricName: "MyAppAWSManagedRules",+ },+ };++ // WAF configuration kept for manual association with load balancer+ // To use: Associate this WAF ACL with your manually created load balancer in AWS Console+ new aws.wafv2.WebAcl("AppAlbWebAcl", {+ defaultAction: { allow: {} },+ scope: "REGIONAL",+ visibilityConfig: {+ cloudwatchMetricsEnabled: true,+ sampledRequestsEnabled: true,+ metricName: "AppAlbWebAcl",+ },+ rules: [rateLimitRule, awsManagedRules],+ });++ return {+ erpUrl: erp.url,+ mesUrl: mes.url,+ };+ },+});diff --git a/tsconfig.json b/tsconfig.jsonnew file mode 100644index 0000000000..0967ef424b--- /dev/null+++ b/tsconfig.json@@ -0,0 +1 @@+{}