@base44-preview/sdk 0.8.26-pr.160.6071150 → 0.8.26-pr.162.4daaf84
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.
|
@@ -43,7 +43,7 @@ export interface AgentMessageToolCall {
|
|
|
43
43
|
/** Arguments passed to the tool as JSON string. */
|
|
44
44
|
arguments_string: string;
|
|
45
45
|
/** Status of the tool call. */
|
|
46
|
-
status: "running" | "success" | "error" | "stopped";
|
|
46
|
+
status: "running" | "success" | "error" | "stopped" | "waiting_for_user_input";
|
|
47
47
|
/** Results from the tool call. */
|
|
48
48
|
results?: string;
|
|
49
49
|
}
|
|
@@ -21,25 +21,12 @@ export function createConnectorsModule(axios, appId) {
|
|
|
21
21
|
// @ts-expect-error
|
|
22
22
|
return response.access_token;
|
|
23
23
|
},
|
|
24
|
-
async getConnection(
|
|
24
|
+
async getConnection(integrationType) {
|
|
25
25
|
var _a;
|
|
26
|
-
|
|
27
|
-
if (typeof arg === "string") {
|
|
28
|
-
if (!arg) {
|
|
29
|
-
throw new Error("Integration type is required and must be a string");
|
|
30
|
-
}
|
|
31
|
-
url = `/apps/${appId}/external-auth/tokens/${arg}`;
|
|
32
|
-
}
|
|
33
|
-
else if (arg && typeof arg === "object" && typeof arg.connectorId === "string") {
|
|
34
|
-
if (!arg.connectorId) {
|
|
35
|
-
throw new Error("Connector ID is required and must be a string");
|
|
36
|
-
}
|
|
37
|
-
url = `/apps/${appId}/external-auth/tokens/by-connector/${arg.connectorId}`;
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
26
|
+
if (!integrationType || typeof integrationType !== "string") {
|
|
40
27
|
throw new Error("Integration type is required and must be a string");
|
|
41
28
|
}
|
|
42
|
-
const response = await axios.get(
|
|
29
|
+
const response = await axios.get(`/apps/${appId}/external-auth/tokens/${integrationType}`);
|
|
43
30
|
const data = response;
|
|
44
31
|
return {
|
|
45
32
|
accessToken: data.access_token,
|
|
@@ -232,34 +232,6 @@ export interface ConnectorsModule {
|
|
|
232
232
|
* ```
|
|
233
233
|
*/
|
|
234
234
|
getConnection(integrationType: ConnectorIntegrationType): Promise<ConnectorConnectionResponse>;
|
|
235
|
-
/**
|
|
236
|
-
* Retrieves the OAuth access token and connection configuration for a **workspace-registered** connector
|
|
237
|
-
* (a connector backed by an OAuth app registered in the workspace, consented to once by the app builder).
|
|
238
|
-
*
|
|
239
|
-
* Use this overload when the app's backend function needs to use a connector identified by its
|
|
240
|
-
* workspace-connector ID rather than a platform integration type. The token returned represents
|
|
241
|
-
* the app builder's consent against the workspace's OAuth app and is shared across all app users
|
|
242
|
-
* of the app — identical semantics to the platform-shared `getConnection(integrationType)` form,
|
|
243
|
-
* differing only in which OAuth app was used to produce the token.
|
|
244
|
-
*
|
|
245
|
-
* @param opts - An object with `connectorId` — the ID of the workspace connector (the `OrganizationConnector` database ID) as surfaced in the builder chat context.
|
|
246
|
-
* @returns Promise resolving to a {@link ConnectorConnectionResponse} with `accessToken` and `connectionConfig`.
|
|
247
|
-
*
|
|
248
|
-
* @example
|
|
249
|
-
* ```typescript
|
|
250
|
-
* // Get the connection for a workspace-registered connector
|
|
251
|
-
* const { accessToken, connectionConfig } = await base44.asServiceRole.connectors.getConnection({
|
|
252
|
-
* connectorId: 'abc123def',
|
|
253
|
-
* });
|
|
254
|
-
*
|
|
255
|
-
* const response = await fetch(`https://${connectionConfig?.subdomain}.snowflakecomputing.com/api/v2/statements`, {
|
|
256
|
-
* headers: { Authorization: `Bearer ${accessToken}` },
|
|
257
|
-
* });
|
|
258
|
-
* ```
|
|
259
|
-
*/
|
|
260
|
-
getConnection(opts: {
|
|
261
|
-
connectorId: string;
|
|
262
|
-
}): Promise<ConnectorConnectionResponse>;
|
|
263
235
|
/**
|
|
264
236
|
* Retrieves an OAuth access token for an end user's connection to a specific connector.
|
|
265
237
|
*
|