@base44-preview/sdk 0.8.20-pr.141.7f3a542 → 0.8.20-pr.141.94d96d2

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/client.js CHANGED
@@ -118,15 +118,11 @@ export function createClient(config) {
118
118
  auth: userAuthModule,
119
119
  functions: createFunctionsModule(functionsAxiosClient, appId, {
120
120
  getAuthHeaders: () => {
121
- var _a, _b;
122
121
  const headers = {};
123
- const commonHeaders = (_b = (_a = functionsAxiosClient.defaults) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b.common;
124
- if (commonHeaders) {
125
- Object.entries(commonHeaders).forEach(([key, value]) => {
126
- if (typeof value === 'string') {
127
- headers[key] = value;
128
- }
129
- });
122
+ // Get current token from storage or initial config
123
+ const currentToken = token || getAccessToken();
124
+ if (currentToken) {
125
+ headers["Authorization"] = `Bearer ${currentToken}`;
130
126
  }
131
127
  return headers;
132
128
  },
@@ -165,15 +161,10 @@ export function createClient(config) {
165
161
  connectors: createConnectorsModule(serviceRoleAxiosClient, appId),
166
162
  functions: createFunctionsModule(serviceRoleFunctionsAxiosClient, appId, {
167
163
  getAuthHeaders: () => {
168
- var _a, _b;
169
164
  const headers = {};
170
- const commonHeaders = (_b = (_a = serviceRoleFunctionsAxiosClient.defaults) === null || _a === void 0 ? void 0 : _a.headers) === null || _b === void 0 ? void 0 : _b.common;
171
- if (commonHeaders) {
172
- Object.entries(commonHeaders).forEach(([key, value]) => {
173
- if (typeof value === 'string') {
174
- headers[key] = value;
175
- }
176
- });
165
+ // Use service token for authorization
166
+ if (serviceToken) {
167
+ headers["Authorization"] = `Bearer ${serviceToken}`;
177
168
  }
178
169
  return headers;
179
170
  },
@@ -66,7 +66,7 @@ export function createFunctionsModule(axios, appId, config) {
66
66
  // Fetch a backend function endpoint directly.
67
67
  async fetch(path, init = {}) {
68
68
  const normalizedPath = path.startsWith("/") ? path : `/${path}`;
69
- const primaryPath = `/api/functions${normalizedPath}`;
69
+ const primaryPath = `/functions${normalizedPath}`;
70
70
  const headers = toHeaders(init.headers);
71
71
  const requestInit = {
72
72
  ...init,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.20-pr.141.7f3a542",
3
+ "version": "0.8.20-pr.141.94d96d2",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",