Skip to content

Commit

Permalink
chore(root): Release 2024-11-20 12:53 (#7084)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Nov 20, 2024
2 parents 7a8a75b + 2d4eb45 commit 38957ed
Show file tree
Hide file tree
Showing 104 changed files with 2,232 additions and 2,683 deletions.
69 changes: 35 additions & 34 deletions .cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,7 @@
"xkeysib",
"xyflow",
"zulip",
"zwnj",
"zwnj"
],
"flagWords": [],
"patterns": [
Expand Down Expand Up @@ -762,47 +762,48 @@
"projectIds"
],
"ignorePaths": [
"apps/api/src/app/workflows-v2/maily-test-data.ts",
"apps/api/src/.env.test",
"apps/ws/src/.env.test",
"apps/ws/src/.example.env",
"apps/web/playwright.config.ts",
".cspell.json",
"package.json",
"package-lock.json",
"tsconfig.json",
"node_modules/**",
"pnpm-lock.yaml",
"pnpm-workspace.yaml",
"novu.code-workspace",
"libs/application-generic/src/.env.test",
"packages/notification-center/src/i18n/languages/**",
"packages/notification-center/rollup.config.mjs",
"packages/js/tsup.config.ts",
"apps/widget/public/iframeResizer.contentWindow.js",
".vscode/settings.json",
"*/**/.vscode/settings.json",
"apps/worker/README.md",
".gitignore",
"angular.json",
"ng-package.json",
"packages/shared/src/types/timezones/timezones.types.ts",
"*.riv",
"websockets",
"apps/api/src/app/workflows-v2/usecases/validate-content/validate-placeholders/validate-placeholder.usecase.ts",
".env",
".env.development",
".env.local",
".env.production",
".env.test",
".env",
".example.env",
".gitignore",
".vscode/settings.json",
"*.riv",
"*/**/.vscode/settings.json",
"*/**/CHANGELOG.md",
"angular.json",
"apps/api/src/.env.test",
"apps/api/src/app/analytics/usecases/hubspot-identify-form/hubspot-identify-form.usecase.ts",
"apps/api/src/app/workflows-v2/maily-test-data.ts",
"apps/api/src/app/workflows-v2/usecases/validate-content/validate-placeholders/validate-placeholder.usecase.ts",
"apps/dashboard/eslint.config.js",
"apps/web/env.sh",
"apps/web/playwright.config.ts",
"apps/web/src/pages/playground/web-container-configuration/sandbox-vite/*.ts",
"apps/web/src/studio/components/workflows/step-editor/editor/files.ts",
"apps/widget/public/iframeResizer.contentWindow.js",
"apps/worker/README.md",
"apps/ws/src/.env.test",
"apps/ws/src/.example.env",
"libs/application-generic/src/.env.test",
"ng-package.json",
"node_modules/**",
"novu.code-workspace",
"package-lock.json",
"package.json",
"packages/framework/src/jsonSchemaFaker.js",
"packages/js/src/ui/index.directcss",
"packages/js/tsup.config.ts",
"packages/notification-center/rollup.config.mjs",
"packages/notification-center/src/i18n/languages/**",
"packages/shared/src/types/timezones/timezones.types.ts",
"pnpm-lock.yaml",
"pnpm-workspace.yaml",
"tsconfig.json",
"unreadRead",
"apps/web/src/studio/components/workflows/step-editor/editor/files.ts",
"apps/web/src/pages/playground/web-container-configuration/sandbox-vite/*.ts",
"apps/api/src/app/analytics/usecases/hubspot-identify-form/hubspot-identify-form.usecase.ts",
"apps/dashboard/eslint.config.js",
"packages/framework/src/jsonSchemaFaker.js"
"websockets"
]
}
6 changes: 2 additions & 4 deletions apps/api/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@novu/api",
"version": "2.0.1",
"version": "2.0.3",
"description": "description",
"author": "",
"private": "true",
Expand Down Expand Up @@ -99,8 +99,7 @@
"twilio": "^4.14.1",
"uuid": "^8.3.2",
"zod": "^3.23.8",
"zod-to-json-schema": "^3.23.3",
"json-schema-to-ts": "^3.0.0"
"zod-to-json-schema": "^3.23.3"
},
"devDependencies": {
"@faker-js/faker": "^6.0.0",
Expand All @@ -127,7 +126,6 @@
"tsconfig-paths": "~4.1.0",
"typescript": "5.6.2"
},

"optionalDependencies": {
"@novu/ee-auth": "workspace:*",
"@novu/ee-billing": "workspace:*",
Expand Down
6 changes: 0 additions & 6 deletions apps/api/src/app/events/e2e/delay-events.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -84,14 +84,8 @@ describe('Trigger event - Delay triggered events - /v1/events/trigger (POST)', f

expect(delayedJob!.status).to.equal(JobStatusEnum.DELAYED);

const expireAt = new Date(delayedJob?.expireAt as string);
const createdAt = new Date(delayedJob?.createdAt as string);

const subExpire30Days = subDays(expireAt, 30);
const diff = differenceInMilliseconds(subExpire30Days, createdAt);

expect(diff).to.approximately(200, 2000);

const messages = await messageRepository.find({
_environmentId: session.environment._id,
_subscriberId: subscriber._id,
Expand Down
14 changes: 0 additions & 14 deletions apps/api/src/app/events/e2e/trigger-event.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,6 @@ import {
ActorTypeEnum,
ChannelTypeEnum,
ChatProviderIdEnum,
DEFAULT_MESSAGE_GENERIC_RETENTION_DAYS,
DEFAULT_MESSAGE_IN_APP_RETENTION_DAYS,
DelayTypeEnum,
DigestUnitEnum,
EmailBlockTypeEnum,
Expand Down Expand Up @@ -1444,14 +1442,8 @@ describe(`Trigger event - ${eventTriggerPath} (POST)`, function () {
expect(messages.length).to.equal(1);
const message = messages[0];

let expireAt = new Date(message?.expireAt as string);
let createdAt = new Date(message?.createdAt as string);

const subExpireYear = subDays(expireAt, DEFAULT_MESSAGE_IN_APP_RETENTION_DAYS);
let diff = differenceInMilliseconds(subExpireYear, createdAt);

expect(diff).to.approximately(0, 100);

const emails = await messageRepository.findBySubscriberChannel(
session.environment._id,
subscriber._id,
Expand All @@ -1461,13 +1453,7 @@ describe(`Trigger event - ${eventTriggerPath} (POST)`, function () {
expect(emails.length).to.equal(1);
const email = emails[0];

expireAt = new Date(email?.expireAt as string);
createdAt = new Date(email?.createdAt as string);

const subExpireMonth = subDays(expireAt, DEFAULT_MESSAGE_GENERIC_RETENTION_DAYS);
diff = differenceInMilliseconds(subExpireMonth, createdAt);

expect(diff).to.approximately(0, 100);
});

it('should trigger SMS notification', async function () {
Expand Down
3 changes: 0 additions & 3 deletions apps/api/src/app/widgets/dtos/feeds-response.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,6 @@ export class NotificationDto implements INotificationDto {
@ApiPropertyOptional()
updatedAt: string;

@ApiPropertyOptional()
expireAt: string;

@ApiPropertyOptional({
type: Actor,
})
Expand Down
8 changes: 1 addition & 7 deletions apps/api/src/app/workflows-v2/generate-preview.e2e.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,13 +546,7 @@ function buildInAppControlValuesMissingUrlsAndData() {
target: RedirectTargetEnum.BLANK,
},
},
secondaryAction: {
label: 'Secondary Action',
redirect: {
target: RedirectTargetEnum.BLANK,
url: '',
},
},
secondaryAction: null,
redirect: {
target: RedirectTargetEnum.BLANK,
url: ' ',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,24 +7,28 @@ const redirectZodSchema = z
url: z.string().optional(),
target: z.enum(['_self', '_blank', '_parent', '_top', '_unfencedTop']).default('_blank'),
})
.strict();
.strict()
.optional()
.nullable();

const actionZodSchema = z
.object({
label: z.string().optional(),
redirect: redirectZodSchema.optional(),
})
.strict();
.strict()
.optional()
.nullable();

export const InAppControlZodSchema = z
.object({
subject: z.string().optional(),
body: z.string(),
avatar: z.string().optional(),
primaryAction: actionZodSchema.optional(),
secondaryAction: actionZodSchema.optional(),
primaryAction: actionZodSchema,
secondaryAction: actionZodSchema,
data: z.object({}).catchall(z.unknown()).optional(),
redirect: redirectZodSchema.optional(),
redirect: redirectZodSchema,
})
.strict();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,9 @@ export class PrepareAndValidateContentUsecase {
const filteredValues: Record<string, unknown> = {};

for (const [key, value] of Object.entries(controlValues)) {
if (value === null) {
continue;
}
if (typeof value !== 'string') {
filteredValues[key] = value;
continue;
Expand Down
10 changes: 1 addition & 9 deletions apps/api/src/config/env.validators.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
import { bool, CleanedEnv, cleanEnv, json, num, port, str, url, ValidatorSpec } from 'envalid';
import {
DEFAULT_MESSAGE_GENERIC_RETENTION_DAYS,
DEFAULT_MESSAGE_IN_APP_RETENTION_DAYS,
DEFAULT_NOTIFICATION_RETENTION_DAYS,
FeatureFlagsKeysEnum,
StringifyEnv,
} from '@novu/shared';
import { DEFAULT_NOTIFICATION_RETENTION_DAYS, FeatureFlagsKeysEnum, StringifyEnv } from '@novu/shared';

export function validateEnv() {
return cleanEnv(process.env, envValidators);
Expand Down Expand Up @@ -44,8 +38,6 @@ export const envValidators = {
WORKER_DEFAULT_LOCK_DURATION: num({ default: undefined }),
ENABLE_OTEL: bool({ default: false }),
NOTIFICATION_RETENTION_DAYS: num({ default: DEFAULT_NOTIFICATION_RETENTION_DAYS }),
MESSAGE_GENERIC_RETENTION_DAYS: num({ default: DEFAULT_MESSAGE_GENERIC_RETENTION_DAYS }),
MESSAGE_IN_APP_RETENTION_DAYS: num({ default: DEFAULT_MESSAGE_IN_APP_RETENTION_DAYS }),
LEGACY_STAGING_DASHBOARD_URL: url({ default: undefined }),
API_ROOT_URL: url(),
NOVU_INVITE_TEAM_MEMBER_NUDGE_TRIGGER_IDENTIFIER: str({ default: undefined }),
Expand Down
1 change: 1 addition & 0 deletions apps/dashboard/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ VITE_SENTRY_DSN=
VITE_LAUNCH_DARKLY_CLIENT_SIDE_ID=
VITE_HUBSPOT_EMBED=
VITE_API_HOSTNAME=http://localhost:3000
VITE_WEBSOCKET_HOSTNAME=http://localhost:3002
VITE_CLERK_PUBLISHABLE_KEY=
VITE_NOVU_APP_ID=
VITE_INTERCOM_APP_ID=
Expand Down
2 changes: 1 addition & 1 deletion apps/dashboard/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@novu/dashboard",
"private": true,
"version": "0.0.0",
"version": "0.0.1",
"type": "module",
"scripts": {
"start": "vite",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
import { useBootIntercom } from '@/hooks/use-boot-intercom';
import { RiCustomerService2Line } from 'react-icons/ri';
import { HeaderButton } from './header-button';

export const CustomerSupportButton = () => {
useBootIntercom();

return (
<button id="intercom-launcher">
<RiCustomerService2Line className="size-5 cursor-pointer" />
<button id="intercom-launcher" tabIndex={-1} className="flex items-center justify-center">
<HeaderButton label="Help">
<RiCustomerService2Line className="text-foreground-600 size-4" />
</HeaderButton>
</button>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const EditBridgeUrlButton = () => {
handleSubmit,
reset,
setError,
formState: { isDirty, errors },
formState: { isDirty },
} = form;
const { currentEnvironment, setBridgeUrl } = useEnvironment();
const { status, bridgeURL: envBridgeUrl } = useBridgeHealthCheck();
Expand Down Expand Up @@ -86,7 +86,7 @@ export const EditBridgeUrlButton = () => {
<FormItem>
<FormLabel>Bridge Endpoint URL</FormLabel>
<FormControl>
<InputField state={errors.bridgeUrl?.message ? 'error' : 'default'}>
<InputField>
<RiLinkM className="size-5 min-w-5" />
<Input id="bridgeUrl" {...field} />
</InputField>
Expand Down
30 changes: 30 additions & 0 deletions apps/dashboard/src/components/header-navigation/header-button.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { ReactNode } from 'react';
import { Tooltip, TooltipContent, TooltipTrigger } from '../primitives/tooltip';

export const HeaderButton = ({
children,
label,
disableTooltip = false,
}: {
children: ReactNode;
label: ReactNode;
disableTooltip?: boolean;
}) => {
return (
<Tooltip>
<TooltipTrigger asChild>
<div
tabIndex={0}
className="hover:bg-foreground-100 flex h-6 w-6 cursor-pointer items-center justify-center rounded-2xl transition-[background-color,box-shadow] duration-200 ease-in-out focus:outline-none focus:ring-4 focus:ring-neutral-200"
>
{children}
</div>
</TooltipTrigger>
{!disableTooltip && (
<TooltipContent>
<p>{label}</p>
</TooltipContent>
)}
</Tooltip>
);
};
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,16 @@ export const HeaderNavigation = (props: HeaderNavigationProps) => {
{...rest}
>
{startItems}
<div className="text-foreground-600 ml-auto flex items-center gap-3">
{!hideBridgeUrl ? <EditBridgeUrlButton /> : null}
<div className="text-foreground-600 ml-auto flex items-center gap-2">
{!hideBridgeUrl ? (
<div className="pr-1">
<EditBridgeUrlButton />
</div>
) : null}
<CustomerSupportButton />
<InboxButton />
<div className="flex pr-0.5">
<InboxButton />
</div>
<UserProfile />
</div>
</div>
Expand Down
23 changes: 23 additions & 0 deletions apps/dashboard/src/components/icons/inbox-bell-filled.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import type { HTMLAttributes } from 'react';

type InboxBellFilledProps = {
bellClassName?: string;
ringerClassName?: string;
};

export function InboxBellFilled(props: HTMLAttributes<HTMLOrSVGElement> & InboxBellFilledProps) {
return (
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="none" viewBox="0 0 9 12" {...props}>
<path
className={props.bellClassName}
fill="currentColor"
d="M4.5.856a.642.642 0 0 0-.643.643v.386a3.216 3.216 0 0 0-2.572 3.15v.377c0 .945-.347 1.857-.974 2.564l-.149.167a.642.642 0 0 0 .48 1.07h7.715a.644.644 0 0 0 .48-1.07l-.149-.167a3.863 3.863 0 0 1-.974-2.564v-.377a3.216 3.216 0 0 0-2.572-3.15v-.386A.642.642 0 0 0 4.5.856Z"
></path>
<path
className={props.ringerClassName}
fill="currentColor"
d="M5.41 10.766c.24-.24.375-.568.375-.91H3.214a1.286 1.286 0 0 0 2.196.91Z"
></path>
</svg>
);
}
Loading

0 comments on commit 38957ed

Please sign in to comment.