@overmap-ai/core 1.0.65-mapbox.0 → 1.0.65-org-projs-only.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.
- package/dist/constants/offline.d.ts +1 -1
- package/dist/overmap-core.js +106 -154
- package/dist/overmap-core.js.map +1 -1
- package/dist/overmap-core.umd.cjs +104 -152
- package/dist/overmap-core.umd.cjs.map +1 -1
- package/dist/sdk/services/CategoryService.d.ts +1 -1
- package/dist/sdk/services/FormService.d.ts +0 -2
- package/dist/sdk/services/WorkspaceService.d.ts +1 -1
- package/dist/store/slices/formSlice.d.ts +0 -2
- package/dist/typings/models/base.d.ts +2 -3
- package/dist/typings/models/categories.d.ts +2 -2
- package/dist/typings/models/forms.d.ts +0 -1
- package/dist/typings/models/geo.d.ts +3 -3
- package/dist/typings/models/issues.d.ts +0 -1
- package/dist/typings/models/license.d.ts +2 -2
- package/dist/typings/models/projects.d.ts +2 -4
- package/dist/typings/models/workspace.d.ts +3 -3
- package/dist/utils/coordinates.d.ts +18 -4
- package/dist/utils/utils.d.ts +7 -1
- package/package.json +1 -1
|
@@ -7,7 +7,7 @@ import type { BaseSDK } from "../base";
|
|
|
7
7
|
* TODO: Support editing and deleting categories
|
|
8
8
|
*/
|
|
9
9
|
export declare abstract class CategoryService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
10
|
-
add(
|
|
10
|
+
add(payload: Omit<Payload<Category>, "workspace">, workspaceId: string): OptimisticModelResult<Category>;
|
|
11
11
|
update(category: Offline<Partial<Category>>, workspaceId: string): OptimisticModelResult<Category>;
|
|
12
12
|
remove(category: Category, workspaceId: string): Promise<undefined>;
|
|
13
13
|
refreshStore(projectId: number): Promise<undefined>;
|
|
@@ -15,8 +15,6 @@ export declare abstract class FormService<TState extends OvermapRootState, TSDK
|
|
|
15
15
|
Promise<Created<FormRevision>>,
|
|
16
16
|
Promise<Created<FormRevisionAttachment>[]>
|
|
17
17
|
]>;
|
|
18
|
-
favorite(formId: string, projectId: number): Promise<undefined>;
|
|
19
|
-
unfavorite(formId: string, projectId: number): Promise<undefined>;
|
|
20
18
|
delete(formId: string): Promise<undefined>;
|
|
21
19
|
refreshStore(projectId: number): Promise<void>;
|
|
22
20
|
}
|
|
@@ -5,7 +5,7 @@ import { OvermapRootState } from "../../typings";
|
|
|
5
5
|
import { BaseApiService } from "./BaseApiService";
|
|
6
6
|
import type { BaseSDK } from "../base";
|
|
7
7
|
export declare abstract class WorkspaceService<TState extends OvermapRootState, TSDK extends BaseSDK<TState>> extends BaseApiService<TState, TSDK> {
|
|
8
|
-
add(
|
|
8
|
+
add(payload: Payload<Workspace>): OptimisticModelResult<Workspace>;
|
|
9
9
|
update(workspace: Workspace): OptimisticModelResult<Workspace>;
|
|
10
10
|
delete(workspaceId: string): Promise<undefined>;
|
|
11
11
|
refreshStore(projectId: number): Promise<undefined>;
|
|
@@ -34,8 +34,6 @@ export declare const formSlice: import("@reduxjs/toolkit").Slice<FormState, {
|
|
|
34
34
|
export declare const initializeForms: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Form>[], "forms/initializeForms">, setForm: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Form>, "forms/setForm">, addForm: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Form>, "forms/addForm">, addForms: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Form>[], "forms/addForms">, updateForm: import("@reduxjs/toolkit").ActionCreatorWithPayload<Stored<Form>, "forms/updateForm">, deleteForm: import("@reduxjs/toolkit").ActionCreatorWithPayload<string, "forms/deleteForm">;
|
|
35
35
|
export declare const formReducer: Reducer<FormState>;
|
|
36
36
|
export type FormSearchArgs = SearchArgs<{
|
|
37
|
-
/** `undefined` means don't filter by favorite. `boolean` filters forms. */
|
|
38
|
-
favorites?: boolean;
|
|
39
37
|
/** organization owner */
|
|
40
38
|
organization?: number;
|
|
41
39
|
}>;
|
|
@@ -30,8 +30,7 @@ export interface OptionalFileModel {
|
|
|
30
30
|
file?: string | null;
|
|
31
31
|
objectURL?: string;
|
|
32
32
|
}
|
|
33
|
-
export interface
|
|
34
|
-
user_owner: number;
|
|
33
|
+
export interface OwnedByOrganization {
|
|
35
34
|
organization_owner: number;
|
|
36
35
|
}
|
|
37
36
|
export interface SubmittedAtModel {
|
|
@@ -44,5 +43,5 @@ export interface ColorModel {
|
|
|
44
43
|
color: CSSColor;
|
|
45
44
|
}
|
|
46
45
|
export interface CreatedByModel {
|
|
47
|
-
created_by
|
|
46
|
+
created_by?: User["id"] | null;
|
|
48
47
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OfflineModel } from "./base";
|
|
1
|
+
import { CreatedByModel, OfflineModel, SubmittedAtModel, TimestampedModel } from "./base";
|
|
2
2
|
import { CSSColor } from "../colors";
|
|
3
|
-
export interface Category extends OfflineModel {
|
|
3
|
+
export interface Category extends OfflineModel, SubmittedAtModel, TimestampedModel, CreatedByModel {
|
|
4
4
|
name: string;
|
|
5
5
|
description?: string;
|
|
6
6
|
color: CSSColor;
|
|
@@ -87,7 +87,6 @@ export interface BaseSerializedObject<TIdentifier extends FieldTypeIdentifier =
|
|
|
87
87
|
type: TIdentifier;
|
|
88
88
|
}
|
|
89
89
|
export interface Form extends OfflineModel, SubmittedAtModel {
|
|
90
|
-
favorite: boolean;
|
|
91
90
|
created_by: number;
|
|
92
91
|
asset_type?: string;
|
|
93
92
|
issue_type?: string;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export type
|
|
2
|
-
export type Bounds = [
|
|
1
|
+
export type Coordinates = [number, number];
|
|
2
|
+
export type Bounds = [Coordinates, Coordinates];
|
|
3
3
|
export interface PointGeometry {
|
|
4
4
|
type: "Point";
|
|
5
|
-
coordinates:
|
|
5
|
+
coordinates: Coordinates;
|
|
6
6
|
}
|
|
7
7
|
export interface MultiPointGeometry {
|
|
8
8
|
type: "MultiPoint";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OfflineModel,
|
|
1
|
+
import { OfflineModel, OwnedByOrganization } from "./base";
|
|
2
2
|
export declare enum PaddleCheckoutEvent {
|
|
3
3
|
COMPLETED = "checkout.completed",
|
|
4
4
|
CLOSED = "checkout.closed"
|
|
@@ -16,7 +16,7 @@ export declare enum LicenseStatus {
|
|
|
16
16
|
export interface Transaction {
|
|
17
17
|
id: string;
|
|
18
18
|
}
|
|
19
|
-
export interface License extends OfflineModel,
|
|
19
|
+
export interface License extends OfflineModel, OwnedByOrganization {
|
|
20
20
|
project: number | null;
|
|
21
21
|
level: LicenseLevel;
|
|
22
22
|
status: LicenseStatus;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import { Model, OfflineModel } from "./base";
|
|
1
|
+
import { Model, OfflineModel, OwnedByOrganization } from "./base";
|
|
2
2
|
import { FileWithNameModel } from "../files";
|
|
3
3
|
import { BoundableModel, CanvasBoundableModel } from "./geo";
|
|
4
|
-
export interface Project extends Model, BoundableModel, CanvasBoundableModel {
|
|
4
|
+
export interface Project extends Model, BoundableModel, CanvasBoundableModel, OwnedByOrganization {
|
|
5
5
|
id: number;
|
|
6
6
|
name: string;
|
|
7
|
-
organization_owner: number | null;
|
|
8
|
-
user_owner: number | null;
|
|
9
7
|
invited?: boolean;
|
|
10
8
|
issues_count?: number;
|
|
11
9
|
form_submissions_count?: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Model, OfflineModel } from "./base";
|
|
2
|
-
export interface Workspace extends OfflineModel {
|
|
1
|
+
import { CreatedByModel, Model, OfflineModel, SubmittedAtModel, TimestampedModel } from "./base";
|
|
2
|
+
export interface Workspace extends OfflineModel, TimestampedModel, SubmittedAtModel, CreatedByModel {
|
|
3
3
|
name: string;
|
|
4
4
|
project: number;
|
|
5
5
|
abbreviation: string | null;
|
|
@@ -7,5 +7,5 @@ export interface Workspace extends OfflineModel {
|
|
|
7
7
|
}
|
|
8
8
|
export interface WorkspaceIndexedModel extends Model {
|
|
9
9
|
index: number | null;
|
|
10
|
-
index_workspace: string
|
|
10
|
+
index_workspace: string;
|
|
11
11
|
}
|
|
@@ -1,4 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const
|
|
1
|
+
import L from "leaflet";
|
|
2
|
+
import { Bounds, Coordinates, MultiPointGeometry, PointGeometry } from "../typings";
|
|
3
|
+
export declare const coordinatesToLiteral: (coordinates: Coordinates) => L.LatLngLiteral;
|
|
4
|
+
export declare const literalToCoordinates: (literal: L.LatLngLiteral) => Coordinates;
|
|
5
|
+
/**
|
|
6
|
+
* Flip coordinates from [lng, lat] to [lat, lng]
|
|
7
|
+
*/
|
|
8
|
+
export declare const flipCoordinates: (coordinates: L.LatLngTuple) => Coordinates;
|
|
9
|
+
export declare const flipBounds: (bounds: Bounds) => Bounds;
|
|
10
|
+
export declare function offsetPositionByMeters(originalPosition: L.LatLng, latMeters: number, lngMeters: number): L.LatLngLiteral;
|
|
11
|
+
export declare const createPointGeometry: (coordinates: Coordinates) => PointGeometry;
|
|
12
|
+
export declare const coordinatesAreEqual: (a: Coordinates, b: Coordinates) => boolean;
|
|
13
|
+
export declare const coordinatesToText: (coordinates: Coordinates | null | undefined, decimalPlaces?: number) => string;
|
|
14
|
+
export declare const coordinatesToUrlText: (coordinates: Coordinates) => string;
|
|
15
|
+
export declare const openCoordsInGoogleMaps: (coordinates: Coordinates) => void;
|
|
16
|
+
export declare const openDirectionsInGoogleMaps: (startingPoint: Coordinates, destination: Coordinates) => void;
|
|
17
|
+
export declare const worldBounds: MultiPointGeometry;
|
|
18
|
+
export declare const createMultiPointGeometry: (coordinates: [Coordinates, Coordinates]) => MultiPointGeometry;
|
package/dist/utils/utils.d.ts
CHANGED
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Coordinates, IssueAttachment, OfflineModel, OvermapRootState } from "../typings";
|
|
2
2
|
type MemoizedSelectorWithArgs<TArgs, TRet> = (state: OvermapRootState, args: TArgs) => TRet;
|
|
3
3
|
export declare const restructureCreateSelectorWithArgs: <TArgs, TRet>(selector: MemoizedSelectorWithArgs<TArgs, TRet>) => (args: TArgs) => (state: OvermapRootState) => TRet;
|
|
4
4
|
export declare function onlyUniqueOfflineIds(value: OfflineModel, index: number, self: OfflineModel[]): boolean;
|
|
5
5
|
export declare function onlyUniqueHashes(value: IssueAttachment, index: number, self: IssueAttachment[]): boolean;
|
|
6
|
+
/**
|
|
7
|
+
*
|
|
8
|
+
* @param bounds order: [northEast, southWest]
|
|
9
|
+
* @param coordinates
|
|
10
|
+
*/
|
|
11
|
+
export declare function boundsContainPoint(bounds: [Coordinates, Coordinates], coordinates: Coordinates): boolean;
|
|
6
12
|
export declare const emailRegex: RegExp;
|
|
7
13
|
export {};
|
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.65-
|
|
6
|
+
"version": "1.0.65-org-projs-only.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"main": "dist/overmap-core.umd.cjs",
|
|
9
9
|
"module": "dist/overmap-core.js",
|