@overmap-ai/core 1.0.60-model-adapter.1 → 1.0.60-move-active-states.0

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 (222) hide show
  1. package/dist/enums/index.d.ts +0 -1
  2. package/dist/index.d.ts +0 -5
  3. package/dist/overmap-core.js +1398 -10611
  4. package/dist/overmap-core.js.map +1 -1
  5. package/dist/overmap-core.umd.cjs +1419 -10634
  6. package/dist/overmap-core.umd.cjs.map +1 -1
  7. package/dist/sdk/base.d.ts +11 -0
  8. package/dist/sdk/globals.d.ts +7 -0
  9. package/dist/sdk/index.d.ts +1 -0
  10. package/dist/sdk/sdk.d.ts +4 -51
  11. package/dist/sdk/services/AgentService.d.ts +4 -3
  12. package/dist/sdk/services/AssetAttachmentService.d.ts +4 -3
  13. package/dist/sdk/services/AssetService.d.ts +5 -4
  14. package/dist/sdk/services/AssetStageCompletionService.d.ts +5 -4
  15. package/dist/sdk/services/AssetStageService.d.ts +4 -3
  16. package/dist/sdk/services/AssetTypeAttachmentService.d.ts +4 -3
  17. package/dist/sdk/services/AssetTypeService.d.ts +5 -4
  18. package/dist/sdk/services/BaseApiService.d.ts +7 -4
  19. package/dist/sdk/services/BaseAttachmentService.d.ts +12 -7
  20. package/dist/sdk/services/BaseAuthService.d.ts +12 -0
  21. package/dist/sdk/services/BaseService.d.ts +15 -0
  22. package/dist/sdk/services/BaseUploadService.d.ts +8 -0
  23. package/dist/sdk/services/CategoryService.d.ts +5 -4
  24. package/dist/sdk/services/DocumentAttachmentService.d.ts +4 -3
  25. package/dist/sdk/services/DocumentService.d.ts +5 -4
  26. package/dist/sdk/services/EmailDomainsService.d.ts +4 -3
  27. package/dist/sdk/services/EmailVerificationService.d.ts +3 -2
  28. package/dist/sdk/services/FileService.d.ts +4 -1
  29. package/dist/sdk/services/GeoImageService.d.ts +11 -0
  30. package/dist/sdk/services/IssueAttachmentService.d.ts +4 -3
  31. package/dist/sdk/services/IssueCommentService.d.ts +5 -4
  32. package/dist/sdk/services/IssueService.d.ts +6 -5
  33. package/dist/sdk/services/IssueTypeService.d.ts +6 -5
  34. package/dist/sdk/services/IssueUpdateService.d.ts +4 -2
  35. package/dist/sdk/services/JWTAuthService.d.ts +36 -0
  36. package/dist/sdk/services/LicenseService.d.ts +4 -3
  37. package/dist/sdk/services/OrganizationAccessService.d.ts +4 -3
  38. package/dist/sdk/services/OrganizationService.d.ts +4 -4
  39. package/dist/sdk/services/ProjectAccessService.d.ts +4 -3
  40. package/dist/sdk/services/ProjectAttachmentService.d.ts +4 -3
  41. package/dist/sdk/services/ProjectFileService.d.ts +4 -2
  42. package/dist/sdk/services/ProjectService.d.ts +3 -2
  43. package/dist/sdk/services/TeamService.d.ts +6 -5
  44. package/dist/sdk/services/UserFormService.d.ts +5 -5
  45. package/dist/sdk/services/UserFormSubmissionService.d.ts +8 -9
  46. package/dist/sdk/services/UserService.d.ts +6 -0
  47. package/dist/sdk/services/WorkspaceService.d.ts +4 -1
  48. package/dist/sdk/services/index.d.ts +3 -2
  49. package/dist/sdk/typings.d.ts +8 -3
  50. package/dist/store/index.d.ts +0 -1
  51. package/dist/store/slices/agentsSlice.d.ts +4 -4
  52. package/dist/store/slices/assetAttachmentSlice.d.ts +6 -6
  53. package/dist/store/slices/assetSlice.d.ts +8 -8
  54. package/dist/store/slices/assetStageCompletionSlice.d.ts +3 -3
  55. package/dist/store/slices/assetStageSlice.d.ts +9 -9
  56. package/dist/store/slices/assetTypeAttachmentSlice.d.ts +6 -6
  57. package/dist/store/slices/assetTypeSlice.d.ts +8 -14
  58. package/dist/store/slices/authSlice.d.ts +3 -3
  59. package/dist/store/slices/categorySlice.d.ts +16 -72
  60. package/dist/store/slices/documentAttachmentSlice.d.ts +6 -6
  61. package/dist/store/slices/documentSlice.d.ts +20 -62
  62. package/dist/store/slices/emailDomainsSlice.d.ts +4 -4
  63. package/dist/store/slices/fileSlice.d.ts +2 -2
  64. package/dist/store/slices/formRevisionAttachmentSlice.d.ts +3 -3
  65. package/dist/store/slices/formRevisionSlice.d.ts +19 -61
  66. package/dist/store/slices/formSlice.d.ts +9 -8
  67. package/dist/store/slices/formSubmissionAttachmentSlice.d.ts +3 -3
  68. package/dist/store/slices/formSubmissionSlice.d.ts +11 -11
  69. package/dist/store/slices/geoImageSlice.d.ts +48 -0
  70. package/dist/store/slices/index.d.ts +2 -1
  71. package/dist/store/slices/issueAttachmentSlice.d.ts +6 -6
  72. package/dist/store/slices/issueCommentSlice.d.ts +3 -3
  73. package/dist/store/slices/issueSlice.d.ts +7 -17
  74. package/dist/store/slices/issueTypeSlice.d.ts +7 -7
  75. package/dist/store/slices/issueUpdateSlice.d.ts +3 -3
  76. package/dist/store/slices/licenseSlice.d.ts +7 -7
  77. package/dist/store/slices/organizationAccessSlice.d.ts +6 -6
  78. package/dist/store/slices/organizationSlice.d.ts +14 -25
  79. package/dist/store/slices/outboxSlice.d.ts +6 -4
  80. package/dist/store/slices/projectAccessSlice.d.ts +7 -7
  81. package/dist/store/slices/projectAttachmentSlice.d.ts +6 -6
  82. package/dist/store/slices/projectFileSlice.d.ts +8 -62
  83. package/dist/store/slices/projectSlice.d.ts +10 -10
  84. package/dist/store/slices/rehydratedSlice.d.ts +3 -2
  85. package/dist/store/slices/settingsSlice.d.ts +3 -24
  86. package/dist/store/slices/teamSlice.d.ts +6 -6
  87. package/dist/store/slices/userSlice.d.ts +5 -5
  88. package/dist/store/slices/workspaceSlice.d.ts +9 -56
  89. package/dist/store/store.d.ts +9 -91
  90. package/dist/typings/colors.d.ts +0 -3
  91. package/dist/typings/models/{components.d.ts → assets.d.ts} +2 -3
  92. package/dist/typings/models/forms.d.ts +87 -1
  93. package/dist/typings/models/geo.d.ts +18 -6
  94. package/dist/typings/models/geoImages.d.ts +14 -0
  95. package/dist/typings/models/index.d.ts +2 -1
  96. package/dist/typings/models/issues.d.ts +3 -4
  97. package/dist/typings/models/organizations.d.ts +0 -11
  98. package/dist/typings/models/projects.d.ts +3 -5
  99. package/dist/typings/models/store.d.ts +43 -4
  100. package/dist/typings/store.d.ts +6 -4
  101. package/dist/utils/colors.d.ts +0 -6
  102. package/dist/utils/coordinates.d.ts +5 -7
  103. package/dist/utils/file.d.ts +0 -6
  104. package/dist/utils/index.d.ts +1 -0
  105. package/dist/utils/utils.d.ts +3 -3
  106. package/package.json +13 -41
  107. package/dist/components/ColorPicker/ColorPicker.d.ts +0 -10
  108. package/dist/components/ColorPicker/index.d.ts +0 -1
  109. package/dist/components/FileBadge/FileBadge.d.ts +0 -8
  110. package/dist/components/FileBadge/index.d.ts +0 -1
  111. package/dist/components/FileCard/FileCard.d.ts +0 -8
  112. package/dist/components/FileCard/index.d.ts +0 -1
  113. package/dist/components/FileIcon/FileIcon.d.ts +0 -5
  114. package/dist/components/FileIcon/index.d.ts +0 -1
  115. package/dist/components/FileViewer/FileViewerProvider.d.ts +0 -2
  116. package/dist/components/FileViewer/context.d.ts +0 -5
  117. package/dist/components/FileViewer/index.d.ts +0 -3
  118. package/dist/components/FileViewer/typings.d.ts +0 -5
  119. package/dist/components/ImageCard/ImageCard.d.ts +0 -9
  120. package/dist/components/ImageCard/index.d.ts +0 -1
  121. package/dist/components/ImageMarkup/ImageMarkup.d.ts +0 -14
  122. package/dist/components/ImageMarkup/index.d.ts +0 -1
  123. package/dist/components/ImageViewer/ImageViewer.d.ts +0 -8
  124. package/dist/components/ImageViewer/constants.d.ts +0 -1
  125. package/dist/components/ImageViewer/index.d.ts +0 -2
  126. package/dist/components/PDFViewer/PDFViewer.d.ts +0 -8
  127. package/dist/components/PDFViewer/constants.d.ts +0 -1
  128. package/dist/components/PDFViewer/index.d.ts +0 -2
  129. package/dist/components/SpreadsheetViewer/SpreadsheetViewer.d.ts +0 -8
  130. package/dist/components/SpreadsheetViewer/constants.d.ts +0 -1
  131. package/dist/components/SpreadsheetViewer/index.d.ts +0 -2
  132. package/dist/components/index.d.ts +0 -10
  133. package/dist/contexts/hooks.d.ts +0 -2
  134. package/dist/contexts/index.d.ts +0 -3
  135. package/dist/contexts/overmap.d.ts +0 -12
  136. package/dist/contexts/sdk/globals.d.ts +0 -4
  137. package/dist/contexts/sdk/hooks.d.ts +0 -4
  138. package/dist/contexts/sdk/index.d.ts +0 -2
  139. package/dist/contexts/sdk/sdk.d.ts +0 -15
  140. package/dist/enums/map.d.ts +0 -6
  141. package/dist/forms/builder/DropDispatch.d.ts +0 -27
  142. package/dist/forms/builder/FieldActions.d.ts +0 -13
  143. package/dist/forms/builder/FieldBuilder.d.ts +0 -10
  144. package/dist/forms/builder/FieldSectionWithActions.d.ts +0 -11
  145. package/dist/forms/builder/FieldWithActions.d.ts +0 -10
  146. package/dist/forms/builder/FieldsEditor.d.ts +0 -6
  147. package/dist/forms/builder/FormBuilder.d.ts +0 -25
  148. package/dist/forms/builder/constants.d.ts +0 -18
  149. package/dist/forms/builder/hooks.d.ts +0 -7
  150. package/dist/forms/builder/index.d.ts +0 -2
  151. package/dist/forms/builder/typings.d.ts +0 -12
  152. package/dist/forms/builder/utils.d.ts +0 -24
  153. package/dist/forms/constants.d.ts +0 -2
  154. package/dist/forms/constantsJsx.d.ts +0 -9
  155. package/dist/forms/fields/BaseField/BaseField.d.ts +0 -52
  156. package/dist/forms/fields/BaseField/hooks.d.ts +0 -374
  157. package/dist/forms/fields/BaseField/index.d.ts +0 -4
  158. package/dist/forms/fields/BaseField/layouts.d.ts +0 -25
  159. package/dist/forms/fields/BaseField/typings.d.ts +0 -7
  160. package/dist/forms/fields/BooleanField/BooleanField.d.ts +0 -23
  161. package/dist/forms/fields/BooleanField/BooleanInput.d.ts +0 -4
  162. package/dist/forms/fields/BooleanField/index.d.ts +0 -2
  163. package/dist/forms/fields/CustomField/CustomField.d.ts +0 -24
  164. package/dist/forms/fields/CustomField/FieldInputClonerField/FieldInputCloner.d.ts +0 -8
  165. package/dist/forms/fields/CustomField/FieldInputClonerField/FieldInputClonerField.d.ts +0 -18
  166. package/dist/forms/fields/CustomField/FieldInputClonerField/index.d.ts +0 -3
  167. package/dist/forms/fields/CustomField/FieldInputClonerField/typings.d.ts +0 -5
  168. package/dist/forms/fields/CustomField/index.d.ts +0 -1
  169. package/dist/forms/fields/DateField/DateField.d.ts +0 -22
  170. package/dist/forms/fields/DateField/DateInput.d.ts +0 -4
  171. package/dist/forms/fields/DateField/index.d.ts +0 -2
  172. package/dist/forms/fields/FieldSection/FieldSection.d.ts +0 -33
  173. package/dist/forms/fields/FieldSection/FieldSectionLayout.d.ts +0 -7
  174. package/dist/forms/fields/FieldSection/index.d.ts +0 -1
  175. package/dist/forms/fields/MultiStringField/MultiStringField.d.ts +0 -40
  176. package/dist/forms/fields/MultiStringField/MultiStringInput.d.ts +0 -8
  177. package/dist/forms/fields/MultiStringField/index.d.ts +0 -2
  178. package/dist/forms/fields/NumberField/NumberField.d.ts +0 -46
  179. package/dist/forms/fields/NumberField/NumberInput.d.ts +0 -4
  180. package/dist/forms/fields/NumberField/index.d.ts +0 -2
  181. package/dist/forms/fields/QrField/QrField.d.ts +0 -21
  182. package/dist/forms/fields/QrField/QrInput.d.ts +0 -10
  183. package/dist/forms/fields/QrField/index.d.ts +0 -2
  184. package/dist/forms/fields/SelectField/BaseSelectField.d.ts +0 -34
  185. package/dist/forms/fields/SelectField/MultiSelectField.d.ts +0 -27
  186. package/dist/forms/fields/SelectField/MultiSelectInput.d.ts +0 -4
  187. package/dist/forms/fields/SelectField/SelectField.d.ts +0 -26
  188. package/dist/forms/fields/SelectField/SelectInput.d.ts +0 -4
  189. package/dist/forms/fields/SelectField/index.d.ts +0 -4
  190. package/dist/forms/fields/StringOrTextFields/StringField/StringField.d.ts +0 -26
  191. package/dist/forms/fields/StringOrTextFields/StringField/StringInput.d.ts +0 -4
  192. package/dist/forms/fields/StringOrTextFields/StringField/index.d.ts +0 -2
  193. package/dist/forms/fields/StringOrTextFields/StringOrTextField.d.ts +0 -34
  194. package/dist/forms/fields/StringOrTextFields/TextField/TextField.d.ts +0 -22
  195. package/dist/forms/fields/StringOrTextFields/TextField/TextInput.d.ts +0 -4
  196. package/dist/forms/fields/StringOrTextFields/TextField/index.d.ts +0 -2
  197. package/dist/forms/fields/StringOrTextFields/index.d.ts +0 -2
  198. package/dist/forms/fields/UploadField/UploadField.d.ts +0 -44
  199. package/dist/forms/fields/UploadField/UploadInput.d.ts +0 -4
  200. package/dist/forms/fields/UploadField/index.d.ts +0 -2
  201. package/dist/forms/fields/UploadField/utils.d.ts +0 -1
  202. package/dist/forms/fields/constants.d.ts +0 -106
  203. package/dist/forms/fields/hooks.d.ts +0 -6
  204. package/dist/forms/fields/index.d.ts +0 -12
  205. package/dist/forms/fields/typings.d.ts +0 -27
  206. package/dist/forms/fields/utils.d.ts +0 -17
  207. package/dist/forms/index.d.ts +0 -5
  208. package/dist/forms/renderer/FormBrowser/FormBrowser.d.ts +0 -11
  209. package/dist/forms/renderer/FormRenderer/FormRenderer.d.ts +0 -31
  210. package/dist/forms/renderer/FormSubmissionBrowser/FormSubmissionBrowser.d.ts +0 -28
  211. package/dist/forms/renderer/FormSubmissionViewer/FormSubmissionViewer.d.ts +0 -17
  212. package/dist/forms/renderer/PatchForm/Field.d.ts +0 -17
  213. package/dist/forms/renderer/PatchForm/Provider.d.ts +0 -29
  214. package/dist/forms/renderer/PatchForm/index.d.ts +0 -2
  215. package/dist/forms/renderer/index.d.ts +0 -5
  216. package/dist/forms/typings.d.ts +0 -103
  217. package/dist/forms/utils.d.ts +0 -9
  218. package/dist/sdk/services/AuthService.d.ts +0 -54
  219. package/dist/sdk/services/MainService.d.ts +0 -16
  220. package/dist/store/hooks.d.ts +0 -4
  221. package/dist/store/slices/mapSlice.d.ts +0 -23
  222. package/dist/style.css +0 -435
@@ -0,0 +1,11 @@
1
+ import { FileService } from "./services";
2
+ import { ToolkitStore } from "@reduxjs/toolkit/dist/configureStore";
3
+ import { SDKRequest } from "./typings";
4
+ import { BaseState } from "../typings";
5
+ export declare abstract class BaseSDK<TState extends BaseState> {
6
+ readonly store: ToolkitStore<TState>;
7
+ abstract readonly files: FileService<TState, BaseSDK<TState>>;
8
+ protected constructor(store: ToolkitStore<TState>);
9
+ enqueueRequest<TResult>(requestDetails: SDKRequest, host: string, serviceName: string): Promise<TResult>;
10
+ private _enqueueRequest;
11
+ }
@@ -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,5 @@
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 { BaseSDK } from "./base";
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
+ import { OvermapSDKConstructor } from "./typings";
5
+ export declare const initSDK: <TState extends BaseState, TSDK extends BaseSDK<TState>>(store: ToolkitStore<TState>, sdk: OvermapSDKConstructor<TState, TSDK>) => TSDK;
@@ -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.
@@ -10,5 +11,5 @@ export declare class AgentService extends BaseApiService {
10
11
  continueConversation(prompt: string, conversationId: AgentUserConversation["offline_id"]): Promise<void>;
11
12
  fetchDetails(conversationId: AgentUserConversation["offline_id"]): Promise<void>;
12
13
  rate(responseId: string, rating: 1 | 5): Promise<undefined>;
13
- refreshStore(): Promise<void>;
14
+ refreshStore(projectId: number): Promise<void>;
14
15
  }
@@ -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,11 +1,12 @@
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>;
8
9
  deleteAllAssetsOfAssetType(assetTypeId: string): Promise<undefined>;
9
10
  bulkAdd(assetsToCreate: Payload<Asset>[], workspaceId: string, assetTypeId: string, batchSize: number): Promise<Created<Asset>[]>[];
10
- refreshStore(): Promise<void>;
11
+ refreshStore(projectId: number): Promise<void>;
11
12
  }
@@ -1,9 +1,10 @@
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
- refreshStore(): Promise<void>;
7
+ refreshStore(projectId: number): Promise<void>;
7
8
  /**
8
9
  * Creates a collection of AssetStageCompletions, marking the referenced stages as completed for the referenced
9
10
  * assets. It's REQUIRED that all assets referenced all have the SAME asset type.
@@ -1,11 +1,12 @@
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>;
7
8
  update(assetStage: AssetStage): Promise<undefined>;
8
9
  linkForm(stageId: string, formId: string): Promise<undefined>;
9
10
  unlinkForm(stageId: string, formId: string): Promise<undefined>;
10
- refreshStore(): Promise<undefined>;
11
+ refreshStore(projectId: number): Promise<undefined>;
11
12
  }
@@ -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,9 +1,10 @@
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>;
8
- refreshStore(): Promise<void>;
9
+ refreshStore(projectId: number): Promise<void>;
9
10
  }
@@ -1,8 +1,11 @@
1
- import type { OvermapSDK } from "../sdk";
1
+ import type { BaseSDK } from "../base";
2
+ import { BaseState } from "../../typings";
3
+ import { BaseAuthService } from "./BaseAuthService";
4
+ import { BaseService } from "./BaseService";
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>> extends BaseService<TStore, TSDK> {
9
+ readonly auth: BaseAuthService<TStore, TSDK>;
10
+ constructor(sdk: TSDK, auth: BaseAuthService<TStore, TSDK>);
8
11
  }
@@ -1,7 +1,14 @@
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 type { BaseSDK } from "../base";
5
+ import { BaseUploadService } from "./BaseUploadService";
6
+ export interface FilePayload {
7
+ sha1: Attachment["file_sha1"];
8
+ file_type: string;
9
+ extension: string;
10
+ size: number;
11
+ }
5
12
  export interface BuildOfflineAttachmentData<TModelId> {
6
13
  file: File;
7
14
  sha1: string;
@@ -10,7 +17,7 @@ export interface BuildOfflineAttachmentData<TModelId> {
10
17
  description?: string;
11
18
  modelId: TModelId;
12
19
  }
13
- export declare abstract class BaseAttachmentService<TModelId extends string | number, TAttachment extends Attachment> extends BaseApiService {
20
+ export declare abstract class BaseAttachmentService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>, TModelId extends string | number, TAttachment extends Attachment> extends BaseUploadService<TState, TSDK> {
14
21
  abstract readonly attachmentModel: AttachmentModel;
15
22
  abstract readonly initializeAttachments: ActionCreatorWithPayload<Submitted<TAttachment>[]>;
16
23
  abstract readonly addAttachments: ActionCreatorWithPayload<Submitted<TAttachment>[]>;
@@ -18,10 +25,8 @@ export declare abstract class BaseAttachmentService<TModelId extends string | nu
18
25
  abstract readonly removeAttachments: ActionCreatorWithPayload<string[]>;
19
26
  abstract readonly setAttachment: ActionCreatorWithPayload<Stored<TAttachment>>;
20
27
  abstract readonly removeAttachment: ActionCreatorWithPayload<string>;
21
- abstract readonly selectAttachment: SelectorWithArgs<string, Stored<TAttachment>>;
22
- private getNumberOfAttachmentsWithSha1;
23
- private processPresignedUrls;
28
+ abstract readonly selectAttachment: OvermapSelectorWithArgs<string, Stored<TAttachment>>;
24
29
  protected attachFiles(files: File[], modelId: TModelId, buildOfflineAttachment: (data: BuildOfflineAttachmentData<TModelId>) => Stored<TAttachment>): Promise<OptimisticMultipleModelResult<TAttachment>>;
25
30
  protected deleteAttachment(attachmendId: string): Promise<void>;
26
- refreshStore(): Promise<void>;
31
+ refreshStore(projectId: number): Promise<void>;
27
32
  }
@@ -0,0 +1,12 @@
1
+ import { Response, SuperAgentRequest } from "superagent";
2
+ import { BaseState } from "../../typings";
3
+ import type { BaseSDK } from "../base";
4
+ import { BaseService } from "./BaseService";
5
+ export declare abstract class BaseAuthService<TStore extends BaseState, TSDK extends BaseSDK<TStore>> extends BaseService<TStore, TSDK> {
6
+ protected constructor(sdk: TSDK);
7
+ abstract initAuth(payload: object): Promise<void>;
8
+ abstract clearAuth(): void;
9
+ abstract prepareAuth(): Promise<void>;
10
+ abstract getAuthHeader(): string;
11
+ abstract handleUnauthorized(request: SuperAgentRequest, response: Response): Promise<void>;
12
+ }
@@ -0,0 +1,15 @@
1
+ import { AnyAction } from "@reduxjs/toolkit";
2
+ import type { BaseSDK } from "../base";
3
+ import { BaseState } from "../../typings";
4
+ import { SDKRequest } from "../typings";
5
+ export declare const CLASS_NAME_TO_SERVICE: Record<string, BaseService<BaseState, BaseSDK<BaseState>>>;
6
+ /**
7
+ * Abstract base class for building a service that can enqueue API requests
8
+ */
9
+ export declare abstract class BaseService<TStore extends BaseState, TSDK extends BaseSDK<TStore>> {
10
+ protected readonly client: TSDK;
11
+ abstract readonly host: string;
12
+ protected constructor(sdk: TSDK);
13
+ protected enqueueRequest<TResult>(requestDetails: SDKRequest): Promise<TResult>;
14
+ protected dispatch(action: AnyAction): void;
15
+ }
@@ -0,0 +1,8 @@
1
+ import { BaseApiService } from "./BaseApiService";
2
+ import { PresignedUrlsResponse } from "../typings";
3
+ import { OvermapRootState } from "../../typings";
4
+ import type { BaseSDK } from "../base";
5
+ export declare abstract class BaseUploadService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
6
+ protected getNumberOfAttachmentsWithSha1(sha1: string): number;
7
+ protected processPresignedUrls(presignedUrls: PresignedUrlsResponse): void;
8
+ }
@@ -1,13 +1,14 @@
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>;
12
- refreshStore(): Promise<undefined>;
13
+ refreshStore(projectId: number): Promise<undefined>;
13
14
  }
@@ -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,10 +1,11 @@
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[]>;
8
9
  delete(documentId: string): Promise<Document[]>;
9
- refreshStore(): Promise<void>;
10
+ refreshStore(projectId: number, organizationId: number): Promise<void>;
10
11
  }
@@ -1,7 +1,8 @@
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
- refreshStore(): Promise<undefined>;
7
+ refreshStore(organizationId: number): Promise<undefined>;
7
8
  }
@@ -1,6 +1,7 @@
1
1
  import { BaseApiService } from "./BaseApiService";
2
- import { EmailVerificationPayload, EmailVerificationReturn, VerificationCode } from "../../typings";
3
- export declare class EmailVerificationService extends BaseApiService {
2
+ import type { BaseSDK } from "../base";
3
+ import { EmailVerificationPayload, EmailVerificationReturn, OvermapRootState, VerificationCode } from "../../typings";
4
+ export declare abstract class EmailVerificationService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
4
5
  getVerificationCode(verificationCode: string): Promise<VerificationCode>;
5
6
  validateVerificationCode(verificationCode: string, payload?: EmailVerificationPayload | undefined): Promise<EmailVerificationReturn>;
6
7
  }
@@ -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 abstract class FileService<TState extends BaseState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
21
+ host: string;
19
22
  private _dbPromise;
20
23
  private renewUploadUrl;
21
24
  /**
@@ -0,0 +1,11 @@
1
+ import { BulkGeoImagePayload, GeoImage, GeoImagePayload, Offline, OvermapRootState } from "../../typings";
2
+ import { OptimisticModelResult, OptimisticMultipleModelResult } from "../typings";
3
+ import type { BaseSDK } from "../base";
4
+ import { BaseUploadService } from "./BaseUploadService";
5
+ export declare abstract class GeoImageService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseUploadService<TState, TSDK> {
6
+ add(payload: GeoImagePayload): Promise<OptimisticModelResult<GeoImage>>;
7
+ bulkAdd(payloads: BulkGeoImagePayload[], projectId: number): Promise<OptimisticMultipleModelResult<GeoImage>>;
8
+ update(payload: Offline<Partial<Pick<GeoImagePayload, "title" | "description">>>): OptimisticModelResult<GeoImage>;
9
+ delete(geoImageId: string): Promise<void>;
10
+ refreshStore(projectId: number): Promise<void>;
11
+ }
@@ -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,9 +1,10 @@
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>;
8
- refreshStore(): Promise<void>;
9
+ refreshStore(projectId: number): Promise<void>;
9
10
  }
@@ -1,12 +1,13 @@
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
- add(issue: Issue, issueType?: IssueType["offline_id"] | null): OptimisticModelResult<Issue>;
8
+ export declare abstract class IssueService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
9
+ add(issue: Issue, workspaceId: string, issueType?: IssueType["offline_id"] | null): OptimisticModelResult<Issue>;
9
10
  update(issue: Submitted<Partial<Issue>>): OptimisticModelResult<Issue>;
10
11
  remove(id: string): Promise<undefined>;
11
- refreshStore(): Promise<undefined>;
12
+ refreshStore(projectId: number): Promise<undefined>;
12
13
  }
@@ -1,9 +1,10 @@
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 {
5
- add(payload: IssueTypePayload): OptimisticModelResult<IssueType>;
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> {
6
+ add(payload: IssueTypePayload, organizationId: number): OptimisticModelResult<IssueType>;
6
7
  update(issueTypeFields: Offline<Partial<IssueType>>): OptimisticModelResult<IssueType>;
7
8
  delete(issueTypeId: string): Promise<void>;
8
- refreshStore(): Promise<void>;
9
+ refreshStore(organizationId: number): Promise<void>;
9
10
  }
@@ -1,4 +1,6 @@
1
+ import { OvermapRootState } from "../../typings";
1
2
  import { BaseApiService } from "./BaseApiService";
2
- export declare class IssueUpdateService extends BaseApiService {
3
- refreshStore(): Promise<void>;
3
+ import type { BaseSDK } from "../base";
4
+ export declare abstract class IssueUpdateService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
5
+ refreshStore(projectId: number): Promise<void>;
4
6
  }
@@ -0,0 +1,36 @@
1
+ import request from "superagent";
2
+ import { BaseState } from "../../typings";
3
+ import type { BaseSDK } from "../base";
4
+ import { TokenPair } from "../typings";
5
+ import { BaseAuthService } from "./BaseAuthService";
6
+ /**
7
+ * Handles login, logout and renewing tokens
8
+ */
9
+ export declare abstract class JWTService<TState extends BaseState, TSDK extends BaseSDK<TState>> extends BaseAuthService<TState, TSDK> {
10
+ protected abstract initTokensUrl: string;
11
+ protected abstract refreshTokensUrl: string;
12
+ protected abstract setTokens: (tokens: TokenPair) => void;
13
+ protected abstract clearTokens: () => void;
14
+ protected abstract getAccessToken: () => string;
15
+ protected abstract getRefreshToken: () => string;
16
+ /**
17
+ * Takes refresh token and gets a new token pair
18
+ * @async
19
+ * @param {string} refreshToken The refresh token used to get new tokens
20
+ * @returns {Promise<TokenPair>} The new access and refresh tokens
21
+ */
22
+ private _getRenewedTokens;
23
+ /**
24
+ * Logs the user out
25
+ */
26
+ clearAuth(): void;
27
+ /**
28
+ * Attempts to renew tokens
29
+ */
30
+ renewTokens(): Promise<undefined>;
31
+ tokenIsExpiringSoon(): boolean;
32
+ getAuthHeader(): string;
33
+ prepareAuth(): Promise<undefined>;
34
+ handleUnauthorized(request: request.SuperAgentRequest, response: request.Response): Promise<void>;
35
+ initAuth(payload: object): Promise<undefined>;
36
+ }
@@ -1,7 +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 {
4
- fetchLicensesForOrganization(organizationId: number, showLoading?: boolean): Promise<License[]>;
3
+ import type { BaseSDK } from "../base";
4
+ export declare abstract class LicenseService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
5
5
  getLicense(license: License): Promise<License>;
6
6
  pauseLicense(license: License): Promise<License>;
7
7
  resumeLicense(license: License): Promise<License>;
@@ -9,4 +9,5 @@ export declare class LicenseService extends BaseApiService {
9
9
  attachLicenseToProject(license: License, project: Project): Promise<License>;
10
10
  detachLicenseFromProject(license: License): Promise<License>;
11
11
  getLatestTransaction(license: License): Promise<Transaction>;
12
+ refreshStore(projectId: number, organizationId: number): Promise<void>;
12
13
  }
@@ -1,10 +1,11 @@
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
- refreshStore(): Promise<void>;
10
+ refreshStore(organizationId: number): Promise<void>;
10
11
  }
@@ -1,9 +1,9 @@
1
- import { InitialOrganizationData, Organization } from "../../typings";
1
+ import { Organization, OvermapRootState } from "../../typings";
2
2
  import { BaseApiService } from "./BaseApiService";
3
- export declare class OrganizationService extends BaseApiService {
4
- fetchInitialOrganizationData(organizationId: number, showLoading: boolean): Promise<InitialOrganizationData>;
5
- _processInitialOrganizationData(data: InitialOrganizationData, showLoading: boolean): void;
3
+ import type { BaseSDK } from "../base";
4
+ export declare abstract class OrganizationService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
6
5
  create(name: string): Promise<Organization>;
7
6
  update(organization: Organization): Promise<Organization>;
8
7
  invite(organizationId: number, email: string): Promise<undefined>;
8
+ refreshStore(projectId: number, organizationId: number): Promise<void>;
9
9
  }