@base44-preview/sdk 0.8.0-pr.40.3483989 → 0.8.0-pr.41.3a88632
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 +0 -6
- package/dist/client.js +0 -2
- package/dist/modules/agents.js +1 -1
- package/dist/modules/types.d.ts +0 -1
- package/dist/modules/types.js +0 -1
- package/package.json +1 -1
- package/dist/modules/external-auth.d.ts +0 -16
- package/dist/modules/external-auth.js +0 -23
- package/dist/modules/external-auth.types.d.ts +0 -4
- package/dist/modules/external-auth.types.js +0 -1
package/dist/client.d.ts
CHANGED
|
@@ -44,9 +44,6 @@ export declare function createClient(config: {
|
|
|
44
44
|
sso: {
|
|
45
45
|
getAccessToken(userid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
46
46
|
};
|
|
47
|
-
externalAuth: {
|
|
48
|
-
getAccessToken(integrationType: import("./types.js").ExternalAuthIntegrationType): Promise<import("./types.js").ExternalAuthAccessTokenResponse>;
|
|
49
|
-
};
|
|
50
47
|
functions: {
|
|
51
48
|
invoke(functionName: string, data: Record<string, any>): Promise<import("axios").AxiosResponse<any, any>>;
|
|
52
49
|
};
|
|
@@ -138,9 +135,6 @@ export declare function createClientFromRequest(request: Request): {
|
|
|
138
135
|
sso: {
|
|
139
136
|
getAccessToken(userid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
140
137
|
};
|
|
141
|
-
externalAuth: {
|
|
142
|
-
getAccessToken(integrationType: import("./types.js").ExternalAuthIntegrationType): Promise<import("./types.js").ExternalAuthAccessTokenResponse>;
|
|
143
|
-
};
|
|
144
138
|
functions: {
|
|
145
139
|
invoke(functionName: string, data: Record<string, any>): Promise<import("axios").AxiosResponse<any, any>>;
|
|
146
140
|
};
|
package/dist/client.js
CHANGED
|
@@ -3,7 +3,6 @@ import { createEntitiesModule } from "./modules/entities.js";
|
|
|
3
3
|
import { createIntegrationsModule } from "./modules/integrations.js";
|
|
4
4
|
import { createAuthModule } from "./modules/auth.js";
|
|
5
5
|
import { createSsoModule } from "./modules/sso.js";
|
|
6
|
-
import { createExternalAuthModule } from "./modules/external-auth.js";
|
|
7
6
|
import { getAccessToken } from "./utils/auth-utils.js";
|
|
8
7
|
import { createFunctionsModule } from "./modules/functions.js";
|
|
9
8
|
import { createAgentsModule } from "./modules/agents.js";
|
|
@@ -89,7 +88,6 @@ export function createClient(config) {
|
|
|
89
88
|
entities: createEntitiesModule(serviceRoleAxiosClient, appId),
|
|
90
89
|
integrations: createIntegrationsModule(serviceRoleAxiosClient, appId),
|
|
91
90
|
sso: createSsoModule(serviceRoleAxiosClient, appId, token),
|
|
92
|
-
externalAuth: createExternalAuthModule(serviceRoleAxiosClient, appId),
|
|
93
91
|
functions: createFunctionsModule(serviceRoleFunctionsAxiosClient, appId),
|
|
94
92
|
agents: createAgentsModule({
|
|
95
93
|
axios: serviceRoleAxiosClient,
|
package/dist/modules/agents.js
CHANGED
|
@@ -34,7 +34,7 @@ export function createAgentsModule({ axios, socket, appId, serverUrl, token, })
|
|
|
34
34
|
});
|
|
35
35
|
};
|
|
36
36
|
const getWhatsAppConnectURL = (agentName) => {
|
|
37
|
-
const baseUrl = `${serverUrl}/
|
|
37
|
+
const baseUrl = `${serverUrl}/api/apps/${appId}/agents/${encodeURIComponent(agentName)}/whatsapp`;
|
|
38
38
|
const accessToken = token !== null && token !== void 0 ? token : getAccessToken();
|
|
39
39
|
if (accessToken) {
|
|
40
40
|
return `${baseUrl}?token=${accessToken}`;
|
package/dist/modules/types.d.ts
CHANGED
package/dist/modules/types.js
CHANGED
package/package.json
CHANGED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { AxiosInstance } from "axios";
|
|
2
|
-
import { ExternalAuthIntegrationType, ExternalAuthAccessTokenResponse } from "./external-auth.types.js";
|
|
3
|
-
/**
|
|
4
|
-
* Creates the External Auth module for the Base44 SDK
|
|
5
|
-
* @param axios - Axios instance (should be service role client)
|
|
6
|
-
* @param appId - Application ID
|
|
7
|
-
* @returns External Auth module
|
|
8
|
-
*/
|
|
9
|
-
export declare function createExternalAuthModule(axios: AxiosInstance, appId: string): {
|
|
10
|
-
/**
|
|
11
|
-
* Retrieve an access token for a given integration type
|
|
12
|
-
* @param integrationType - The integration type to get access token for
|
|
13
|
-
* @returns Access token response
|
|
14
|
-
*/
|
|
15
|
-
getAccessToken(integrationType: ExternalAuthIntegrationType): Promise<ExternalAuthAccessTokenResponse>;
|
|
16
|
-
};
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Creates the External Auth module for the Base44 SDK
|
|
3
|
-
* @param axios - Axios instance (should be service role client)
|
|
4
|
-
* @param appId - Application ID
|
|
5
|
-
* @returns External Auth module
|
|
6
|
-
*/
|
|
7
|
-
export function createExternalAuthModule(axios, appId) {
|
|
8
|
-
return {
|
|
9
|
-
/**
|
|
10
|
-
* Retrieve an access token for a given integration type
|
|
11
|
-
* @param integrationType - The integration type to get access token for
|
|
12
|
-
* @returns Access token response
|
|
13
|
-
*/
|
|
14
|
-
async getAccessToken(integrationType) {
|
|
15
|
-
if (!integrationType || typeof integrationType !== "string") {
|
|
16
|
-
throw new Error("Integration type is required and must be a string");
|
|
17
|
-
}
|
|
18
|
-
const response = await axios.get(`/apps/${appId}/external-auth/tokens/${integrationType}`);
|
|
19
|
-
// @ts-expect-error
|
|
20
|
-
return response.access_token;
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|