@overmap-ai/core 1.0.60-model-adapter.1 → 1.0.60-sdk-refactor.1

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.
Files changed (111) hide show
  1. package/dist/enums/index.d.ts +0 -1
  2. package/dist/forms/builder/FormBuilder.d.ts +1 -0
  3. package/dist/forms/fields/BaseField/hooks.d.ts +11 -11
  4. package/dist/forms/fields/BaseField/layouts.d.ts +3 -2
  5. package/dist/forms/fields/typings.d.ts +3 -3
  6. package/dist/forms/index.d.ts +1 -0
  7. package/dist/forms/provider.d.ts +5 -0
  8. package/dist/forms/renderer/index.d.ts +0 -3
  9. package/dist/forms/utils.d.ts +0 -2
  10. package/dist/index.d.ts +0 -1
  11. package/dist/overmap-core.js +17955 -15482
  12. package/dist/overmap-core.js.map +1 -1
  13. package/dist/overmap-core.umd.cjs +17889 -15417
  14. package/dist/overmap-core.umd.cjs.map +1 -1
  15. package/dist/sdk/base.d.ts +22 -0
  16. package/dist/sdk/globals.d.ts +7 -0
  17. package/dist/sdk/index.d.ts +1 -0
  18. package/dist/sdk/sdk.d.ts +3 -51
  19. package/dist/sdk/services/AgentService.d.ts +3 -2
  20. package/dist/sdk/services/AssetAttachmentService.d.ts +4 -3
  21. package/dist/sdk/services/AssetService.d.ts +4 -3
  22. package/dist/sdk/services/AssetStageCompletionService.d.ts +4 -3
  23. package/dist/sdk/services/AssetStageService.d.ts +3 -2
  24. package/dist/sdk/services/AssetTypeAttachmentService.d.ts +4 -3
  25. package/dist/sdk/services/AssetTypeService.d.ts +4 -3
  26. package/dist/sdk/services/AuthService.d.ts +4 -3
  27. package/dist/sdk/services/BaseApiService.d.ts +15 -4
  28. package/dist/sdk/services/BaseAttachmentService.d.ts +5 -4
  29. package/dist/sdk/services/CategoryService.d.ts +4 -3
  30. package/dist/sdk/services/DocumentAttachmentService.d.ts +4 -3
  31. package/dist/sdk/services/DocumentService.d.ts +4 -3
  32. package/dist/sdk/services/EmailDomainsService.d.ts +3 -2
  33. package/dist/sdk/services/EmailVerificationService.d.ts +3 -3
  34. package/dist/sdk/services/FileService.d.ts +4 -1
  35. package/dist/sdk/services/IssueAttachmentService.d.ts +4 -3
  36. package/dist/sdk/services/IssueCommentService.d.ts +4 -3
  37. package/dist/sdk/services/IssueService.d.ts +4 -3
  38. package/dist/sdk/services/IssueTypeService.d.ts +4 -3
  39. package/dist/sdk/services/IssueUpdateService.d.ts +3 -1
  40. package/dist/sdk/services/LicenseService.d.ts +3 -2
  41. package/dist/sdk/services/OrganizationAccessService.d.ts +3 -2
  42. package/dist/sdk/services/OrganizationService.d.ts +3 -2
  43. package/dist/sdk/services/ProjectAccessService.d.ts +3 -2
  44. package/dist/sdk/services/ProjectAttachmentService.d.ts +4 -3
  45. package/dist/sdk/services/ProjectFileService.d.ts +3 -1
  46. package/dist/sdk/services/ProjectService.d.ts +3 -2
  47. package/dist/sdk/services/TeamService.d.ts +4 -3
  48. package/dist/sdk/services/UserFormService.d.ts +4 -3
  49. package/dist/sdk/services/UserFormSubmissionService.d.ts +4 -3
  50. package/dist/sdk/services/WorkspaceService.d.ts +3 -1
  51. package/dist/sdk/services/index.d.ts +0 -1
  52. package/dist/sdk/typings.d.ts +4 -1
  53. package/dist/store/index.d.ts +0 -1
  54. package/dist/store/slices/agentsSlice.d.ts +4 -4
  55. package/dist/store/slices/assetAttachmentSlice.d.ts +6 -6
  56. package/dist/store/slices/assetSlice.d.ts +8 -8
  57. package/dist/store/slices/assetStageCompletionSlice.d.ts +3 -3
  58. package/dist/store/slices/assetStageSlice.d.ts +9 -9
  59. package/dist/store/slices/assetTypeAttachmentSlice.d.ts +6 -6
  60. package/dist/store/slices/assetTypeSlice.d.ts +7 -7
  61. package/dist/store/slices/authSlice.d.ts +3 -3
  62. package/dist/store/slices/categorySlice.d.ts +8 -50
  63. package/dist/store/slices/documentAttachmentSlice.d.ts +6 -6
  64. package/dist/store/slices/documentSlice.d.ts +6 -48
  65. package/dist/store/slices/emailDomainsSlice.d.ts +4 -4
  66. package/dist/store/slices/fileSlice.d.ts +2 -2
  67. package/dist/store/slices/formRevisionAttachmentSlice.d.ts +3 -3
  68. package/dist/store/slices/formRevisionSlice.d.ts +8 -50
  69. package/dist/store/slices/formSlice.d.ts +8 -8
  70. package/dist/store/slices/formSubmissionAttachmentSlice.d.ts +3 -3
  71. package/dist/store/slices/formSubmissionSlice.d.ts +11 -11
  72. package/dist/store/slices/index.d.ts +0 -1
  73. package/dist/store/slices/issueAttachmentSlice.d.ts +6 -6
  74. package/dist/store/slices/issueCommentSlice.d.ts +3 -3
  75. package/dist/store/slices/issueSlice.d.ts +9 -9
  76. package/dist/store/slices/issueTypeSlice.d.ts +7 -7
  77. package/dist/store/slices/issueUpdateSlice.d.ts +3 -3
  78. package/dist/store/slices/licenseSlice.d.ts +7 -7
  79. package/dist/store/slices/organizationAccessSlice.d.ts +6 -6
  80. package/dist/store/slices/organizationSlice.d.ts +13 -13
  81. package/dist/store/slices/outboxSlice.d.ts +3 -3
  82. package/dist/store/slices/projectAccessSlice.d.ts +7 -7
  83. package/dist/store/slices/projectAttachmentSlice.d.ts +6 -6
  84. package/dist/store/slices/projectFileSlice.d.ts +7 -49
  85. package/dist/store/slices/projectSlice.d.ts +10 -10
  86. package/dist/store/slices/rehydratedSlice.d.ts +3 -2
  87. package/dist/store/slices/settingsSlice.d.ts +3 -24
  88. package/dist/store/slices/teamSlice.d.ts +6 -6
  89. package/dist/store/slices/userSlice.d.ts +5 -5
  90. package/dist/store/slices/workspaceSlice.d.ts +8 -50
  91. package/dist/store/store.d.ts +8 -90
  92. package/dist/style.css +0 -18
  93. package/dist/typings/models/store.d.ts +43 -4
  94. package/dist/typings/store.d.ts +6 -4
  95. package/dist/utils/file.d.ts +0 -6
  96. package/dist/utils/utils.d.ts +3 -3
  97. package/package.json +5 -3
  98. package/dist/contexts/hooks.d.ts +0 -2
  99. package/dist/contexts/index.d.ts +0 -3
  100. package/dist/contexts/overmap.d.ts +0 -12
  101. package/dist/contexts/sdk/globals.d.ts +0 -4
  102. package/dist/contexts/sdk/hooks.d.ts +0 -4
  103. package/dist/contexts/sdk/index.d.ts +0 -2
  104. package/dist/contexts/sdk/sdk.d.ts +0 -15
  105. package/dist/enums/map.d.ts +0 -6
  106. package/dist/forms/renderer/FormBrowser/FormBrowser.d.ts +0 -11
  107. package/dist/forms/renderer/FormSubmissionBrowser/FormSubmissionBrowser.d.ts +0 -28
  108. package/dist/forms/renderer/FormSubmissionViewer/FormSubmissionViewer.d.ts +0 -17
  109. package/dist/sdk/services/MainService.d.ts +0 -16
  110. package/dist/store/hooks.d.ts +0 -4
  111. package/dist/store/slices/mapSlice.d.ts +0 -23
@@ -0,0 +1,22 @@
1
+ import { AuthService, FileService } from "./services";
2
+ import { ToolkitStore } from "@reduxjs/toolkit/dist/configureStore";
3
+ import { SDKRequest } from "./typings";
4
+ import { BaseState } from "../typings";
5
+ export declare class BaseSDK<TState extends BaseState> {
6
+ readonly store: ToolkitStore<TState>;
7
+ constructor(store: ToolkitStore<TState>);
8
+ /**
9
+ * Enqueues an API request to the offline outbox.
10
+ * @param requestDetails An SDKRequest object containing the details of the request.
11
+ * @param host The base URL of the API to send the request to.
12
+ * @protected
13
+ */
14
+ enqueueRequest<TResult>(requestDetails: SDKRequest, host: string): Promise<TResult>;
15
+ /**
16
+ * Enqueues an API request to the Redux Offline outbox
17
+ * @protected
18
+ */
19
+ private _enqueueRequest;
20
+ files: FileService<this>;
21
+ auth: AuthService<this>;
22
+ }
@@ -0,0 +1,7 @@
1
+ import { ToolkitStore } from "@reduxjs/toolkit/dist/configureStore";
2
+ import { BaseState } from "../typings";
3
+ import { BaseSDK } from "./base";
4
+ export declare function setClientStore<TState extends BaseState>(store: ToolkitStore<TState>): void;
5
+ export declare function getClientStore(): ToolkitStore<BaseState> | undefined;
6
+ export declare function setClientSDK<TState extends BaseState>(sdkCtor: BaseSDK<TState>): void;
7
+ export declare function getClientSDK(): BaseSDK<BaseState> | undefined;
@@ -1,5 +1,6 @@
1
1
  export * from "./classes";
2
2
  export * from "./errors";
3
+ export * from "./base";
3
4
  export * from "./sdk";
4
5
  export * from "./services";
5
6
  export * from "./typings";
package/dist/sdk/sdk.d.ts CHANGED
@@ -1,52 +1,4 @@
1
- import { AgentService, AuthService, CategoryService, AssetService, AssetStageCompletionService, AssetStageService, AssetAttachmentService, AssetTypeService, AssetTypeAttachmentService, DocumentAttachmentService, DocumentService, EmailDomainsService, EmailVerificationService, FileService, IssueAttachmentService, IssueCommentService, IssueService, IssueTypeService, IssueUpdateService, LicenseService, MainService, OrganizationAccessService, OrganizationService, ProjectAccessService, ProjectAttachmentService, ProjectFileService, ProjectService, TeamService, UserFormService, UserFormSubmissionService, WorkspaceService } from "./services";
1
+ import { OvermapSDKConstructor } from "./index";
2
2
  import { ToolkitStore } from "@reduxjs/toolkit/dist/configureStore";
3
- import { RootState } from "../typings";
4
- import { SDKRequest } from "./typings";
5
- export declare class OvermapSDK {
6
- readonly API_URL: string;
7
- readonly store: ToolkitStore<RootState>;
8
- constructor(apiUrl: string, store: ToolkitStore<RootState>);
9
- /**
10
- * Enqueues an API request to the offline outbox.
11
- * @param requestDetails An SDKRequest object containing the details of the request.
12
- * @protected
13
- */
14
- enqueueRequest<TResult>(requestDetails: SDKRequest): Promise<TResult>;
15
- /**
16
- * Enqueues an API request to the Redux Offline outbox
17
- * @protected
18
- */
19
- private _enqueueRequest;
20
- agent: AgentService;
21
- files: FileService;
22
- auth: AuthService;
23
- categories: CategoryService;
24
- projectAccesses: ProjectAccessService;
25
- organizations: OrganizationService;
26
- organizationAccess: OrganizationAccessService;
27
- issues: IssueService;
28
- issueTypes: IssueTypeService;
29
- issueComments: IssueCommentService;
30
- issueUpdates: IssueUpdateService;
31
- issueAttachments: IssueAttachmentService;
32
- workspaces: WorkspaceService;
33
- main: MainService;
34
- assets: AssetService;
35
- assetAttachments: AssetAttachmentService;
36
- assetTypes: AssetTypeService;
37
- assetTypeAttachments: AssetTypeAttachmentService;
38
- assetStages: AssetStageService;
39
- assetStageCompletions: AssetStageCompletionService;
40
- userForms: UserFormService;
41
- userFormSubmissions: UserFormSubmissionService;
42
- projects: ProjectService;
43
- projectFiles: ProjectFileService;
44
- projectAttachments: ProjectAttachmentService;
45
- emailVerification: EmailVerificationService;
46
- emailDomains: EmailDomainsService;
47
- licenses: LicenseService;
48
- documents: DocumentService;
49
- teams: TeamService;
50
- documentAttachments: DocumentAttachmentService;
51
- }
52
- export declare const makeClient: (apiUrl: string, store: ToolkitStore<RootState>) => OvermapSDK;
3
+ import { BaseState } from "../typings";
4
+ export declare const initSDK: <TState extends BaseState>(store: ToolkitStore<TState>, sdk: OvermapSDKConstructor<TState>) => import('./base').BaseSDK<TState>;
@@ -1,6 +1,7 @@
1
+ import { AgentUserConversation, OvermapRootState } from "../../typings";
1
2
  import { BaseApiService } from "./BaseApiService";
2
- import { AgentUserConversation } from "../../typings";
3
- export declare class AgentService extends BaseApiService {
3
+ import type { BaseSDK } from "../base";
4
+ export declare abstract class AgentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
4
5
  startConversation(prompt: string): Promise<AgentUserConversation>;
5
6
  /**
6
7
  * Prompt the agent with a message.
@@ -1,7 +1,8 @@
1
1
  import { BaseAttachmentService } from "./BaseAttachmentService";
2
- import { AttachmentModel, AssetAttachment, Stored } from "../../typings";
2
+ import { AttachmentModel, AssetAttachment, Stored, OvermapRootState } from "../../typings";
3
3
  import { OptimisticMultipleModelResult } from "../typings";
4
- export declare class AssetAttachmentService extends BaseAttachmentService<string, AssetAttachment> {
4
+ import type { BaseSDK } from "../base";
5
+ export declare abstract class AssetAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseAttachmentService<TState, TSDK, string, AssetAttachment> {
5
6
  attachmentModel: AttachmentModel;
6
7
  initializeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<AssetAttachment>[], "assetAttachments/initializeAssetAttachments">;
7
8
  addAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<AssetAttachment>[], "assetAttachments/addAssetAttachments">;
@@ -9,7 +10,7 @@ export declare class AssetAttachmentService extends BaseAttachmentService<string
9
10
  removeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "assetAttachments/deleteAssetAttachments">;
10
11
  removeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "assetAttachments/deleteAssetAttachment">;
11
12
  setAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<AssetAttachment>, "assetAttachments/setAssetAttachment">;
12
- selectAttachment: import('../../typings/store').SelectorWithArgs<string, Stored<AssetAttachment>>;
13
+ selectAttachment: import('../../typings/store').OvermapSelectorWithArgs<string, Stored<AssetAttachment>>;
13
14
  private buildOfflineAttachment;
14
15
  attachFilesToAsset(files: File[], assetId: string): Promise<OptimisticMultipleModelResult<AssetAttachment>>;
15
16
  deleteAssetAttachment(attachmentId: string): Promise<void>;
@@ -1,7 +1,8 @@
1
- import { BaseApiService } from "./BaseApiService";
2
- import { Asset, Created, Payload } from "../../typings";
1
+ import { Asset, Created, Payload, OvermapRootState } from "../../typings";
3
2
  import { OptimisticModelResult } from "../typings";
4
- export declare class AssetService extends BaseApiService {
3
+ import { BaseApiService } from "./BaseApiService";
4
+ import type { BaseSDK } from "../base";
5
+ export declare abstract class AssetService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
5
6
  add(asset: Payload<Asset>, workspaceId: string): OptimisticModelResult<Asset>;
6
7
  update(asset: Asset, workspaceId: string): OptimisticModelResult<Asset>;
7
8
  remove(assetId: string): Promise<undefined>;
@@ -1,7 +1,8 @@
1
- import { BaseApiService } from "./BaseApiService";
2
1
  import { OptimisticModelResult } from "../typings";
3
- import { AssetStageCompletion, Payload } from "../../typings";
4
- export declare class AssetStageCompletionService extends BaseApiService {
2
+ import { AssetStageCompletion, OvermapRootState, Payload } from "../../typings";
3
+ import { BaseApiService } from "./BaseApiService";
4
+ import type { BaseSDK } from "../base";
5
+ export declare abstract class AssetStageCompletionService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
5
6
  add(assetId: string, stageId: string): OptimisticModelResult<AssetStageCompletion>;
6
7
  refreshStore(): Promise<void>;
7
8
  /**
@@ -1,6 +1,7 @@
1
+ import { AssetStage, AssetStagePayload, OvermapRootState, Payload } from "../../typings";
1
2
  import { BaseApiService } from "./BaseApiService";
2
- import { AssetStage, AssetStagePayload, Payload } from "../../typings";
3
- export declare class AssetStageService extends BaseApiService {
3
+ import type { BaseSDK } from "../base";
4
+ export declare abstract class AssetStageService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
4
5
  bulkCreateStages(stagesToSubmit: Payload<AssetStagePayload>[], assetTypeId: string, workspaceId: string): Promise<AssetStage[]>;
5
6
  bulkUpdateStages(stagesToUpdate: AssetStage[], assetTypeId: string): Promise<AssetStage[]>;
6
7
  bulkDelete(idsToDelete: string[]): Promise<undefined>;
@@ -1,7 +1,8 @@
1
1
  import { BaseAttachmentService } from "./BaseAttachmentService";
2
- import { AttachmentModel, AssetTypeAttachment, Stored } from "../../typings";
2
+ import { AttachmentModel, AssetTypeAttachment, Stored, OvermapRootState } from "../../typings";
3
3
  import { OptimisticMultipleModelResult } from "../typings";
4
- export declare class AssetTypeAttachmentService extends BaseAttachmentService<string, AssetTypeAttachment> {
4
+ import type { BaseSDK } from "../base";
5
+ export declare abstract class AssetTypeAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseAttachmentService<TState, TSDK, string, AssetTypeAttachment> {
5
6
  attachmentModel: AttachmentModel;
6
7
  initializeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<AssetTypeAttachment>[], "assetTypeAttachments/initializeAssetTypeAttachments">;
7
8
  addAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<AssetTypeAttachment>[], "assetTypeAttachments/addAssetTypeAttachments">;
@@ -9,7 +10,7 @@ export declare class AssetTypeAttachmentService extends BaseAttachmentService<st
9
10
  removeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "assetTypeAttachments/deleteAssetTypeAttachments">;
10
11
  removeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "assetTypeAttachments/deleteAssetTypeAttachment">;
11
12
  setAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<AssetTypeAttachment>, "assetTypeAttachments/setAssetTypeAttachment">;
12
- selectAttachment: import('../../typings/store').SelectorWithArgs<string, Stored<AssetTypeAttachment>>;
13
+ selectAttachment: import('../../typings/store').OvermapSelectorWithArgs<string, Stored<AssetTypeAttachment>>;
13
14
  private buildOfflineAttachment;
14
15
  attachFilesToAssetType(files: File[], assetTypeId: string): Promise<OptimisticMultipleModelResult<AssetTypeAttachment>>;
15
16
  deleteAssetTypeAttachment(attachmentId: string): Promise<void>;
@@ -1,7 +1,8 @@
1
- import { BaseApiService } from "./BaseApiService";
2
- import { AssetType, Payload } from "../../typings";
1
+ import { AssetType, OvermapRootState, Payload } from "../../typings";
3
2
  import { OptimisticModelResult } from "../typings";
4
- export declare class AssetTypeService extends BaseApiService {
3
+ import { BaseApiService } from "./BaseApiService";
4
+ import type { BaseSDK } from "../base";
5
+ export declare abstract class AssetTypeService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
5
6
  add(assetType: Payload<AssetType>): OptimisticModelResult<AssetType>;
6
7
  update(assetType: AssetType): Promise<undefined>;
7
8
  delete(assetTypeId: string): Promise<undefined>;
@@ -1,9 +1,11 @@
1
1
  import { BaseApiService } from "./BaseApiService";
2
- import { RegistrationPayload, RegistrationReturn } from "../../typings";
2
+ import { BaseState, RegistrationPayload, RegistrationReturn } from "../../typings";
3
+ import type { BaseSDK } from "../base";
3
4
  /**
4
5
  * Handles login, logout and renewing tokens
5
6
  */
6
- export declare class AuthService extends BaseApiService {
7
+ export declare class AuthService<TSDK extends BaseSDK<BaseState>> extends BaseApiService<BaseState, TSDK> {
8
+ host: string;
7
9
  private _getAccessToken;
8
10
  private _getRefreshToken;
9
11
  /**
@@ -49,6 +51,5 @@ export declare class AuthService extends BaseApiService {
49
51
  replaceProfilePicture(file: File): Promise<undefined>;
50
52
  addFavouriteProjectId(projectId: number): Promise<undefined>;
51
53
  removeFavouriteProjectId(projectId: number): Promise<undefined>;
52
- setTourStep(stepIndex: number): Promise<undefined>;
53
54
  joinApplication(projectInviteId: string, verification_code: string, username: string, password: string): Promise<undefined>;
54
55
  }
@@ -1,8 +1,19 @@
1
- import type { OvermapSDK } from "../sdk";
1
+ import { AnyAction } from "@reduxjs/toolkit";
2
+ import type { BaseSDK } from "../base";
3
+ import { BaseState } from "../../typings";
4
+ import { SDKRequest } from "../typings";
2
5
  /**
3
6
  * Abstract base class for building a service that can enqueue API requests
4
7
  */
5
- export declare abstract class BaseApiService {
6
- protected readonly client: OvermapSDK;
7
- constructor(sdk: OvermapSDK);
8
+ export declare abstract class BaseApiService<TStore extends BaseState, TSDK extends BaseSDK<TStore>> {
9
+ protected readonly client: TSDK;
10
+ abstract readonly host: string;
11
+ constructor(sdk: TSDK);
12
+ /**
13
+ * Enqueues an API request to the offline outbox.
14
+ * @param requestDetails An SDKRequest object containing the details of the request.
15
+ * @protected
16
+ */
17
+ protected enqueueRequest<TResult>(requestDetails: SDKRequest): Promise<TResult>;
18
+ protected dispatch(action: AnyAction): void;
8
19
  }
@@ -1,7 +1,8 @@
1
1
  import { ActionCreatorWithPayload } from "@reduxjs/toolkit";
2
- import { BaseApiService } from "./BaseApiService";
3
2
  import { OptimisticMultipleModelResult } from "../typings";
4
- import { Attachment, AttachmentModel, SelectorWithArgs, Stored, Submitted } from "../../typings";
3
+ import { Attachment, AttachmentModel, OvermapRootState, OvermapSelectorWithArgs, Stored, Submitted } from "../../typings";
4
+ import { BaseApiService } from "./BaseApiService";
5
+ import type { BaseSDK } from "../base";
5
6
  export interface BuildOfflineAttachmentData<TModelId> {
6
7
  file: File;
7
8
  sha1: string;
@@ -10,7 +11,7 @@ export interface BuildOfflineAttachmentData<TModelId> {
10
11
  description?: string;
11
12
  modelId: TModelId;
12
13
  }
13
- export declare abstract class BaseAttachmentService<TModelId extends string | number, TAttachment extends Attachment> extends BaseApiService {
14
+ export declare abstract class BaseAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>, TModelId extends string | number, TAttachment extends Attachment> extends BaseApiService<TState, TSDK> {
14
15
  abstract readonly attachmentModel: AttachmentModel;
15
16
  abstract readonly initializeAttachments: ActionCreatorWithPayload<Submitted<TAttachment>[]>;
16
17
  abstract readonly addAttachments: ActionCreatorWithPayload<Submitted<TAttachment>[]>;
@@ -18,7 +19,7 @@ export declare abstract class BaseAttachmentService<TModelId extends string | nu
18
19
  abstract readonly removeAttachments: ActionCreatorWithPayload<string[]>;
19
20
  abstract readonly setAttachment: ActionCreatorWithPayload<Stored<TAttachment>>;
20
21
  abstract readonly removeAttachment: ActionCreatorWithPayload<string>;
21
- abstract readonly selectAttachment: SelectorWithArgs<string, Stored<TAttachment>>;
22
+ abstract readonly selectAttachment: OvermapSelectorWithArgs<string, Stored<TAttachment>>;
22
23
  private getNumberOfAttachmentsWithSha1;
23
24
  private processPresignedUrls;
24
25
  protected attachFiles(files: File[], modelId: TModelId, buildOfflineAttachment: (data: BuildOfflineAttachmentData<TModelId>) => Stored<TAttachment>): Promise<OptimisticMultipleModelResult<TAttachment>>;
@@ -1,11 +1,12 @@
1
- import { BaseApiService } from "./BaseApiService";
2
- import { Category, Offline, Payload } from "../../typings";
1
+ import { Category, Offline, OvermapRootState, Payload } from "../../typings";
3
2
  import { OptimisticModelResult } from "../typings";
3
+ import { BaseApiService } from "./BaseApiService";
4
+ import type { BaseSDK } from "../base";
4
5
  /**
5
6
  * Handles the creation of Category Service
6
7
  * TODO: Support editing and deleting categories
7
8
  */
8
- export declare class CategoryService extends BaseApiService {
9
+ export declare abstract class CategoryService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
9
10
  add(category: Omit<Payload<Category>, "workspace">, workspaceId: string): OptimisticModelResult<Category>;
10
11
  update(category: Offline<Partial<Category>>, workspaceId: string): OptimisticModelResult<Category>;
11
12
  remove(category: Category, workspaceId: string): Promise<undefined>;
@@ -1,7 +1,8 @@
1
1
  import { BaseAttachmentService } from "./BaseAttachmentService";
2
- import { AttachmentModel, DocumentAttachment, Stored } from "../../typings";
2
+ import { AttachmentModel, DocumentAttachment, OvermapRootState, Stored } from "../../typings";
3
3
  import { OptimisticMultipleModelResult } from "../typings";
4
- export declare class DocumentAttachmentService extends BaseAttachmentService<string, DocumentAttachment> {
4
+ import type { BaseSDK } from "../base";
5
+ export declare abstract class DocumentAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseAttachmentService<TState, TSDK, string, DocumentAttachment> {
5
6
  attachmentModel: AttachmentModel;
6
7
  initializeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<DocumentAttachment>[], "documentAttachments/initializeDocumentAttachments">;
7
8
  addAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<DocumentAttachment>[], "documentAttachments/addDocumentAttachments">;
@@ -9,7 +10,7 @@ export declare class DocumentAttachmentService extends BaseAttachmentService<str
9
10
  removeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "documentAttachments/deleteDocumentAttachments">;
10
11
  removeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "documentAttachments/deleteDocumentAttachment">;
11
12
  setAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<DocumentAttachment>, "documentAttachments/setDocumentAttachment">;
12
- selectAttachment: import('../../typings/store').SelectorWithArgs<string, Stored<DocumentAttachment>>;
13
+ selectAttachment: import('../../typings/store').OvermapSelectorWithArgs<string, Stored<DocumentAttachment>>;
13
14
  private buildOfflineAttachment;
14
15
  attachFilesToDocument(files: File[], documentId: string): Promise<OptimisticMultipleModelResult<DocumentAttachment>>;
15
16
  deleteDocumentAttachment(attachmentId: string): Promise<void>;
@@ -1,7 +1,8 @@
1
- import { BaseApiService } from "./BaseApiService";
2
- import { Document, DocumentPayload, MovePosition, Submitted } from "../../typings";
1
+ import { Document, DocumentPayload, MovePosition, OvermapRootState, Submitted } from "../../typings";
3
2
  import { OptimisticModelResult } from "../typings";
4
- export declare class DocumentService extends BaseApiService {
3
+ import { BaseApiService } from "./BaseApiService";
4
+ import type { BaseSDK } from "../base";
5
+ export declare abstract class DocumentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
5
6
  add(document: DocumentPayload): OptimisticModelResult<Document>;
6
7
  update(document: Submitted<Partial<Document>>): OptimisticModelResult<Document>;
7
8
  move(documentId: string, targetDocumentId: string | null, position: MovePosition): Promise<Document[]>;
@@ -1,6 +1,7 @@
1
+ import { EmailDomain, OvermapRootState } from "../../typings";
1
2
  import { BaseApiService } from "./BaseApiService";
2
- import { EmailDomain } from "../../typings";
3
- export declare class EmailDomainsService extends BaseApiService {
3
+ import type { BaseSDK } from "../base";
4
+ export declare abstract class EmailDomainsService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
4
5
  add(orgId: number, email: string): Promise<undefined>;
5
6
  remove(emailDomain: EmailDomain): Promise<undefined>;
6
7
  refreshStore(): Promise<undefined>;
@@ -1,6 +1,6 @@
1
- import { BaseApiService } from "./BaseApiService";
2
- import { EmailVerificationPayload, EmailVerificationReturn, VerificationCode } from "../../typings";
3
- export declare class EmailVerificationService extends BaseApiService {
1
+ import { BaseApiService, type BaseSDK } from "../../sdk";
2
+ import { EmailVerificationPayload, EmailVerificationReturn, OvermapRootState, VerificationCode } from "../../typings";
3
+ export declare abstract class EmailVerificationService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
4
4
  getVerificationCode(verificationCode: string): Promise<VerificationCode>;
5
5
  validateVerificationCode(verificationCode: string, payload?: EmailVerificationPayload | undefined): Promise<EmailVerificationReturn>;
6
6
  }
@@ -1,4 +1,6 @@
1
1
  import { BaseApiService } from "./BaseApiService";
2
+ import type { BaseSDK } from "../base";
3
+ import { BaseState } from "../../typings";
2
4
  export interface GetS3UrlSuccessResponse {
3
5
  url: string;
4
6
  fields: Record<string, string>;
@@ -15,7 +17,8 @@ interface DatabaseFileProperties {
15
17
  */
16
18
  file: string;
17
19
  }
18
- export declare class FileService extends BaseApiService {
20
+ export declare class FileService<TSDK extends BaseSDK<BaseState>> extends BaseApiService<BaseState, TSDK> {
21
+ host: string;
19
22
  private _dbPromise;
20
23
  private renewUploadUrl;
21
24
  /**
@@ -1,7 +1,8 @@
1
1
  import { BaseAttachmentService } from "./BaseAttachmentService";
2
2
  import { OptimisticMultipleModelResult } from "../typings";
3
- import { AttachmentModel, IssueAttachment, Stored } from "../../typings";
4
- export declare class IssueAttachmentService extends BaseAttachmentService<string, IssueAttachment> {
3
+ import { AttachmentModel, IssueAttachment, OvermapRootState, Stored } from "../../typings";
4
+ import type { BaseSDK } from "../base";
5
+ export declare abstract class IssueAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseAttachmentService<TState, TSDK, string, IssueAttachment> {
5
6
  attachmentModel: AttachmentModel;
6
7
  initializeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueAttachment>[], "issueAttachments/initializeIssueAttachments">;
7
8
  addAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueAttachment>[], "issueAttachments/addIssueAttachments">;
@@ -9,7 +10,7 @@ export declare class IssueAttachmentService extends BaseAttachmentService<string
9
10
  removeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "issueAttachments/deleteIssueAttachments">;
10
11
  removeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issueAttachments/deleteIssueAttachment">;
11
12
  setAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueAttachment>, "issueAttachments/setIssueAttachment">;
12
- selectAttachment: import('../../typings/store').SelectorWithArgs<string, Stored<IssueAttachment>>;
13
+ selectAttachment: import('../../typings/store').OvermapSelectorWithArgs<string, Stored<IssueAttachment>>;
13
14
  private buildOfflineAttachment;
14
15
  attachFilesToIssue(files: File[], issueId: string): Promise<OptimisticMultipleModelResult<IssueAttachment>>;
15
16
  deleteIssueAttachment(attachmentId: string): Promise<void>;
@@ -1,7 +1,8 @@
1
- import { BaseApiService } from "./BaseApiService";
2
- import { IssueComment, Payload, Submitted } from "../../typings";
1
+ import { IssueComment, OvermapRootState, Payload, Submitted } from "../../typings";
3
2
  import { OptimisticModelResult } from "../typings";
4
- export declare class IssueCommentService extends BaseApiService {
3
+ import { BaseApiService } from "./BaseApiService";
4
+ import type { BaseSDK } from "../base";
5
+ export declare abstract class IssueCommentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
5
6
  add(comment: Omit<Payload<IssueComment>, "author" | "submitted_at">): OptimisticModelResult<IssueComment>;
6
7
  update(comment: Submitted<IssueComment>): OptimisticModelResult<IssueComment>;
7
8
  remove(offline_id: string): Promise<undefined>;
@@ -1,10 +1,11 @@
1
- import { BaseApiService } from "./BaseApiService";
2
1
  import { OptimisticModelResult } from "../typings";
3
- import { Issue, IssueType, Submitted } from "../../typings";
2
+ import { Issue, IssueType, OvermapRootState, Submitted } from "../../typings";
3
+ import { BaseApiService } from "./BaseApiService";
4
+ import type { BaseSDK } from "../base";
4
5
  /**
5
6
  * Handles CRUD operations on issues
6
7
  */
7
- export declare class IssueService extends BaseApiService {
8
+ export declare abstract class IssueService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
8
9
  add(issue: Issue, issueType?: IssueType["offline_id"] | null): OptimisticModelResult<Issue>;
9
10
  update(issue: Submitted<Partial<Issue>>): OptimisticModelResult<Issue>;
10
11
  remove(id: string): Promise<undefined>;
@@ -1,7 +1,8 @@
1
- import { BaseApiService } from "./BaseApiService";
2
1
  import { OptimisticModelResult } from "../typings";
3
- import { IssueType, IssueTypePayload, Offline } from "../../typings";
4
- export declare class IssueTypeService extends BaseApiService {
2
+ import { IssueType, IssueTypePayload, Offline, OvermapRootState } from "../../typings";
3
+ import { BaseApiService } from "./BaseApiService";
4
+ import type { BaseSDK } from "../base";
5
+ export declare abstract class IssueTypeService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
5
6
  add(payload: IssueTypePayload): OptimisticModelResult<IssueType>;
6
7
  update(issueTypeFields: Offline<Partial<IssueType>>): OptimisticModelResult<IssueType>;
7
8
  delete(issueTypeId: string): Promise<void>;
@@ -1,4 +1,6 @@
1
+ import { OvermapRootState } from "../../typings";
1
2
  import { BaseApiService } from "./BaseApiService";
2
- export declare class IssueUpdateService extends BaseApiService {
3
+ import type { BaseSDK } from "../base";
4
+ export declare abstract class IssueUpdateService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
3
5
  refreshStore(): Promise<void>;
4
6
  }
@@ -1,6 +1,7 @@
1
+ import { License, OvermapRootState, Project, Transaction } from "../../typings";
1
2
  import { BaseApiService } from "./BaseApiService";
2
- import { License, Project, Transaction } from "../../typings";
3
- export declare class LicenseService extends BaseApiService {
3
+ import type { BaseSDK } from "../base";
4
+ export declare abstract class LicenseService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
4
5
  fetchLicensesForOrganization(organizationId: number, showLoading?: boolean): Promise<License[]>;
5
6
  getLicense(license: License): Promise<License>;
6
7
  pauseLicense(license: License): Promise<License>;
@@ -1,9 +1,10 @@
1
+ import { OrganizationAccess, OvermapRootState } from "../../typings";
1
2
  import { BaseApiService } from "./BaseApiService";
2
- import { OrganizationAccess } from "../../typings";
3
+ import type { BaseSDK } from "../base";
3
4
  /**
4
5
  * Handles the creation of OrganizationAccess Service
5
6
  */
6
- export declare class OrganizationAccessService extends BaseApiService {
7
+ export declare abstract class OrganizationAccessService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
7
8
  update(organizationAccess: OrganizationAccess): Promise<OrganizationAccess>;
8
9
  remove(organizationAccess: OrganizationAccess): Promise<undefined>;
9
10
  refreshStore(): Promise<void>;
@@ -1,6 +1,7 @@
1
- import { InitialOrganizationData, Organization } from "../../typings";
1
+ import { InitialOrganizationData, Organization, OvermapRootState } from "../../typings";
2
2
  import { BaseApiService } from "./BaseApiService";
3
- export declare class OrganizationService extends BaseApiService {
3
+ import type { BaseSDK } from "../base";
4
+ export declare abstract class OrganizationService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
4
5
  fetchInitialOrganizationData(organizationId: number, showLoading: boolean): Promise<InitialOrganizationData>;
5
6
  _processInitialOrganizationData(data: InitialOrganizationData, showLoading: boolean): void;
6
7
  create(name: string): Promise<Organization>;
@@ -1,9 +1,10 @@
1
+ import { OvermapRootState, ProjectAccess } from "../../typings";
1
2
  import { BaseApiService } from "./BaseApiService";
2
- import { ProjectAccess } from "../../typings";
3
+ import type { BaseSDK } from "../base";
3
4
  /**
4
5
  * Handles the creation of ProjectAccess Service
5
6
  */
6
- export declare class ProjectAccessService extends BaseApiService {
7
+ export declare abstract class ProjectAccessService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
7
8
  fetchAll(projectId: number): Promise<ProjectAccess[]>;
8
9
  update(projectAccess: ProjectAccess): Promise<ProjectAccess>;
9
10
  remove(projectAccess: ProjectAccess): Promise<undefined>;
@@ -1,7 +1,8 @@
1
1
  import { BaseAttachmentService } from "./BaseAttachmentService";
2
- import { AttachmentModel, ProjectAttachment, Stored } from "../../typings";
2
+ import { AttachmentModel, OvermapRootState, ProjectAttachment, Stored } from "../../typings";
3
3
  import { OptimisticMultipleModelResult } from "../typings";
4
- export declare class ProjectAttachmentService extends BaseAttachmentService<number, ProjectAttachment> {
4
+ import type { BaseSDK } from "../base";
5
+ export declare abstract class ProjectAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseAttachmentService<TState, TSDK, number, ProjectAttachment> {
5
6
  attachmentModel: AttachmentModel;
6
7
  initializeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<ProjectAttachment>[], "projectAttachments/initializeProjectAttachments">;
7
8
  addAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<ProjectAttachment>[], "projectAttachments/addProjectAttachments">;
@@ -9,7 +10,7 @@ export declare class ProjectAttachmentService extends BaseAttachmentService<numb
9
10
  removeAttachments: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "projectAttachments/deleteProjectAttachments">;
10
11
  removeAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "projectAttachments/deleteProjectAttachment">;
11
12
  setAttachment: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<ProjectAttachment>, "projectAttachments/setProjectAttachment">;
12
- selectAttachment: import('../../typings/store').SelectorWithArgs<string, ProjectAttachment>;
13
+ selectAttachment: import('../../typings/store').OvermapSelectorWithArgs<string, ProjectAttachment>;
13
14
  private buildOfflineAttachment;
14
15
  attachFilesToProject(files: File[], projectId: number): Promise<OptimisticMultipleModelResult<ProjectAttachment>>;
15
16
  deleteProjectAttachment(attachmentId: string): Promise<void>;
@@ -1,10 +1,12 @@
1
1
  import { ProjectFile } from '../../typings/models/projects';
2
2
  import { OptimisticGenericResult } from "../typings";
3
+ import { OvermapRootState } from "../../typings";
3
4
  import { BaseApiService } from "./BaseApiService";
5
+ import type { BaseSDK } from "../base";
4
6
  /**
5
7
  * Handles creation and caching of ProjectFiles
6
8
  */
7
- export declare class ProjectFileService extends BaseApiService {
9
+ export declare abstract class ProjectFileService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
8
10
  refreshStore(): Promise<void>;
9
11
  saveExisting(file: ProjectFile): Promise<ProjectFile>;
10
12
  saveActive(): OptimisticGenericResult<ProjectFile>;
@@ -1,10 +1,11 @@
1
1
  import { Project } from '../../typings/models/projects';
2
+ import { OvermapRootState, Payload } from "../../typings";
2
3
  import { BaseApiService } from "./BaseApiService";
3
- import { Payload } from "../../typings";
4
+ import type { BaseSDK } from "../base";
4
5
  interface JoinProjectResponse {
5
6
  username: string;
6
7
  }
7
- export declare class ProjectService extends BaseApiService {
8
+ export declare abstract class ProjectService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
8
9
  /**
9
10
  * Creates a new project. Due to the nature of project creation,
10
11
  * @param project A Payload<Project> object containing project attributes.
@@ -1,7 +1,8 @@
1
- import { BaseApiService } from "./BaseApiService";
2
- import { Stored, Team, TeamPayload, User } from "../../typings";
1
+ import { OvermapRootState, Stored, Team, TeamPayload, User } from "../../typings";
3
2
  import { OptimisticModelResult } from "../typings";
4
- export declare class TeamService extends BaseApiService {
3
+ import { BaseApiService } from "./BaseApiService";
4
+ import type { BaseSDK } from "../base";
5
+ export declare abstract class TeamService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
5
6
  add(teamPayload: TeamPayload): OptimisticModelResult<Team>;
6
7
  update(team: Stored<Team>): OptimisticModelResult<Team>;
7
8
  delete(teamId: string): Promise<undefined>;
@@ -1,9 +1,10 @@
1
1
  import { UserForm, UserFormRevision, UserFormRevisionPayload } from '../../typings/models/forms';
2
2
  import { OptimisticModelResult } from "../typings";
3
- import { BaseApiService } from "./BaseApiService";
4
- import { Created, Submitted } from "../../typings";
3
+ import { Created, Submitted, OvermapRootState } from "../../typings";
5
4
  import { ISerializedField } from "../../forms";
6
- export declare class UserFormService extends BaseApiService {
5
+ import { BaseApiService } from "./BaseApiService";
6
+ import type { BaseSDK } from "../base";
7
+ export declare abstract class UserFormService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
7
8
  private getAttachImagePromises;
8
9
  private add;
9
10
  addForOrganization(organizationId: number, initialRevision: UserFormRevisionPayload): Promise<[Submitted<UserForm>, Submitted<UserFormRevision<ISerializedField>>, Promise<Created<UserFormRevision<ISerializedField>>>, Promise<Created<UserFormRevision<ISerializedField>>>]>;
@@ -1,16 +1,17 @@
1
1
  import { Offline } from '../../typings/models/base';
2
- import { BaseApiService } from "./BaseApiService";
3
2
  import { UserFormSubmission, UserFormSubmissionAttachment, UserFormSubmissionPayload } from '../../typings/models/forms';
4
3
  import { OptimisticModelResult } from "../typings";
5
4
  import { FieldValue } from '../../forms';
6
- import { Created, Stored } from "../../typings";
5
+ import { Created, OvermapRootState, Stored } from "../../typings";
7
6
  import { GetS3UrlSuccessResponse } from "./FileService";
7
+ import { BaseApiService } from "./BaseApiService";
8
+ import type { BaseSDK } from "../base";
8
9
  interface BulkAddRequestReturnValue {
9
10
  submissions: Created<UserFormSubmission>[];
10
11
  attachments: Created<UserFormSubmissionAttachment>[];
11
12
  presigned_urls: Record<string, GetS3UrlSuccessResponse>;
12
13
  }
13
- export declare class UserFormSubmissionService extends BaseApiService {
14
+ export declare abstract class UserFormSubmissionService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
14
15
  private getAttachFilesPromises;
15
16
  add(payload: Offline<UserFormSubmissionPayload>): OptimisticModelResult<UserFormSubmission>;
16
17
  bulkAdd(args: {