@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.
Files changed (2) hide show
  1. package/dist/index.js +6 -2
  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: _idempotencyKey, method } = options;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@supacloud/js",
3
- "version": "0.14.0",
3
+ "version": "0.15.1",
4
4
  "description": "Platform SDK for SupaCloud, built on top of supabase-js",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",