@base44-preview/sdk 0.8.0-pr.41.3a88632 → 0.8.1-dev.7a02156

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.d.ts CHANGED
@@ -59,6 +59,11 @@ export declare function createClient(config: {
59
59
  subscribeToConversation: (conversationId: string, onUpdate?: (conversation: import("./types.js").AgentConversation) => void) => () => void;
60
60
  getWhatsAppConnectURL: (agentName: string) => string;
61
61
  };
62
+ appLogs: {
63
+ logUserInApp(pageName: string): Promise<void>;
64
+ fetchLogs(params?: Record<string, any>): Promise<any>;
65
+ getStats(params?: Record<string, any>): Promise<any>;
66
+ };
62
67
  cleanup: () => void;
63
68
  };
64
69
  entities: {};
@@ -112,6 +117,11 @@ export declare function createClient(config: {
112
117
  subscribeToConversation: (conversationId: string, onUpdate?: (conversation: import("./types.js").AgentConversation) => void) => () => void;
113
118
  getWhatsAppConnectURL: (agentName: string) => string;
114
119
  };
120
+ appLogs: {
121
+ logUserInApp(pageName: string): Promise<void>;
122
+ fetchLogs(params?: Record<string, any>): Promise<any>;
123
+ getStats(params?: Record<string, any>): Promise<any>;
124
+ };
115
125
  cleanup: () => void;
116
126
  };
117
127
  export declare function createClientFromRequest(request: Request): {
@@ -150,6 +160,11 @@ export declare function createClientFromRequest(request: Request): {
150
160
  subscribeToConversation: (conversationId: string, onUpdate?: (conversation: import("./types.js").AgentConversation) => void) => () => void;
151
161
  getWhatsAppConnectURL: (agentName: string) => string;
152
162
  };
163
+ appLogs: {
164
+ logUserInApp(pageName: string): Promise<void>;
165
+ fetchLogs(params?: Record<string, any>): Promise<any>;
166
+ getStats(params?: Record<string, any>): Promise<any>;
167
+ };
153
168
  cleanup: () => void;
154
169
  };
155
170
  entities: {};
@@ -203,5 +218,10 @@ export declare function createClientFromRequest(request: Request): {
203
218
  subscribeToConversation: (conversationId: string, onUpdate?: (conversation: import("./types.js").AgentConversation) => void) => () => void;
204
219
  getWhatsAppConnectURL: (agentName: string) => string;
205
220
  };
221
+ appLogs: {
222
+ logUserInApp(pageName: string): Promise<void>;
223
+ fetchLogs(params?: Record<string, any>): Promise<any>;
224
+ getStats(params?: Record<string, any>): Promise<any>;
225
+ };
206
226
  cleanup: () => void;
207
227
  };
package/dist/client.js CHANGED
@@ -6,6 +6,7 @@ import { createSsoModule } from "./modules/sso.js";
6
6
  import { getAccessToken } from "./utils/auth-utils.js";
7
7
  import { createFunctionsModule } from "./modules/functions.js";
8
8
  import { createAgentsModule } from "./modules/agents.js";
9
+ import { createAppLogsModule } from "./modules/app-logs.js";
9
10
  import { RoomsSocket } from "./utils/socket-utils.js";
10
11
  /**
11
12
  * Create a Base44 client instance
@@ -80,6 +81,7 @@ export function createClient(config) {
80
81
  serverUrl,
81
82
  token,
82
83
  }),
84
+ appLogs: createAppLogsModule(axiosClient, appId),
83
85
  cleanup: () => {
84
86
  socket.disconnect();
85
87
  },
@@ -96,6 +98,7 @@ export function createClient(config) {
96
98
  serverUrl,
97
99
  token,
98
100
  }),
101
+ appLogs: createAppLogsModule(serviceRoleAxiosClient, appId),
99
102
  cleanup: () => {
100
103
  socket.disconnect();
101
104
  },
@@ -0,0 +1,27 @@
1
+ import { AxiosInstance } from "axios";
2
+ /**
3
+ * Creates the app logs module for the Base44 SDK
4
+ * @param {AxiosInstance} axios - Axios instance
5
+ * @param {string} appId - Application ID
6
+ * @returns {Object} App logs module
7
+ */
8
+ export declare function createAppLogsModule(axios: AxiosInstance, appId: string): {
9
+ /**
10
+ * Log user activity in the app
11
+ * @param {string} pageName - Name of the page being visited
12
+ * @returns {Promise<void>}
13
+ */
14
+ logUserInApp(pageName: string): Promise<void>;
15
+ /**
16
+ * Fetch app logs with optional parameters
17
+ * @param {Object} params - Query parameters for filtering logs
18
+ * @returns {Promise<any>} App logs data
19
+ */
20
+ fetchLogs(params?: Record<string, any>): Promise<any>;
21
+ /**
22
+ * Get app statistics
23
+ * @param {Object} params - Query parameters for filtering stats
24
+ * @returns {Promise<any>} App statistics
25
+ */
26
+ getStats(params?: Record<string, any>): Promise<any>;
27
+ };
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Creates the app logs module for the Base44 SDK
3
+ * @param {AxiosInstance} axios - Axios instance
4
+ * @param {string} appId - Application ID
5
+ * @returns {Object} App logs module
6
+ */
7
+ export function createAppLogsModule(axios, appId) {
8
+ const baseURL = `/app-logs/${appId}`;
9
+ return {
10
+ /**
11
+ * Log user activity in the app
12
+ * @param {string} pageName - Name of the page being visited
13
+ * @returns {Promise<void>}
14
+ */
15
+ async logUserInApp(pageName) {
16
+ await axios.post(`${baseURL}/log-user-in-app/${pageName}`);
17
+ },
18
+ /**
19
+ * Fetch app logs with optional parameters
20
+ * @param {Object} params - Query parameters for filtering logs
21
+ * @returns {Promise<any>} App logs data
22
+ */
23
+ async fetchLogs(params = {}) {
24
+ const response = await axios.get(baseURL, { params });
25
+ return response;
26
+ },
27
+ /**
28
+ * Get app statistics
29
+ * @param {Object} params - Query parameters for filtering stats
30
+ * @returns {Promise<any>} App statistics
31
+ */
32
+ async getStats(params = {}) {
33
+ const response = await axios.get(`${baseURL}/stats`, { params });
34
+ return response;
35
+ },
36
+ };
37
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.0-pr.41.3a88632",
3
+ "version": "0.8.1-dev.7a02156",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",