Showing 1,065 changed files with 25,089 additions and 37,005 deletions.
17 changes: 13 additions & 4 deletions .cspell.json
Expand Up @@ -3,6 +3,7 @@
"version": "0.2",
"language": "en",
"words": [
"Springboot",
"tmproj",
"hgignore",
"bzrignore",
Expand Down Expand Up @@ -498,8 +499,18 @@
"reactjs",
"nextjs",
"vanillajs",
"quckstart",
"errmsg"
"errmsg",
"springboot",
"errmsg",
"shelljs",
"prefiltering",
"virtuals",
"autodocs",
"stackalt",
"mediumdark",
"Docgen",
"clicksend",
"Clicksend"
],
"flagWords": [],
"patterns": [
Expand Down Expand Up @@ -578,8 +589,6 @@
".eslintrc.js",
".vscode/settings.json",
"*/**/.vscode/settings.json",
"docs/src/usage-examples.md",
"docs/static/csv/mock_data.csv",
"apps/worker/README.md",
".gitignore",
"angular.json",
Expand Down
28 changes: 28 additions & 0 deletions .github/actions/checkout-submodules/action.yml
@@ -0,0 +1,28 @@
name: Checkout Submodules

description: Checkout private enterprise submodule

inputs:
enabled:
description: 'Run the action'
required: false
default: 'true'
submodule_token:
description: 'Submodule token to use for checkout'
required: true
submodule_branch:
description: 'Submodule branch to checkout to'
required: true

runs:
using: composite

steps:
- name: Checkout submodule
if: ${{ inputs.enabled == 'true' }}
uses: actions/checkout@v3
with:
token: ${{ inputs.submodule_token }}
repository: novuhq/packages-enterprise
path: enterprise/packages
ref: ${{ inputs.submodule_branch }}
2 changes: 1 addition & 1 deletion .github/actions/docker/build-api/action.yml
Expand Up @@ -103,7 +103,7 @@ runs:
docker run --network=host --name api -dit --env NODE_ENV=test ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://localhost:1337/v1/health-check | grep 'ok'
echo "::set-output name=IMAGE::ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
echo "IMAGE=ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Optionally tag docker image
if: ${{ inputs.tag }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/docker/build-worker/action.yml
Expand Up @@ -106,7 +106,7 @@ runs:
docker run --network=host --name worker -dit --env NODE_ENV=test ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
docker run --network=host appropriate/curl --retry 10 --retry-delay 5 --retry-connrefused http://localhost:1342/v1/health-check | grep 'ok'
echo "::set-output name=IMAGE::ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
echo "IMAGE=ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Optionally tag docker image
if: ${{ inputs.tag }}
Expand Down
1 change: 0 additions & 1 deletion .github/actions/run-api/action.yml
Expand Up @@ -19,7 +19,6 @@ runs:
- name: Start API
shell: bash
env:
IS_IN_MEMORY_CLUSTER_MODE_ENABLED: true
LAUNCH_DARKLY_SDK_KEY: ${{ inputs.launch_darkly_sdk_key }}
run: cd apps/api && pnpm start:test &

Expand Down
2 changes: 0 additions & 2 deletions .github/actions/run-backend/action.yml
Expand Up @@ -28,7 +28,6 @@ runs:
TZ: "UTC"
GITHUB_OAUTH_REDIRECT: "http://localhost:1336/v1/auth/github/callback"
LAUNCH_DARKLY_SDK_KEY: ${{ inputs.launch_darkly_sdk_key }}
IN_MEMORY_CLUSTER_MODE_ENABLED: true
run: cd apps/api && pnpm start:build &

- name: Start Worker
Expand All @@ -38,7 +37,6 @@ runs:
PORT: "1342"
TZ: "UTC"
LAUNCH_DARKLY_SDK_KEY: ${{ inputs.launch_darkly_sdk_key }}
IN_MEMORY_CLUSTER_MODE_ENABLED: true
run: cd apps/worker && pnpm start:prod &

- name: Wait on API and Worker
Expand Down
1 change: 0 additions & 1 deletion .github/actions/run-worker/action.yml
Expand Up @@ -20,7 +20,6 @@ runs:
- name: Start worker
shell: bash
env:
IN_MEMORY_CLUSTER_MODE_ENABLED: true
LAUNCH_DARKLY_SDK_KEY: ${{ inputs.launch_darkly_sdk_key }}
run: cd apps/worker && pnpm start:test &

Expand Down
2 changes: 0 additions & 2 deletions .github/labeler.yml
Expand Up @@ -8,8 +8,6 @@
- apps/ws/**/*
'@novu/inbound-mail':
- apps/inbound-mail/**/*
'documentation':
- docs/**/*
'@novu/webhook':
- apps/webhook/**/*
'@novu/dal':
Expand Down
42 changes: 39 additions & 3 deletions .github/workflows/dev-deploy-api.yml
Expand Up @@ -26,8 +26,47 @@ jobs:
with:
ee: ${{ contains (matrix.name,'ee') }}
submodules: ${{ contains (matrix.name,'ee') }}
submodule_branch: "next"
secrets: inherit

test_e2e_ee:
name: Test E2E EE
runs-on: ubuntu-latest
timeout-minutes: 80
permissions:
contents: read
packages: write
deployments: write
id-token: write
steps:
- run: echo ${{ matrix.projectName }}
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-project
- uses: ./.github/actions/setup-redis-cluster
- uses: mansagroup/nrwl-nx-action@v3
name: Lint and build
with:
targets: lint,build
projects: ${{matrix.projectName}}

- uses: ./.github/actions/start-localstack

- uses: ./.github/actions/run-worker
if: ${{matrix.projectName == '@novu/api' }}
with:
launch_darkly_sdk_key: ${{ secrets.LAUNCH_DARKLY_SDK_KEY }}

- uses: mansagroup/nrwl-nx-action@v3
name: Running the E2E tests
env:
LAUNCH_DARKLY_SDK_KEY: ${{ secrets.LAUNCH_DARKLY_SDK_KEY }}
GOOGLE_OAUTH_CLIENT_ID: ${{ secrets.GOOGLE_OAUTH_CLIENT_ID }}
GOOGLE_OAUTH_CLIENT_SECRET: ${{ secrets.GOOGLE_OAUTH_CLIENT_SECRET }}
CI_EE_TEST: true
with:
targets: test:e2e:ee
projects: ${{matrix.projectName}}

deploy_dev_api:
if: "!contains(github.event.head_commit.message, 'ci skip')"
# The type of runner that the job will run on
Expand All @@ -45,9 +84,6 @@ jobs:
name: ['novu/api-ee', 'novu/api']
steps:
- uses: actions/checkout@v3
with:
submodules: ${{ contains (matrix.name,'ee') }}
token: ${{ secrets.SUBMODULES_TOKEN }}
- uses: ./.github/actions/setup-project
- uses: ./.github/actions/docker/build-api
id: docker_build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-deploy-embed.yml
Expand Up @@ -67,4 +67,4 @@ jobs:
docker tag ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:dev
docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:dev
docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
echo "::set-output name=IMAGE::ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
echo "IMAGE=ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG" >> $GITHUB_OUTPUT
24 changes: 16 additions & 8 deletions .github/workflows/dev-deploy-inbound-mail.yml
Expand Up @@ -12,31 +12,40 @@ on:
- 'package.json'
- 'pnpm-lock.yaml'
- 'apps/inbound-mail/**'
- 'libs/dal/**'
- 'libs/shared/**'
- 'libs/testing/**'
env:
TF_WORKSPACE: novu-dev

jobs:
deploy_dev_inbound_mail:
if: "!contains(github.event.head_commit.message, 'ci skip')"
test_inbound_mail:
strategy:
matrix:
name: ['novu/inbound-mail-ee', 'novu/inbound-mail']
uses: ./.github/workflows/reusable-inbound-mail-e2e.yml
with:
ee: ${{ contains (matrix.name,'ee') }}
submodules: ${{ contains (matrix.name,'ee') }}
submodule_branch: "next"
secrets: inherit

dev_deploy_inbound_mail:
# The type of runner that the job will run on
runs-on: ubuntu-latest
needs: test_inbound_mail
timeout-minutes: 80
environment: Development
permissions:
contents: read
packages: write
deployments: write
id-token: write
if: "!contains(github.event.head_commit.message, 'ci skip')"
strategy:
matrix:
# Only should be deploying inbound-mail-ee to dev
#name: ['novu/inbound-mail', 'novu/inbound-mail-ee']
name: ['novu/inbound-mail-ee']

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3
- uses: ./.github/actions/setup-project

Expand All @@ -45,7 +54,6 @@ jobs:
with:
oidc: true


- name: Set Bull MQ Env variable for EE
shell: bash
run: |
Expand All @@ -71,7 +79,7 @@ jobs:
docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:dev
docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
echo "::set-output name=IMAGE::ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
echo "IMAGE=ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Checkout cloud infra
uses: actions/checkout@master
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dev-deploy-web.yml
Expand Up @@ -20,6 +20,7 @@ jobs:
uses: ./.github/workflows/reusable-web-e2e.yml
with:
submodules: true
submodule_branch: 'next'
secrets: inherit

# This workflow contains a single job called "build"
Expand Down Expand Up @@ -120,7 +121,7 @@ jobs:
-t ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG \
-t ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:dev \
-f apps/web/Dockerfile .
echo "::set-output name=IMAGE::ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
echo "IMAGE=ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
if: failure()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/dev-deploy-webhook.yml
Expand Up @@ -55,7 +55,7 @@ jobs:
docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:dev
docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
echo "::set-output name=IMAGE::ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
echo "IMAGE=ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Checkout cloud infra
uses: actions/checkout@master
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dev-deploy-widget.yml
Expand Up @@ -21,6 +21,7 @@ jobs:
uses: ./.github/workflows/reusable-widget-e2e.yml
with:
submodules: true
submodule_branch: "next"
secrets: inherit

# This workflow contains a single job called "build"
Expand Down Expand Up @@ -93,7 +94,7 @@ jobs:
docker tag ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:dev
docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:dev
docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
echo "::set-output name=IMAGE::ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
echo "IMAGE=ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG" >> $GITHUB_OUTPUT
- uses: actions/upload-artifact@v3
if: failure()
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/dev-deploy-worker.yml
Expand Up @@ -30,6 +30,7 @@ jobs:
with:
ee: ${{ contains (matrix.name,'ee') }}
submodules: ${{ contains (matrix.name,'ee') }}
submodule_branch: "next"
secrets: inherit

deploy_dev_worker:
Expand All @@ -49,9 +50,6 @@ jobs:
name: ['novu/worker-ee', 'novu/worker']
steps:
- uses: actions/checkout@v3
with:
submodules: ${{ contains (matrix.name,'ee') }}
token: ${{ secrets.SUBMODULES_TOKEN }}
- uses: ./.github/actions/setup-project
- uses: ./.github/actions/docker/build-worker
id: docker_build
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/dev-deploy-ws.yml
Expand Up @@ -22,6 +22,7 @@ jobs:
with:
ee: ${{ contains (matrix.name,'ee') }}
submodules: ${{ contains (matrix.name,'ee') }}
submodule_branch: 'next'
secrets: inherit

# This workflow contains a single job called "build"
Expand Down Expand Up @@ -102,7 +103,7 @@ jobs:
docker tag ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:dev
docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:dev
docker push ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG
echo "::set-output name=IMAGE::ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG"
echo "IMAGE=ghcr.io/$REGISTRY_OWNER/$DOCKER_NAME:$IMAGE_TAG" >> $GITHUB_OUTPUT
- name: Render Amazon ECS task definition
id: render-container
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/jarvis.yml
Expand Up @@ -18,7 +18,7 @@ jobs:
body="${body//'%'/'%25'}"
body="${body//$'\n'/'%0A'}"
body="${body//$'\r'/'%0D'}"
echo "::set-output name=body::$body"
echo "body=$body" >> $GITHUB_OUTPUT
- name: Add comment
uses: peter-evans/create-or-update-comment@v2
with:
Expand Down