@overmap-ai/core 1.0.48-activity-history.1 → 1.0.48-activity-history.2
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/components/FileViewer/context.d.ts +1 -1
- package/dist/forms/builder/FieldActions.d.ts +1 -1
- package/dist/forms/constants.d.ts +2 -0
- package/dist/forms/constantsJsx.d.ts +9 -0
- package/dist/overmap-core.js +35 -3
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +35 -3
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/sdk.d.ts +2 -1
- package/dist/sdk/services/AgentService.d.ts +39 -0
- package/dist/sdk/services/AuthService.d.ts +1 -1
- package/dist/sdk/services/LicenseService.d.ts +1 -1
- package/dist/sdk/services/index.d.ts +1 -0
- package/dist/store/slices/componentSlice.d.ts +2 -2
- package/dist/store/slices/componentTypeSlice.d.ts +5 -5
- package/dist/store/slices/licenseSlice.d.ts +1 -2
- package/dist/store/slices/organizationSlice.d.ts +1 -1
- package/dist/typings/models/base.d.ts +5 -0
- package/dist/typings/models/users.d.ts +2 -3
- package/package.json +4 -2
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { FileViewerConfig } from "./typings
|
|
2
|
+
import { FileViewerConfig } from "./typings";
|
|
3
3
|
export type FileViewerContextType = (func: (close: () => void) => FileViewerConfig) => void;
|
|
4
4
|
export declare const FileViewerContext: import("react").Context<FileViewerContextType>;
|
|
5
5
|
export declare const useFileViewer: () => FileViewerContextType;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Dispatch, SetStateAction } from "react";
|
|
2
|
+
interface FullScreenImagePreviewProps {
|
|
3
|
+
file: File;
|
|
4
|
+
url: string;
|
|
5
|
+
name: string;
|
|
6
|
+
setShowPreview: Dispatch<SetStateAction<boolean>>;
|
|
7
|
+
}
|
|
8
|
+
export declare const FullScreenImagePreview: import("react").MemoExoticComponent<(props: FullScreenImagePreviewProps) => import("react/jsx-runtime").JSX.Element>;
|
|
9
|
+
export {};
|
package/dist/overmap-core.js
CHANGED
|
@@ -4225,7 +4225,7 @@ async function performRequest(action, client) {
|
|
|
4225
4225
|
const errorResponse = extractResponseFromError(error2);
|
|
4226
4226
|
const status = errorResponse == null ? void 0 : errorResponse.status;
|
|
4227
4227
|
if (status === 401) {
|
|
4228
|
-
if (url.endsWith("
|
|
4228
|
+
if (url.endsWith("/token/refresh/")) {
|
|
4229
4229
|
if (state.authReducer.isLoggedIn) {
|
|
4230
4230
|
console.warn("No signed-in user to sign out.");
|
|
4231
4231
|
}
|
|
@@ -5065,6 +5065,10 @@ class AuthService extends BaseApiService {
|
|
|
5065
5065
|
checkAuth: false,
|
|
5066
5066
|
// Don't wait for other requests to finish, or we might end up in a deadlock.
|
|
5067
5067
|
immediate: true
|
|
5068
|
+
}).catch((e) => {
|
|
5069
|
+
console.error("Could not renew tokens; logging out due to error:", e);
|
|
5070
|
+
void this.logout();
|
|
5071
|
+
return void 0;
|
|
5068
5072
|
});
|
|
5069
5073
|
let response = void 0;
|
|
5070
5074
|
try {
|
|
@@ -5073,7 +5077,7 @@ class AuthService extends BaseApiService {
|
|
|
5073
5077
|
await this.logout();
|
|
5074
5078
|
}
|
|
5075
5079
|
if (!response)
|
|
5076
|
-
|
|
5080
|
+
return void 0;
|
|
5077
5081
|
if (!response.access)
|
|
5078
5082
|
throw new Error("Missing access token");
|
|
5079
5083
|
if (!response.refresh)
|
|
@@ -5145,7 +5149,11 @@ class AuthService extends BaseApiService {
|
|
|
5145
5149
|
throw new Error("No refresh token found");
|
|
5146
5150
|
}
|
|
5147
5151
|
try {
|
|
5148
|
-
const
|
|
5152
|
+
const tokens = await this._getRenewedTokens(dyingRefreshToken);
|
|
5153
|
+
if (!tokens) {
|
|
5154
|
+
return void 0;
|
|
5155
|
+
}
|
|
5156
|
+
const { accessToken, refreshToken } = tokens;
|
|
5149
5157
|
console.log("Got renewed tokens");
|
|
5150
5158
|
store.dispatch(setTokens({ accessToken, refreshToken }));
|
|
5151
5159
|
} catch (e) {
|
|
@@ -7647,10 +7655,33 @@ class DocumentService extends BaseApiService {
|
|
|
7647
7655
|
store.dispatch(setDocuments(result));
|
|
7648
7656
|
}
|
|
7649
7657
|
}
|
|
7658
|
+
class AgentService extends BaseApiService {
|
|
7659
|
+
/**
|
|
7660
|
+
* Prompt the agent with a message.
|
|
7661
|
+
* @param request The message to prompt the agent with.
|
|
7662
|
+
* @param conversationId If continuing an existing message, the UUID of that conversation.
|
|
7663
|
+
*/
|
|
7664
|
+
prompt(request2, conversationId) {
|
|
7665
|
+
const activeProjectId = this.client.store.getState().projectReducer.activeProjectId;
|
|
7666
|
+
return this.enqueueRequest({
|
|
7667
|
+
description: "Prompt agent",
|
|
7668
|
+
method: HttpMethod.POST,
|
|
7669
|
+
url: "/agents/prompt/",
|
|
7670
|
+
payload: {
|
|
7671
|
+
prompt: request2,
|
|
7672
|
+
active_project: activeProjectId
|
|
7673
|
+
},
|
|
7674
|
+
blockers: ["prompt"],
|
|
7675
|
+
blocks: ["prompt"],
|
|
7676
|
+
queryParams: conversationId ? { conversation_id: conversationId } : {}
|
|
7677
|
+
});
|
|
7678
|
+
}
|
|
7679
|
+
}
|
|
7650
7680
|
class OvermapSDK {
|
|
7651
7681
|
constructor(apiUrl, store) {
|
|
7652
7682
|
__publicField(this, "API_URL");
|
|
7653
7683
|
__publicField(this, "store");
|
|
7684
|
+
__publicField(this, "agent", new AgentService(this));
|
|
7654
7685
|
__publicField(this, "files", new FileService(this));
|
|
7655
7686
|
__publicField(this, "attachments", new AttachmentService(this));
|
|
7656
7687
|
__publicField(this, "auth", new AuthService(this));
|
|
@@ -15340,6 +15371,7 @@ const index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.definePropert
|
|
|
15340
15371
|
}, Symbol.toStringTag, { value: "Module" }));
|
|
15341
15372
|
export {
|
|
15342
15373
|
APIError,
|
|
15374
|
+
AgentService,
|
|
15343
15375
|
AttachmentService,
|
|
15344
15376
|
AuthService,
|
|
15345
15377
|
BaseApiService,
|