@base44-preview/sdk 0.5.0-pr.21.2b7656a → 0.5.0-pr.22.930030a

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
@@ -35,12 +35,25 @@ export declare function createClient(config: {
35
35
  functions: {
36
36
  invoke(functionName: string, data: Record<string, any>): Promise<import("axios").AxiosResponse<any, any>>;
37
37
  };
38
+ auth: {
39
+ me(): Promise<import("axios").AxiosResponse<any, any>>;
40
+ getSsoAccessToken(userid: string): Promise<import("axios").AxiosResponse<any, any>>;
41
+ updateMe(data: Record<string, any>): Promise<import("axios").AxiosResponse<any, any>>;
42
+ redirectToLogin(nextUrl: string): void;
43
+ logout(redirectUrl?: string): void;
44
+ setToken(token: string, saveToStorage?: boolean): void;
45
+ loginViaEmailPassword(email: string, password: string, turnstileToken?: string): Promise<{
46
+ access_token: string;
47
+ user: any;
48
+ }>;
49
+ isAuthenticated(): Promise<boolean>;
50
+ };
38
51
  };
39
52
  entities: {};
40
53
  integrations: {};
41
54
  auth: {
42
55
  me(): Promise<import("axios").AxiosResponse<any, any>>;
43
- getSsoAccessToken(userid?: string): Promise<import("axios").AxiosResponse<any, any>>;
56
+ getSsoAccessToken(userid: string): Promise<import("axios").AxiosResponse<any, any>>;
44
57
  updateMe(data: Record<string, any>): Promise<import("axios").AxiosResponse<any, any>>;
45
58
  redirectToLogin(nextUrl: string): void;
46
59
  logout(redirectUrl?: string): void;
@@ -76,12 +89,25 @@ export declare function createClientFromRequest(request: Request): {
76
89
  functions: {
77
90
  invoke(functionName: string, data: Record<string, any>): Promise<import("axios").AxiosResponse<any, any>>;
78
91
  };
92
+ auth: {
93
+ me(): Promise<import("axios").AxiosResponse<any, any>>;
94
+ getSsoAccessToken(userid: string): Promise<import("axios").AxiosResponse<any, any>>;
95
+ updateMe(data: Record<string, any>): Promise<import("axios").AxiosResponse<any, any>>;
96
+ redirectToLogin(nextUrl: string): void;
97
+ logout(redirectUrl?: string): void;
98
+ setToken(token: string, saveToStorage?: boolean): void;
99
+ loginViaEmailPassword(email: string, password: string, turnstileToken?: string): Promise<{
100
+ access_token: string;
101
+ user: any;
102
+ }>;
103
+ isAuthenticated(): Promise<boolean>;
104
+ };
79
105
  };
80
106
  entities: {};
81
107
  integrations: {};
82
108
  auth: {
83
109
  me(): Promise<import("axios").AxiosResponse<any, any>>;
84
- getSsoAccessToken(userid?: string): Promise<import("axios").AxiosResponse<any, any>>;
110
+ getSsoAccessToken(userid: string): Promise<import("axios").AxiosResponse<any, any>>;
85
111
  updateMe(data: Record<string, any>): Promise<import("axios").AxiosResponse<any, any>>;
86
112
  redirectToLogin(nextUrl: string): void;
87
113
  logout(redirectUrl?: string): void;
package/dist/client.js CHANGED
@@ -66,6 +66,7 @@ export function createClient(config) {
66
66
  entities: createEntitiesModule(serviceRoleAxiosClient, appId),
67
67
  integrations: createIntegrationsModule(serviceRoleAxiosClient, appId),
68
68
  functions: createFunctionsModule(serviceRoleFunctionsAxiosClient, appId),
69
+ auth: createAuthModule(axiosClient, functionsAxiosClient, appId),
69
70
  };
70
71
  // Always try to get token from localStorage or URL parameters
71
72
  if (typeof window !== "undefined") {
@@ -14,10 +14,10 @@ export declare function createAuthModule(axios: AxiosInstance, functionsAxiosCli
14
14
  me(): Promise<import("axios").AxiosResponse<any, any>>;
15
15
  /**
16
16
  * Get current user sso access token
17
- * @param {string} [userid] - Optional user ID to include as URL parameter
17
+ * @param {string} userid - User ID to include as path parameter
18
18
  * @returns {Promise<Object>} Current user sso access_token
19
19
  */
20
- getSsoAccessToken(userid?: string): Promise<import("axios").AxiosResponse<any, any>>;
20
+ getSsoAccessToken(userid: string): Promise<import("axios").AxiosResponse<any, any>>;
21
21
  /**
22
22
  * Update current user data
23
23
  * @param {Object} data - Updated user data
@@ -16,13 +16,12 @@ export function createAuthModule(axios, functionsAxiosClient, appId) {
16
16
  },
17
17
  /**
18
18
  * Get current user sso access token
19
- * @param {string} [userid] - Optional user ID to include as URL parameter
19
+ * @param {string} userid - User ID to include as path parameter
20
20
  * @returns {Promise<Object>} Current user sso access_token
21
21
  */
22
22
  async getSsoAccessToken(userid) {
23
- const url = `/apps/${appId}/auth/sso/accesstoken`;
24
- const params = userid ? { userid } : {};
25
- return axios.get(url, { params });
23
+ const url = `/apps/${appId}/auth/sso/accesstoken/${userid}`;
24
+ return axios.get(url);
26
25
  },
27
26
  /**
28
27
  * Update current user data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@base44-preview/sdk",
3
- "version": "0.5.0-pr.21.2b7656a",
3
+ "version": "0.5.0-pr.22.930030a",
4
4
  "description": "JavaScript SDK for Base44 API",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",