@base44-preview/sdk 0.8.1-pr.42.20d6390 → 0.8.3-dev.8865e20
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 +6 -0
- package/dist/client.js +2 -0
- package/dist/modules/connectors.d.ts +16 -0
- package/dist/modules/connectors.js +23 -0
- package/dist/modules/connectors.types.d.ts +4 -0
- package/dist/modules/connectors.types.js +1 -0
- package/dist/modules/types.d.ts +1 -0
- package/dist/modules/types.js +1 -0
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -44,6 +44,9 @@ export declare function createClient(config: {
|
|
|
44
44
|
sso: {
|
|
45
45
|
getAccessToken(userid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
46
46
|
};
|
|
47
|
+
connectors: {
|
|
48
|
+
getAccessToken(integrationType: import("./types.js").ConnectorIntegrationType): Promise<import("./types.js").ConnectorAccessTokenResponse>;
|
|
49
|
+
};
|
|
47
50
|
functions: {
|
|
48
51
|
invoke(functionName: string, data: Record<string, any>): Promise<import("axios").AxiosResponse<any, any>>;
|
|
49
52
|
};
|
|
@@ -145,6 +148,9 @@ export declare function createClientFromRequest(request: Request): {
|
|
|
145
148
|
sso: {
|
|
146
149
|
getAccessToken(userid: string): Promise<import("axios").AxiosResponse<any, any>>;
|
|
147
150
|
};
|
|
151
|
+
connectors: {
|
|
152
|
+
getAccessToken(integrationType: import("./types.js").ConnectorIntegrationType): Promise<import("./types.js").ConnectorAccessTokenResponse>;
|
|
153
|
+
};
|
|
148
154
|
functions: {
|
|
149
155
|
invoke(functionName: string, data: Record<string, any>): Promise<import("axios").AxiosResponse<any, any>>;
|
|
150
156
|
};
|
package/dist/client.js
CHANGED
|
@@ -3,6 +3,7 @@ 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 { createConnectorsModule } from "./modules/connectors.js";
|
|
6
7
|
import { getAccessToken } from "./utils/auth-utils.js";
|
|
7
8
|
import { createFunctionsModule } from "./modules/functions.js";
|
|
8
9
|
import { createAgentsModule } from "./modules/agents.js";
|
|
@@ -90,6 +91,7 @@ export function createClient(config) {
|
|
|
90
91
|
entities: createEntitiesModule(serviceRoleAxiosClient, appId),
|
|
91
92
|
integrations: createIntegrationsModule(serviceRoleAxiosClient, appId),
|
|
92
93
|
sso: createSsoModule(serviceRoleAxiosClient, appId, token),
|
|
94
|
+
connectors: createConnectorsModule(serviceRoleAxiosClient, appId),
|
|
93
95
|
functions: createFunctionsModule(serviceRoleFunctionsAxiosClient, appId),
|
|
94
96
|
agents: createAgentsModule({
|
|
95
97
|
axios: serviceRoleAxiosClient,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AxiosInstance } from "axios";
|
|
2
|
+
import { ConnectorIntegrationType, ConnectorAccessTokenResponse } from "./connectors.types.js";
|
|
3
|
+
/**
|
|
4
|
+
* Creates the Connectors module for the Base44 SDK
|
|
5
|
+
* @param axios - Axios instance (should be service role client)
|
|
6
|
+
* @param appId - Application ID
|
|
7
|
+
* @returns Connectors module
|
|
8
|
+
*/
|
|
9
|
+
export declare function createConnectorsModule(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: ConnectorIntegrationType): Promise<ConnectorAccessTokenResponse>;
|
|
16
|
+
};
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Creates the Connectors module for the Base44 SDK
|
|
3
|
+
* @param axios - Axios instance (should be service role client)
|
|
4
|
+
* @param appId - Application ID
|
|
5
|
+
* @returns Connectors module
|
|
6
|
+
*/
|
|
7
|
+
export function createConnectorsModule(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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/modules/types.d.ts
CHANGED
package/dist/modules/types.js
CHANGED