@tak-ps/cloudtak 12.55.0 → 12.94.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.
@@ -1,94 +0,0 @@
1
- import type { ProfileOverlay, ProfileOverlay_Create } from '../types.ts';
2
- import type { LayerSpecification } from 'maplibre-gl';
3
- /**
4
- * @class
5
- */
6
- export default class Overlay {
7
- _destroyed: boolean;
8
- _internal: boolean;
9
- _timer: ReturnType<typeof setInterval> | null;
10
- _clickable: Array<{
11
- id: string;
12
- type: string;
13
- }>;
14
- _error?: Error;
15
- _loaded: boolean;
16
- id: number;
17
- name: string;
18
- active: boolean;
19
- username?: string;
20
- frequency: number | null;
21
- iconset: string | null;
22
- created: string;
23
- updated: string;
24
- pos: number;
25
- type: string;
26
- opacity: number;
27
- visible: boolean;
28
- mode: string;
29
- mode_id: string | null;
30
- actions: ProfileOverlay["actions"];
31
- url?: string;
32
- styles: Array<LayerSpecification>;
33
- token: string | null;
34
- static create(body: ProfileOverlay | ProfileOverlay_Create, opts?: {
35
- internal?: boolean;
36
- skipSave?: boolean;
37
- clickable?: Array<{
38
- id: string;
39
- type: string;
40
- }>;
41
- before?: string;
42
- skipLayers?: boolean;
43
- }): Promise<Overlay>;
44
- static internal(body: {
45
- id: number;
46
- type: string;
47
- name: string;
48
- styles?: Array<LayerSpecification>;
49
- clickable?: Array<{
50
- id: string;
51
- type: string;
52
- }>;
53
- }): Promise<Overlay>;
54
- static load(id: number): Promise<Overlay>;
55
- constructor(overlay: ProfileOverlay, opts?: {
56
- internal?: boolean;
57
- });
58
- healthy(): boolean;
59
- hasBounds(): boolean;
60
- zoomTo(): Promise<void>;
61
- addLayers(before?: string): Promise<void>;
62
- init(opts?: {
63
- clickable?: Array<{
64
- id: string;
65
- type: string;
66
- }>;
67
- before?: string;
68
- skipLayers?: boolean;
69
- }): Promise<void>;
70
- remove(): void;
71
- replace(overlay: {
72
- name?: string;
73
- active?: boolean;
74
- username?: string;
75
- actions?: ProfileOverlay["actions"];
76
- type?: string;
77
- opacity?: number;
78
- visible?: boolean;
79
- mode?: string;
80
- mode_id?: string;
81
- url?: string;
82
- token?: string;
83
- styles?: Array<LayerSpecification>;
84
- }, opts?: {
85
- before?: string;
86
- }): Promise<void>;
87
- delete(): Promise<void>;
88
- update(body: {
89
- pos?: number;
90
- visible?: boolean;
91
- opacity?: number;
92
- }): Promise<void>;
93
- save(): Promise<void>;
94
- }
@@ -1,49 +0,0 @@
1
- import COT from './cot.ts';
2
- import Subscription from './subscription.ts';
3
- import type Atlas from '../workers/atlas.ts';
4
- import type { BBox } from 'geojson';
5
- import type { Feature, FeatureCollection } from '../types.ts';
6
- /**
7
- * High Level Wrapper around the Data/Mission Sync API
8
- */
9
- export default class SubscriptionFeature {
10
- parent: Subscription;
11
- token: string;
12
- missiontoken?: string;
13
- constructor(parent: Subscription, opts: {
14
- token: string;
15
- missiontoken?: string;
16
- });
17
- headers(): Record<string, string>;
18
- refresh(): Promise<void>;
19
- list(opts?: {
20
- refresh: false;
21
- }): Promise<Array<Feature>>;
22
- collection(raw?: boolean): Promise<FeatureCollection>;
23
- bounds(): Promise<BBox>;
24
- from(uid: string): Promise<Feature | undefined>;
25
- /**
26
- * Upsert a feature into the mission.
27
- * This will udpate the feature in the local DB, submit it to the TAK Server and
28
- * mark the subscription as dirty for a re-render
29
- *
30
- * @param atlas - The Atlas instance
31
- * @param cot - The COT object to upsert
32
- * @param opts - Options for updating the feature
33
- * @param opts.skipNetwork - If true, the feature will not be updated on the server - IE in response to a Mission Change event
34
- */
35
- update(atlas: Atlas, cot: COT, opts?: {
36
- skipNetwork?: boolean;
37
- }): Promise<void>;
38
- /**
39
- * Delete a feature from the mission.
40
- *
41
- * @param atlas - The Atlas instance
42
- * @param uid - The unique ID of the feature to delete
43
- * @param opts - Options for deleting the feature
44
- * @param opts.skipNetwork - If true, the feature will not be deleted from the server - IE in response to a Mission Change event
45
- */
46
- delete(atlas: Atlas, uid: string, opts?: {
47
- skipNetwork?: boolean;
48
- }): Promise<void>;
49
- }
@@ -1,32 +0,0 @@
1
- import type { MissionLog } from '../types.ts';
2
- /**
3
- * High Level Wrapper around the Data/Mission Sync API
4
- */
5
- export default class SubscriptionLog {
6
- guid: string;
7
- token: string;
8
- missiontoken?: string;
9
- constructor(guid: string, opts: {
10
- token: string;
11
- missiontoken?: string;
12
- });
13
- headers(): Record<string, string>;
14
- refresh(): Promise<void>;
15
- list(opts?: {
16
- filter?: string;
17
- refresh: false;
18
- }): Promise<Array<MissionLog>>;
19
- create(body: {
20
- dtg?: string;
21
- content: string;
22
- contentHashes?: Array<string>;
23
- keywords?: Array<string>;
24
- }): Promise<MissionLog>;
25
- update(logid: string, body: {
26
- dtg?: string;
27
- content: string;
28
- contentHashes?: Array<string>;
29
- keywords?: Array<string>;
30
- }): Promise<MissionLog>;
31
- delete(logid: string): Promise<void>;
32
- }
@@ -1,115 +0,0 @@
1
- import SubscriptionLog from './subscription-log.ts';
2
- import SubscriptionFeature from './subscription-feature.ts';
3
- import type { Mission, MissionRole, MissionList, MissionLayer, MissionChanges, MissionLayerList, MissionLayer_Create, MissionLayer_Update, MissionSubscriptions } from '../types.ts';
4
- export declare enum SubscriptionEventType {
5
- CREATE = "subscription::create",
6
- UPDATE = "subscription::update",
7
- DELETE = "subscription::delete"
8
- }
9
- export type SubscriptionEvent = {
10
- guid: string;
11
- type: SubscriptionEventType;
12
- state: {
13
- dirty: boolean;
14
- subscribed: boolean;
15
- };
16
- };
17
- /**
18
- * High Level Wrapper around the Data/Mission Sync API
19
- *
20
- * @property {string} guid - The unique identifier for the mission
21
- * @property {string} name - The name of the mission
22
- * @property {Mission} meta - The mission metadata
23
- * @property {MissionRole} role - The role of the user in the mission
24
- * @property {string} token - The CloudTAK Authentication token for API calls
25
- * @property {string} [missiontoken] - The mission token for authentication
26
- *
27
- * @property {boolean} subscribed - Whether the user is subscribed to the mission
28
- */
29
- export default class Subscription {
30
- guid: string;
31
- name: string;
32
- meta: Mission;
33
- role: MissionRole;
34
- log: SubscriptionLog;
35
- feature: SubscriptionFeature;
36
- token: string;
37
- missiontoken?: string;
38
- dirty: boolean;
39
- subscribed: boolean;
40
- _sync: BroadcastChannel;
41
- constructor(mission: Mission, role: MissionRole, opts: {
42
- subscribed: boolean;
43
- token: string;
44
- missiontoken?: string;
45
- });
46
- /**
47
- * Return a Subscription instance of one already exists in the local DB,
48
- */
49
- static from(guid: string, token: string, opts?: {
50
- subscribed?: boolean;
51
- }): Promise<Subscription | undefined>;
52
- /**
53
- * Loads an existing Subscription from the local DB an refreshes it,
54
- * or creates a new Subscription from the server if it does not exist locally.
55
- *
56
- * @param guid - The unique identifier for the mission
57
- * @param opts - Options for loading the subscription
58
- * @param opts.token - The CloudTAK Authentication token for API calls
59
- * @param opts.reload - Whether to reload the mission from the local DB
60
- * @param opts.missiontoken - The mission token for authentication
61
- * @param opts.subscribed - Whether the user is subscribed to the mission
62
- */
63
- static load(guid: string, opts: {
64
- token: string;
65
- reload?: boolean;
66
- missiontoken?: string;
67
- subscribed?: boolean;
68
- }): Promise<Subscription>;
69
- update(body: {
70
- dirty?: boolean;
71
- subscribed?: boolean;
72
- token?: string;
73
- description?: string;
74
- }): Promise<void>;
75
- delete(): Promise<void>;
76
- headers(): Record<string, string>;
77
- /**
78
- * Reload the Mission from the local Database
79
- */
80
- reload(): Promise<void>;
81
- /**
82
- * Perform a hard refresh of the Mission from the Server
83
- */
84
- refresh(opts?: {
85
- refreshMission?: boolean;
86
- }): Promise<void>;
87
- fetch(): Promise<void>;
88
- /**
89
- * List all locally stored missions, with optional filtering
90
- *
91
- * @param filter - Filter options for the local mission list
92
- * @param filter.role - Filter by minimum role
93
- * @param filter.subscribed - Filter by subscription status
94
- * @param filter.dirty - Filter by dirty status
95
- */
96
- static localList(filter?: {
97
- role?: 'MISSION_OWNER' | 'MISSION_SUBSCRIBER' | 'MISSION_READONLY_SUBSCRIBER';
98
- subscribed?: boolean;
99
- dirty?: boolean;
100
- }): Promise<Set<{
101
- guid: string;
102
- name: string;
103
- }>>;
104
- static list(opts?: {
105
- passwordProtected?: boolean;
106
- defaultRole?: boolean;
107
- }): Promise<MissionList>;
108
- static headers(token?: string): Record<string, string>;
109
- subscriptions(): Promise<MissionSubscriptions>;
110
- changes(): Promise<MissionChanges>;
111
- layerList(): Promise<MissionLayerList>;
112
- layerUpdate(guid: string, layerid: string, layer: MissionLayer_Update): Promise<MissionLayer>;
113
- layerCreate(layer: MissionLayer_Create): Promise<MissionLayer>;
114
- layerDelete(layeruid: string): Promise<void>;
115
- }
@@ -1,11 +0,0 @@
1
- import type { LayerSpecification } from 'maplibre-gl';
2
- export default function styles(id: string, opts?: {
3
- sourceLayer?: string;
4
- group?: boolean;
5
- course?: boolean;
6
- labels?: {
7
- size: number;
8
- };
9
- icons?: boolean;
10
- rotateIcons?: boolean;
11
- }): Array<LayerSpecification>;
@@ -1,19 +0,0 @@
1
- import type { paths } from './derived-types.js';
2
- import type { Router } from 'vue-router';
3
- export declare const server: import("openapi-fetch").Client<paths, `${string}/${string}`>;
4
- export declare function stdurl(url: string | URL): URL;
5
- /**
6
- * Standardize interactions with the backend API
7
- *
8
- * @param {URL|String} url - Full URL or API fragment to request
9
- * @param {Object} [opts={}] - Options
10
- */
11
- export declare function std(url: string | URL, opts?: {
12
- token?: string;
13
- download?: boolean | string;
14
- headers?: Record<string, string>;
15
- body?: unknown;
16
- method?: string;
17
- }): Promise<unknown>;
18
- export declare function humanSeconds(seconds: number): string;
19
- export declare function stdclick($router: Router, event: MouseEvent | KeyboardEvent, path: string): void;
@@ -1,115 +0,0 @@
1
- import DrawTool from './modules/draw.ts';
2
- import IconManager from './modules/icons.ts';
3
- import MenuManager from './modules/menu.ts';
4
- import * as Comlink from 'comlink';
5
- import COT from '../base/cot.ts';
6
- import type { DatabaseType } from '../base/database.ts';
7
- import { LocationState } from '../base/events.ts';
8
- import Overlay from '../base/overlay.ts';
9
- import Subscription from '../base/subscription.ts';
10
- import mapgl from 'maplibre-gl';
11
- import type Atlas from '../workers/atlas.ts';
12
- import type { Basemap, APIList, Feature, MapConfig } from '../types.ts';
13
- import type { LngLat, Point, MapGeoJSONFeature } from 'maplibre-gl';
14
- export type TAKNotification = {
15
- type: string;
16
- name: string;
17
- body: string;
18
- url: string;
19
- created: string;
20
- };
21
- export declare const useMapStore: import("pinia").StoreDefinition<"cloudtak", {
22
- _map?: any;
23
- _draw?: any;
24
- _icons?: any;
25
- _menu?: any;
26
- db: DatabaseType;
27
- channel: BroadcastChannel;
28
- toImport: Feature[];
29
- locked: Array<string>;
30
- callsign: string;
31
- zoom: string;
32
- location: LocationState;
33
- distanceUnit: string;
34
- manualLocationMode: boolean;
35
- isMobileDetected: boolean;
36
- gpsWatchId: number | null;
37
- toastOffset: {
38
- x: number;
39
- y: number;
40
- };
41
- permissions: {
42
- location: boolean;
43
- notification: boolean;
44
- };
45
- worker: Comlink.Remote<Atlas>;
46
- mission: Subscription | undefined;
47
- mapConfig: MapConfig;
48
- container?: HTMLElement;
49
- hasTerrain: boolean;
50
- hasNoChannels: boolean;
51
- isTerrainEnabled: boolean;
52
- isLoaded: boolean;
53
- isOpen: boolean;
54
- pitch: number;
55
- bearing: number;
56
- selected: Map<string, COT>;
57
- select: {
58
- mode?: string;
59
- feats: Array<COT | MapGeoJSONFeature>;
60
- x: number;
61
- y: number;
62
- popup?: mapgl.Popup;
63
- };
64
- radial: {
65
- mode: string | undefined;
66
- cot: Feature | MapGeoJSONFeature | undefined;
67
- x: number;
68
- y: number;
69
- lngLat?: LngLat;
70
- };
71
- overlays: Array<Overlay>;
72
- }, {
73
- map: () => mapgl.Map;
74
- draw: () => DrawTool;
75
- icons: () => IconManager;
76
- menu: () => MenuManager;
77
- }, {
78
- destroy: () => void;
79
- removeOverlay: (overlay: Overlay) => Promise<void>;
80
- makeActiveMission: (mission?: Subscription) => Promise<void>;
81
- getOverlayById(id: number): Overlay | null;
82
- getOverlayByName(name: string): Overlay | null;
83
- getOverlayByMode(mode: string, mode_id: string): Overlay | null;
84
- listTerrain: () => Promise<APIList<Basemap>>;
85
- addTerrain: () => Promise<void>;
86
- removeTerrain: () => void;
87
- returnHome: () => void;
88
- /**
89
- * Trigger a rerender of the underlying GeoJSON Features
90
- */
91
- refresh: () => Promise<void>;
92
- updateCOT: () => Promise<void>;
93
- /**
94
- * Given a mission Guid, attempt to refresh the Map Layer, loading the mission if it isn't already loaded
95
- * @returns {boolean} True if successful, false if not
96
- */
97
- loadMission: (guid: string, opts?: {
98
- reload: boolean;
99
- }) => Promise<Subscription | null>;
100
- init: (container: HTMLElement) => Promise<void>;
101
- startGPSWatch: () => void;
102
- initOverlays: () => Promise<void>;
103
- updateIconRotation: (enabled: boolean) => void;
104
- updateDistanceUnit: (unit: string) => void;
105
- updateAttribution: () => Promise<void>;
106
- /**
107
- * Determine if the feature is from the CoT store or a clicked VT feature
108
- */
109
- featureSource: (feat: MapGeoJSONFeature | Feature) => string | void;
110
- radialClick: (feat: MapGeoJSONFeature | Feature, opts: {
111
- lngLat: LngLat;
112
- point: Point;
113
- mode?: string;
114
- }) => Promise<void>;
115
- }>;
@@ -1,35 +0,0 @@
1
- import * as terraDraw from 'terra-draw';
2
- import type { GeoJSONFeatureId } from 'maplibre-gl';
3
- import type COT from '../../base/cot.ts';
4
- import type { useMapStore } from '../map.ts';
5
- export declare enum DrawToolMode {
6
- STATIC = "static",
7
- FREEHAND = "freehand",
8
- SELECT = "select",
9
- POINT = "point",
10
- LINESTRING = "linestring",
11
- POLYGON = "polygon",
12
- RECTANGLE = "angled-rectangle",
13
- CIRCLE = "circle",
14
- SECTOR = "sector"
15
- }
16
- export default class DrawTool {
17
- private draw;
18
- editing: COT | null;
19
- mode: DrawToolMode;
20
- private mapStore;
21
- snapping: Set<[number, number]>;
22
- point: {
23
- type: string;
24
- };
25
- lasso: {
26
- loading: boolean;
27
- overlay: string;
28
- };
29
- constructor(mapStore: ReturnType<typeof useMapStore>);
30
- start(mode: DrawToolMode): Promise<void>;
31
- stop(refresh?: boolean): Promise<void>;
32
- edit(cot: COT): Promise<void>;
33
- getFeature(id: GeoJSONFeatureId): terraDraw.GeoJSONStoreFeatures<terraDraw.GeoJSONStoreGeometries> | undefined;
34
- removeFeature(id: GeoJSONFeatureId): void;
35
- }
@@ -1,38 +0,0 @@
1
- import type { Map as MapLibreMap } from 'maplibre-gl';
2
- import { type DBIconset } from '../../base/database.ts';
3
- export default class IconManager {
4
- private cache;
5
- private map;
6
- constructor(map: MapLibreMap);
7
- static from(uid: string): Promise<DBIconset | undefined>;
8
- addIconset(uid: string): Promise<void>;
9
- removeIconset(uid: string): Promise<void>;
10
- static sprites(): Promise<Array<{
11
- id: string;
12
- url: string;
13
- }>>;
14
- updateImages(): Promise<void>;
15
- onStyleImageMissing(e: {
16
- id: string;
17
- }): Promise<void>;
18
- /**
19
- * Get or create a colored version of an icon
20
- */
21
- getColoredIcon(iconId: string, color: string): string;
22
- /**
23
- * Create a colored version of an icon and add it to the map
24
- */
25
- private createColoredIcon;
26
- /**
27
- * Replace white/light pixels with the target color
28
- */
29
- private recolorWhitePixels;
30
- /**
31
- * Check if a pixel is considered "white" (should be recolored)
32
- */
33
- private isWhitePixel;
34
- /**
35
- * Convert hex color to RGB values
36
- */
37
- private hexToRgb;
38
- }
@@ -1,34 +0,0 @@
1
- import type { Component, Ref, ComputedRef } from "vue";
2
- export type MenuItemConfig = {
3
- key: string;
4
- label: string;
5
- route: string;
6
- routeExternal?: boolean;
7
- tooltip: string;
8
- description?: string;
9
- icon: Component;
10
- badge?: string;
11
- requiresSystemAdmin?: boolean;
12
- requiresAgencyAdmin?: boolean;
13
- };
14
- /**
15
- * Manage Pluggable Menu
16
- */
17
- export default class MenuManager {
18
- mapStore: any;
19
- filter: Ref<string>;
20
- preferredLayout: Ref<'list' | 'tiles'>;
21
- onlineContactsCount: Ref<number>;
22
- isSystemAdmin: Ref<boolean>;
23
- isAgencyAdmin: Ref<boolean>;
24
- pluginMenuItems: Ref<MenuItemConfig[]>;
25
- constructor(mapStore: any);
26
- init(): Promise<void>;
27
- get baseMenuItems(): MenuItemConfig[];
28
- get items(): ComputedRef<MenuItemConfig[]>;
29
- get filtered(): ComputedRef<MenuItemConfig[]>;
30
- setLayout(mode: 'list' | 'tiles'): void;
31
- updateContactsCount(): Promise<void>;
32
- addMenuItem(item: MenuItemConfig): void;
33
- removeMenuItem(key: string): void;
34
- }