@base44-preview/cli 0.1.6-pr.580.c820609 → 0.1.6-pr.583.90db4f5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/cli",
3
- "version": "0.1.6-pr.580.c820609",
3
+ "version": "0.1.6-pr.583.90db4f5",
4
4
  "description": "Base44 CLI - Unified interface for managing Base44 applications",
5
5
  "type": "module",
6
6
  "bin": {
@@ -1,13 +0,0 @@
1
- import { createClient } from '@base44/sdk';
2
- import { appParams } from '@/lib/app-params';
3
-
4
- const { appId, token, functionsVersion, appBaseUrl } = appParams;
5
-
6
- export const base44 = createClient({
7
- appId,
8
- token,
9
- functionsVersion,
10
- serverUrl: '',
11
- requiresAuth: false,
12
- appBaseUrl
13
- });
@@ -1,54 +0,0 @@
1
- const isNode = typeof window === 'undefined';
2
- const windowObj = isNode ? { localStorage: new Map() } : window;
3
- const storage = windowObj.localStorage;
4
-
5
- const toSnakeCase = (str) => {
6
- return str.replace(/([A-Z])/g, '_$1').toLowerCase();
7
- }
8
-
9
- const getAppParamValue = (paramName, { defaultValue = undefined, removeFromUrl = false } = {}) => {
10
- if (isNode) {
11
- return defaultValue;
12
- }
13
- const storageKey = `base44_${toSnakeCase(paramName)}`;
14
- const urlParams = new URLSearchParams(window.location.search);
15
- const searchParam = urlParams.get(paramName);
16
- if (removeFromUrl) {
17
- urlParams.delete(paramName);
18
- const newUrl = `${window.location.pathname}${urlParams.toString() ? `?${urlParams.toString()}` : ""
19
- }${window.location.hash}`;
20
- window.history.replaceState({}, document.title, newUrl);
21
- }
22
- if (searchParam) {
23
- storage.setItem(storageKey, searchParam);
24
- return searchParam;
25
- }
26
- if (defaultValue) {
27
- storage.setItem(storageKey, defaultValue);
28
- return defaultValue;
29
- }
30
- const storedValue = storage.getItem(storageKey);
31
- if (storedValue) {
32
- return storedValue;
33
- }
34
- return null;
35
- }
36
-
37
- const getAppParams = () => {
38
- if (getAppParamValue("clear_access_token") === 'true') {
39
- storage.removeItem('base44_access_token');
40
- storage.removeItem('token');
41
- }
42
- return {
43
- appId: getAppParamValue("app_id", { defaultValue: import.meta.env.VITE_BASE44_APP_ID }),
44
- token: getAppParamValue("access_token", { removeFromUrl: true }),
45
- fromUrl: getAppParamValue("from_url", { defaultValue: window.location.href }),
46
- functionsVersion: getAppParamValue("functions_version", { defaultValue: import.meta.env.VITE_BASE44_FUNCTIONS_VERSION }),
47
- appBaseUrl: getAppParamValue("app_base_url", { defaultValue: import.meta.env.VITE_BASE44_APP_BASE_URL }),
48
- }
49
- }
50
-
51
-
52
- export const appParams = {
53
- ...getAppParams()
54
- }