@supacloud/js 0.14.0 → 0.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +6 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -113,11 +113,15 @@ class SupaCloudTasksClient extends SupaCloudManagementClient {
|
|
|
113
113
|
};
|
|
114
114
|
}
|
|
115
115
|
async submit(functionName, options = {}) {
|
|
116
|
-
const { body, headers = {}, retries: _retries, timeoutSec: _timeoutSec, idempotencyKey
|
|
116
|
+
const { body, headers = {}, retries: _retries, timeoutSec: _timeoutSec, idempotencyKey, method } = options;
|
|
117
|
+
const invokeHeaders = {
|
|
118
|
+
...headers,
|
|
119
|
+
...idempotencyKey ? { "x-supacloud-idempotency-key": idempotencyKey } : {}
|
|
120
|
+
};
|
|
117
121
|
const { data, error } = await this.options.supabase.functions.invoke(functionName, {
|
|
118
122
|
body,
|
|
119
123
|
method,
|
|
120
|
-
headers
|
|
124
|
+
headers: invokeHeaders
|
|
121
125
|
});
|
|
122
126
|
if (error)
|
|
123
127
|
throw error;
|