@base44-preview/sdk 0.8.17-pr.73.3aab597 → 0.8.17-pr.73.e88f2f7

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
@@ -154,6 +154,7 @@ export function createClient(config) {
154
154
  token,
155
155
  }),
156
156
  appLogs: createAppLogsModule(serviceRoleAxiosClient, appId),
157
+ mobile: createMobileModule(serviceRoleAxiosClient, appId),
157
158
  cleanup: () => {
158
159
  if (socket) {
159
160
  socket.disconnect();
@@ -3,6 +3,22 @@
3
3
  *
4
4
  * Provides mobile native capabilities like push notifications.
5
5
  */
6
+ /**
7
+ * Validates notification parameters against character limits.
8
+ * @param params - Notification parameters to validate
9
+ * @throws Error if any parameter exceeds its limit
10
+ */
11
+ function validateNotificationParams(params) {
12
+ if (params.title.length > 100) {
13
+ throw new Error(`Title must be 100 characters or less (current: ${params.title.length})`);
14
+ }
15
+ if (params.content.length > 500) {
16
+ throw new Error(`Content must be 500 characters or less (current: ${params.content.length})`);
17
+ }
18
+ if (params.actionLabel && params.actionLabel.length > 50) {
19
+ throw new Error(`Action label must be 50 characters or less (current: ${params.actionLabel.length})`);
20
+ }
21
+ }
6
22
  /**
7
23
  * Creates the mobile module for the Base44 SDK.
8
24
  *
@@ -14,6 +30,8 @@
14
30
  export function createMobileModule(axios, appId) {
15
31
  return {
16
32
  async sendNotification(params) {
33
+ // Validate input parameters
34
+ validateNotificationParams(params);
17
35
  const response = await axios.post(`/api/apps/${appId}/mobile/notifications`, params);
18
36
  return response.data;
19
37
  },
@@ -27,7 +27,7 @@ export interface SendNotificationParams {
27
27
  /** Optional list of channels. If not specified, uses all channels (mobile_push + in_app) */
28
28
  channels?: NotificationChannel[];
29
29
  /** Optional custom metadata */
30
- metadata?: Record<string, any>;
30
+ metadata?: Record<string, unknown>;
31
31
  }
32
32
  /**
33
33
  * Result from a single notification channel.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.8.17-pr.73.3aab597",
3
+ "version": "0.8.17-pr.73.e88f2f7",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",