mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-20 06:31:13 -05:00
Fix Novu API import error
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { serve } from "https://deno.land/std@0.168.0/http/server.ts";
|
||||
import { Novu } from "npm:@novu/api@0.0.7";
|
||||
import { Novu } from "npm:@novu/api@1.6.0";
|
||||
|
||||
// TODO: In production, restrict CORS to specific domains
|
||||
// For now, allowing all origins for development flexibility
|
||||
@@ -22,8 +22,7 @@ serve(async (req) => {
|
||||
}
|
||||
|
||||
const novu = new Novu({
|
||||
apiKey: novuApiKey,
|
||||
baseURL: Deno.env.get('VITE_NOVU_API_URL') || 'https://api.novu.co',
|
||||
secretKey: novuApiKey
|
||||
});
|
||||
|
||||
// Parse and validate request body
|
||||
|
||||
2
supabase/functions/deno.d.ts
vendored
2
supabase/functions/deno.d.ts
vendored
@@ -20,7 +20,7 @@ declare module 'https://esm.sh/@supabase/supabase-js@2.57.4' {
|
||||
export * from '@supabase/supabase-js';
|
||||
}
|
||||
|
||||
declare module 'npm:@novu/api@0.0.7' {
|
||||
declare module 'npm:@novu/api@1.6.0' {
|
||||
export * from '@novu/api';
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { serve } from "https://deno.land/std@0.168.0/http/server.ts";
|
||||
import { createClient } from "https://esm.sh/@supabase/supabase-js@2.57.4";
|
||||
import { Novu } from "npm:@novu/api@0.0.7";
|
||||
import { Novu } from "npm:@novu/api@1.6.0";
|
||||
|
||||
const corsHeaders = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
@@ -25,8 +25,7 @@ serve(async (req) => {
|
||||
const supabase = createClient(supabaseUrl, supabaseServiceKey);
|
||||
|
||||
const novu = new Novu({
|
||||
apiKey: novuApiKey,
|
||||
baseURL: Deno.env.get('VITE_NOVU_API_URL') || 'https://api.novu.co',
|
||||
secretKey: novuApiKey
|
||||
});
|
||||
|
||||
// Fetch users who don't have Novu subscriber IDs
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { serve } from "https://deno.land/std@0.168.0/http/server.ts";
|
||||
import { Novu } from "npm:@novu/api@0.0.7";
|
||||
import { Novu } from "npm:@novu/api@1.6.0";
|
||||
|
||||
const corsHeaders = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
@@ -19,16 +19,18 @@ serve(async (req) => {
|
||||
}
|
||||
|
||||
const novu = new Novu({
|
||||
apiKey: novuApiKey,
|
||||
baseURL: Deno.env.get('VITE_NOVU_API_URL') || 'https://api.novu.co',
|
||||
secretKey: novuApiKey
|
||||
});
|
||||
|
||||
const { workflowId, subscriberId, payload, overrides } = await req.json();
|
||||
|
||||
console.log('Triggering notification:', { workflowId, subscriberId });
|
||||
|
||||
const result = await novu.events.trigger(workflowId, {
|
||||
to: subscriberId,
|
||||
const result = await novu.trigger({
|
||||
to: {
|
||||
subscriberId,
|
||||
},
|
||||
workflowId,
|
||||
payload,
|
||||
overrides,
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { serve } from "https://deno.land/std@0.168.0/http/server.ts";
|
||||
import { Novu } from "npm:@novu/api@0.0.7";
|
||||
import { Novu } from "npm:@novu/api@1.6.0";
|
||||
import { createClient } from "https://esm.sh/@supabase/supabase-js@2.57.4";
|
||||
|
||||
const corsHeaders = {
|
||||
@@ -22,8 +22,7 @@ serve(async (req) => {
|
||||
}
|
||||
|
||||
const novu = new Novu({
|
||||
apiKey: novuApiKey,
|
||||
baseURL: Deno.env.get('VITE_NOVU_API_URL') || 'https://api.novu.co',
|
||||
secretKey: novuApiKey
|
||||
});
|
||||
|
||||
const supabase = createClient(supabaseUrl, supabaseServiceKey);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { serve } from "https://deno.land/std@0.168.0/http/server.ts";
|
||||
import { Novu } from "npm:@novu/api@0.0.7";
|
||||
import { Novu } from "npm:@novu/api@1.6.0";
|
||||
|
||||
const corsHeaders = {
|
||||
'Access-Control-Allow-Origin': '*',
|
||||
@@ -19,8 +19,7 @@ serve(async (req) => {
|
||||
}
|
||||
|
||||
const novu = new Novu({
|
||||
apiKey: novuApiKey,
|
||||
baseURL: Deno.env.get('VITE_NOVU_API_URL') || 'https://api.novu.co',
|
||||
secretKey: novuApiKey
|
||||
});
|
||||
|
||||
const { subscriberId, email, firstName, lastName, phone, avatar, data } = await req.json();
|
||||
|
||||
Reference in New Issue
Block a user