@supabase/functions-js
Advanced tools
Comparing version 1.2.4 to 1.3.0
@@ -8,3 +8,3 @@ import { Fetch, FunctionInvokeOptions } from './types'; | ||
protected fetch: Fetch; | ||
constructor(url: string, headers: { | ||
constructor(url: string, headers?: { | ||
[key: string]: string; | ||
@@ -25,4 +25,4 @@ }, customFetch?: Fetch); | ||
*/ | ||
invoke(functionName: string, invokeOptions?: FunctionInvokeOptions): Promise<{ | ||
data: string | null; | ||
invoke<T = string>(functionName: string, invokeOptions?: FunctionInvokeOptions): Promise<{ | ||
data: T | null; | ||
error: Error | null; | ||
@@ -29,0 +29,0 @@ }>; |
@@ -17,3 +17,3 @@ "use strict"; | ||
this.url = url; | ||
this.headers = headers; | ||
this.headers = headers !== null && headers !== void 0 ? headers : {}; | ||
this.fetch = (0, helper_1.resolveFetch)(customFetch); | ||
@@ -20,0 +20,0 @@ } |
@@ -8,3 +8,3 @@ import { Fetch, FunctionInvokeOptions } from './types'; | ||
protected fetch: Fetch; | ||
constructor(url: string, headers: { | ||
constructor(url: string, headers?: { | ||
[key: string]: string; | ||
@@ -25,4 +25,4 @@ }, customFetch?: Fetch); | ||
*/ | ||
invoke(functionName: string, invokeOptions?: FunctionInvokeOptions): Promise<{ | ||
data: string | null; | ||
invoke<T = string>(functionName: string, invokeOptions?: FunctionInvokeOptions): Promise<{ | ||
data: T | null; | ||
error: Error | null; | ||
@@ -29,0 +29,0 @@ }>; |
@@ -14,3 +14,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
this.url = url; | ||
this.headers = headers; | ||
this.headers = headers !== null && headers !== void 0 ? headers : {}; | ||
this.fetch = resolveFetch(customFetch); | ||
@@ -17,0 +17,0 @@ } |
{ | ||
"name": "@supabase/functions-js", | ||
"version": "1.2.4", | ||
"version": "1.3.0", | ||
"description": "JS Client library to interact with Supabase Functions.", | ||
@@ -5,0 +5,0 @@ "main": "dist/main/index.js", |
@@ -9,5 +9,5 @@ import { resolveFetch } from './helper' | ||
constructor(url: string, headers: { [key: string]: string }, customFetch?: Fetch) { | ||
constructor(url: string, headers?: { [key: string]: string }, customFetch?: Fetch) { | ||
this.url = url | ||
this.headers = headers | ||
this.headers = headers ?? {} | ||
@@ -33,6 +33,6 @@ this.fetch = resolveFetch(customFetch) | ||
*/ | ||
async invoke( | ||
async invoke<T = string>( | ||
functionName: string, | ||
invokeOptions?: FunctionInvokeOptions | ||
): Promise<{ data: string | null; error: Error | null }> { | ||
): Promise<{ data: T | null; error: Error | null }> { | ||
try { | ||
@@ -39,0 +39,0 @@ const { headers, body } = invokeOptions ?? {} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
25410