@overmap-ai/core 1.0.63-form-submission-fix.3 → 1.0.63-issue-association.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.
@@ -0,0 +1,9 @@
1
+ import type { IssueAssociation, OvermapRootState, Payload } from "../../typings";
2
+ import type { OptimisticModelResult } from "../typings";
3
+ import type { BaseSDK } from "../base";
4
+ import { BaseUploadService } from "./BaseUploadService";
5
+ export declare abstract class IssueAssociationSlice<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseUploadService<TState, TSDK> {
6
+ add(payload: Payload<IssueAssociation>): OptimisticModelResult<IssueAssociation>;
7
+ delete(id: string): Promise<void>;
8
+ refreshStore(projectId: number): Promise<void>;
9
+ }
@@ -31,3 +31,4 @@ export * from "./AgentService";
31
31
  export * from "./TeamService";
32
32
  export * from "./UserService";
33
33
  export * from "./GeoImageService";
34
+ export * from "./IssueAssociationService";
@@ -36,3 +36,4 @@ export * from "./issueUpdateSlice";
36
36
  export * from "./issueAttachmentSlice";
37
37
  export * from "./versioningSlice";
38
38
  export * from "./geoImageSlice";
39
+ export * from "./issueAssociationSlice";
@@ -0,0 +1,47 @@
1
+ import { Reducer } from "@reduxjs/toolkit";
2
+ import type { IssueAssociation, OvermapRootState, OvermapSelectorWithArgs, Stored } from "../../typings";
3
+ import type { ModelState } from "../typings";
4
+ export type IssueAssociationSliceState = ModelState<Stored<IssueAssociation>>;
5
+ export declare const issueAssociationSlice: import("@reduxjs/toolkit").Slice<IssueAssociationSliceState, {
6
+ initializeIssueAssociations: <TState extends ModelState<Stored<IssueAssociation>>>(state: TState, action: {
7
+ payload: Stored<IssueAssociation>[];
8
+ type: string;
9
+ }) => void;
10
+ addIssueAssociation: <TState_1 extends ModelState<Stored<IssueAssociation>>>(state: TState_1, action: {
11
+ payload: Stored<IssueAssociation>;
12
+ type: string;
13
+ }) => void;
14
+ addIssueAssociations: <TState_2 extends ModelState<Stored<IssueAssociation>>>(state: TState_2, action: {
15
+ payload: Stored<IssueAssociation>[];
16
+ type: string;
17
+ }) => void;
18
+ setIssueAssociation: <TState_3 extends ModelState<Stored<IssueAssociation>>>(state: TState_3, action: {
19
+ payload: Stored<IssueAssociation>;
20
+ type: string;
21
+ }) => void;
22
+ setIssueAssociations: <TState_4 extends ModelState<Stored<IssueAssociation>>>(state: TState_4, action: {
23
+ payload: Stored<IssueAssociation>[];
24
+ type: string;
25
+ }) => void;
26
+ updateIssueAssociation: <TState_5 extends ModelState<Stored<IssueAssociation>>>(state: TState_5, action: {
27
+ payload: Stored<IssueAssociation>;
28
+ type: string;
29
+ }) => void;
30
+ updateIssueAssociations: <TState_6 extends ModelState<Stored<IssueAssociation>>>(state: TState_6, action: {
31
+ payload: Stored<IssueAssociation>[];
32
+ type: string;
33
+ }) => void;
34
+ deleteIssueAssociation: <TState_7 extends ModelState<Stored<IssueAssociation>>>(state: TState_7, action: {
35
+ payload: string;
36
+ type: string;
37
+ }) => void;
38
+ deleteIssueAssociations: <TState_8 extends ModelState<Stored<IssueAssociation>>>(state: TState_8, action: {
39
+ payload: string[];
40
+ type: string;
41
+ }) => void;
42
+ }, "issueAssociations">;
43
+ export declare const initializeIssueAssociations: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueAssociation>[], "issueAssociations/initializeIssueAssociations">, setIssueAssociations: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueAssociation>[], "issueAssociations/setIssueAssociations">, setIssueAssociation: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueAssociation>, "issueAssociations/setIssueAssociation">, updateIssueAssociation: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueAssociation>, "issueAssociations/updateIssueAssociation">, updateIssueAssociations: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueAssociation>[], "issueAssociations/updateIssueAssociations">, addIssueAssociation: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueAssociation>, "issueAssociations/addIssueAssociation">, addIssueAssociations: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<IssueAssociation>[], "issueAssociations/addIssueAssociations">, deleteIssueAssociation: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "issueAssociations/deleteIssueAssociation">, deleteIssueAssociations: import("@reduxjs/toolkit").ActionCreatorWithPayload<string[], "issueAssociations/deleteIssueAssociations">;
44
+ export declare const selectIssueAssociationMapping: (state: OvermapRootState) => Record<string, Stored<IssueAssociation>>;
45
+ export declare const selectIssueAssociationById: OvermapSelectorWithArgs<string, Stored<IssueAssociation>>;
46
+ export declare const selectAssociationsOfIssue: (args: string) => (state: OvermapRootState) => Stored<IssueAssociation>[];
47
+ export declare const issueAssociationReducer: Reducer<IssueAssociationSliceState>;
@@ -3,8 +3,8 @@ import { Reducer } from "redux";
3
3
  import { Config, OfflineAction, OfflineMetadata } from "@redux-offline/redux-offline/lib/types";
4
4
  import request from "superagent";
5
5
  import { type BaseSDK, type OfflineMetaEffect, OutboxCoordinator, RequestDetails } from "../sdk";
6
- import { AgentsState, AssetAttachmentState, AssetStageCompletionState, AssetStageState, AssetState, AssetTypeAttachmentState, AssetTypeState, AuthState, CategoryState, DocumentAttachmentState, DocumentState, EmailDomainState, FileState, FormRevisionAttachmentState, FormRevisionState, FormState, FormSubmissionAttachmentState, FormSubmissionState, GeoImageSliceState, IssueAttachmentState, IssueCommentState, IssueState, IssueTypeState, IssueUpdateState, LicenseState, OrganizationAccessState, OrganizationState, OutboxState, ProjectAccessState, ProjectAttachmentState, ProjectFileState, ProjectState, RehydratedState, SettingState, TeamState, UserState, VersioningState, WorkspaceState } from "./slices";
7
- import { BaseState, OvermapRootState } from "../typings";
6
+ import { AgentsState, AssetAttachmentState, AssetStageCompletionState, AssetStageState, AssetState, AssetTypeAttachmentState, AssetTypeState, AuthState, CategoryState, DocumentAttachmentState, DocumentState, EmailDomainState, FileState, FormRevisionAttachmentState, FormRevisionState, FormState, FormSubmissionAttachmentState, FormSubmissionState, GeoImageSliceState, IssueAssociationSliceState, IssueAttachmentState, IssueCommentState, IssueState, IssueTypeState, IssueUpdateState, LicenseState, OrganizationAccessState, OrganizationState, OutboxState, ProjectAccessState, ProjectAttachmentState, ProjectFileState, ProjectState, RehydratedState, SettingState, TeamState, UserState, VersioningState, WorkspaceState } from "./slices";
7
+ import type { BaseState, OvermapRootState } from "../typings";
8
8
  export declare const VERSION_REDUCER_KEY = "versioning";
9
9
  export declare const overmapReducers: {
10
10
  versioning: Reducer<VersioningState>;
@@ -45,6 +45,7 @@ export declare const overmapReducers: {
45
45
  issueUpdateReducer: Reducer<IssueUpdateState>;
46
46
  issueAttachmentReducer: Reducer<IssueAttachmentState>;
47
47
  geoImageReducer: Reducer<GeoImageSliceState>;
48
+ issueAssociationReducer: Reducer<IssueAssociationSliceState>;
48
49
  };
49
50
  export declare const resetStore = "RESET";
50
51
  export declare const overmapRootReducer: Reducer<OvermapRootState>;
@@ -16,7 +16,7 @@ export type Offline<T> = T & {
16
16
  offline_id: string;
17
17
  };
18
18
  export type OfflineIdMapping<TModel extends OfflineModel> = Record<TModel["offline_id"], TModel>;
19
- export type Payload<TModel> = Omit<TModel, "offline_id" | "created_at" | "updated_at" | "id">;
19
+ export type Payload<TModel> = Omit<TModel, "offline_id" | "created_at" | "updated_at" | "id" | "submitted_at" | "created_by">;
20
20
  export type MaybePayload<TModel extends OfflineModel> = Payload<TModel> & {
21
21
  offline_id?: string | null;
22
22
  };
@@ -1,11 +1,11 @@
1
- import { CreatedByModel, Offline, OfflineModel } from "./base";
1
+ import type { CreatedByModel, Offline, OfflineModel, SubmittedAtModel } from "./base";
2
2
  import { IssuePriority, IssueStatus } from "../../enums";
3
- import { WorkspaceIndexedModel } from "./workspace";
4
- import { CanvasMarkableModel, MarkableModel } from "./geo";
5
- import { CreatedForm, SubmittedForm, Form } from "./forms";
6
- import { User } from "./users";
7
- import { CSSColor } from "../colors";
8
- import { CreatedDocument, SubmittedDocument } from "./documents";
3
+ import type { WorkspaceIndexedModel } from "./workspace";
4
+ import type { CanvasMarkableModel, MarkableModel } from "./geo";
5
+ import type { CreatedForm, SubmittedForm, Form } from "./forms";
6
+ import type { User } from "./users";
7
+ import type { CSSColor } from "../colors";
8
+ import type { CreatedDocument, SubmittedDocument } from "./documents";
9
9
  /**
10
10
  * Represents a model instance that has been submitted to the backend. Some properties (depending on which model, but in
11
11
  * all cases, the `offline_id`) are guaranteed to be set.
@@ -104,3 +104,8 @@ export interface IssueUpdate extends OfflineModel, CreatedByModel {
104
104
  issue: OfflineModel["offline_id"];
105
105
  changes: Partial<Record<IssueUpdateChange, IssueUpdateChangeTypes[IssueUpdateChange]>>;
106
106
  }
107
+ export interface IssueAssociation extends OfflineModel, SubmittedAtModel, CreatedByModel {
108
+ associated_issue: string;
109
+ issue?: string;
110
+ asset?: string;
111
+ }
@@ -1,6 +1,6 @@
1
1
  /// <reference types="@redux-offline/redux-offline" />
2
2
  import { OfflineState } from "@redux-offline/redux-offline/lib/types";
3
- import { AgentsState, AssetAttachmentState, AssetStageCompletionState, AssetStageState, AssetState, AssetTypeAttachmentState, AssetTypeState, AuthState, CategoryState, DocumentAttachmentState, DocumentState, EmailDomainState, FileState, FormRevisionAttachmentState, FormRevisionState, FormState, FormSubmissionAttachmentState, FormSubmissionState, GeoImageSliceState, IssueAttachmentState, IssueCommentState, IssueState, IssueTypeState, IssueUpdateState, LicenseState, OrganizationAccessState, OrganizationState, OutboxState, ProjectAccessState, ProjectAttachmentState, ProjectFileState, ProjectState, RehydratedState, SettingState, TeamState, UserState, VERSION_REDUCER_KEY, VersioningState, WorkspaceState } from "../../store";
3
+ import { AgentsState, AssetAttachmentState, AssetStageCompletionState, AssetStageState, AssetState, AssetTypeAttachmentState, AssetTypeState, AuthState, CategoryState, DocumentAttachmentState, DocumentState, EmailDomainState, FileState, FormRevisionAttachmentState, FormRevisionState, FormState, FormSubmissionAttachmentState, FormSubmissionState, GeoImageSliceState, IssueAssociationSliceState, IssueAttachmentState, IssueCommentState, IssueState, IssueTypeState, IssueUpdateState, LicenseState, OrganizationAccessState, OrganizationState, OutboxState, ProjectAccessState, ProjectAttachmentState, ProjectFileState, ProjectState, RehydratedState, SettingState, TeamState, UserState, VERSION_REDUCER_KEY, VersioningState, WorkspaceState } from "../../store";
4
4
  export interface BaseState {
5
5
  outboxReducer: OutboxState;
6
6
  offline: OfflineState;
@@ -43,4 +43,5 @@ export interface OvermapRootState extends BaseState {
43
43
  teamReducer: TeamState;
44
44
  agentsReducer: AgentsState;
45
45
  geoImageReducer: GeoImageSliceState;
46
+ issueAssociationReducer: IssueAssociationSliceState;
46
47
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Core functionality for Overmap",
4
4
  "author": "Wôrdn Inc.",
5
5
  "license": "UNLICENSED",
6
- "version": "1.0.63-form-submission-fix.3",
6
+ "version": "1.0.63-issue-association.0",
7
7
  "type": "module",
8
8
  "main": "dist/overmap-core.umd.cjs",
9
9
  "module": "dist/overmap-core.js",