@tak-ps/cloudtak 13.109.2 → 13.109.4

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,3 +1,4 @@
1
+ import { type DBTaxonomy } from '../database.ts';
1
2
  import type { COTUpdate } from './cot/types.ts';
2
3
  import type { Feature, FeaturePropertyCreator, Subscription } from '../types.ts';
3
4
  import type { BBox as GeoJSONBBox, Feature as GeoJSONFeature, Geometry as GeoJSONGeometry } from 'geojson';
@@ -47,6 +48,7 @@ export default class COT {
47
48
  unsubscribe: () => void;
48
49
  } | null;
49
50
  static selfUid: string | null;
51
+ static typeRequests: Map<string, Promise<DBTaxonomy>>;
50
52
  _username?: string;
51
53
  origin: Origin;
52
54
  static load(feat: Feature, origin?: Origin, opts?: {
@@ -128,6 +130,17 @@ export default class COT {
128
130
  static vectorId(id: string): number;
129
131
  length(): number;
130
132
  bounds(): GeoJSONBBox;
133
+ /**
134
+ * Human readable name for this Feature's CoT type - see {@link COT.resolveType}
135
+ */
136
+ resolveType(): Promise<DBTaxonomy>;
137
+ /**
138
+ * Resolve a CoT type or 2525 SIDC to its human readable name, served from
139
+ * the taxonomy table when cached and otherwise fetched and cached. Never
140
+ * throws: offline or unknown types resolve to the type itself
141
+ */
142
+ static resolveType(type: string): Promise<DBTaxonomy>;
143
+ private static fetchType;
131
144
  flyTo(): Promise<void>;
132
145
  static style(feat: Feature): Promise<Feature>;
133
146
  /**
@@ -1,3 +1,4 @@
1
+ import type { StyleLayerDef } from '../../../ETL/Styling/types.ts';
1
2
  import type { Basemap, BasemapList } from '../../../../types.ts';
2
3
  import type { paths } from '@cloudtak/api-types';
3
4
  export interface BasemapImportRequest {
@@ -29,7 +30,7 @@ export interface EditingBasemap {
29
30
  frequency: number | null;
30
31
  snapping_enabled: boolean;
31
32
  snapping_layer: string;
32
- styles: unknown[];
33
+ styles: StyleLayerDef[];
33
34
  tilejson: string;
34
35
  encoding: 'mapbox' | 'terrarium' | null;
35
36
  }
@@ -27,7 +27,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
27
27
  size: number;
28
28
  }[];
29
29
  }) => any;
30
- download: (asset: {
30
+ delete: (asset: {
31
31
  id: string;
32
32
  created: string;
33
33
  updated: string;
@@ -42,8 +42,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
42
42
  ext: string;
43
43
  size: number;
44
44
  }[];
45
- }, type: "pmtiles" | "original") => any;
46
- delete: (asset: {
45
+ }) => any;
46
+ download: (asset: {
47
47
  id: string;
48
48
  created: string;
49
49
  updated: string;
@@ -58,7 +58,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
58
58
  ext: string;
59
59
  size: number;
60
60
  }[];
61
- }) => any;
61
+ }, type: "pmtiles" | "original") => any;
62
62
  move: (asset: {
63
63
  id: string;
64
64
  created: string;
@@ -175,7 +175,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
175
175
  size: number;
176
176
  }[];
177
177
  }) => any) | undefined;
178
- onDownload?: ((asset: {
178
+ onDelete?: ((asset: {
179
179
  id: string;
180
180
  created: string;
181
181
  updated: string;
@@ -190,8 +190,8 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
190
190
  ext: string;
191
191
  size: number;
192
192
  }[];
193
- }, type: "pmtiles" | "original") => any) | undefined;
194
- onDelete?: ((asset: {
193
+ }) => any) | undefined;
194
+ onDownload?: ((asset: {
195
195
  id: string;
196
196
  created: string;
197
197
  updated: string;
@@ -206,7 +206,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
206
206
  ext: string;
207
207
  size: number;
208
208
  }[];
209
- }) => any) | undefined;
209
+ }, type: "pmtiles" | "original") => any) | undefined;
210
210
  onMove?: ((asset: {
211
211
  id: string;
212
212
  created: string;
@@ -3,11 +3,11 @@ type __VLS_Props = {
3
3
  modelValue: VideoConnectionFeed;
4
4
  };
5
5
  declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
6
- "update:modelValue": (...args: any[]) => void;
7
6
  delete: (...args: any[]) => void;
7
+ "update:modelValue": (...args: any[]) => void;
8
8
  }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
10
9
  onDelete?: ((...args: any[]) => any) | undefined;
10
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
11
11
  }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
12
12
  declare const _default: typeof __VLS_export;
13
13
  export default _default;
@@ -61,8 +61,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
61
61
  };
62
62
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
63
63
  submit: (...args: any[]) => void;
64
- "update:modelValue": (...args: any[]) => void;
65
64
  delete: (...args: any[]) => void;
65
+ "update:modelValue": (...args: any[]) => void;
66
66
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
67
67
  mode: {
68
68
  type: StringConstructor;
@@ -122,8 +122,8 @@ declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPro
122
122
  };
123
123
  }>> & Readonly<{
124
124
  onSubmit?: ((...args: any[]) => any) | undefined;
125
- "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
126
125
  onDelete?: ((...args: any[]) => any) | undefined;
126
+ "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
127
127
  }>, {
128
128
  type: string;
129
129
  mode: string;
@@ -122,9 +122,9 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
122
122
  uid: string;
123
123
  coordinates: number[];
124
124
  location: string;
125
- modal: boolean;
126
- navigate: boolean;
127
125
  channel: number;
126
+ navigate: boolean;
127
+ modal: boolean;
128
128
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
129
129
  declare const _default: typeof __VLS_export;
130
130
  export default _default;
@@ -35,10 +35,6 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
35
35
  type: BooleanConstructor;
36
36
  default: boolean;
37
37
  };
38
- compact: {
39
- type: BooleanConstructor;
40
- default: boolean;
41
- };
42
38
  }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
43
39
  delete: (...args: any[]) => void;
44
40
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
@@ -78,16 +74,11 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
78
74
  type: BooleanConstructor;
79
75
  default: boolean;
80
76
  };
81
- compact: {
82
- type: BooleanConstructor;
83
- default: boolean;
84
- };
85
77
  }>> & Readonly<{
86
78
  onDelete?: ((...args: any[]) => any) | undefined;
87
79
  }>, {
88
80
  error: boolean;
89
81
  select: boolean;
90
- compact: boolean;
91
82
  hover: boolean;
92
83
  deleteButton: boolean;
93
84
  deleteAction: string;
@@ -8,8 +8,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
8
8
  visibilityToggle?: boolean;
9
9
  isNodeHidden?: (node: PathNode) => boolean;
10
10
  }, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
11
- navigate: (node: PathNode<any>) => any;
12
11
  delete: (node: PathNode<any>) => any;
12
+ navigate: (node: PathNode<any>) => any;
13
13
  rename: (node: PathNode<any>) => any;
14
14
  "folder-drop": (node: PathNode<any>) => any;
15
15
  "toggle-visibility": (node: PathNode<any>) => any;
@@ -20,8 +20,8 @@ declare const __VLS_export: import("vue").DefineComponent<{
20
20
  visibilityToggle?: boolean;
21
21
  isNodeHidden?: (node: PathNode) => boolean;
22
22
  }> & Readonly<{
23
- onNavigate?: ((node: PathNode<any>) => any) | undefined;
24
23
  onDelete?: ((node: PathNode<any>) => any) | undefined;
24
+ onNavigate?: ((node: PathNode<any>) => any) | undefined;
25
25
  onRename?: ((node: PathNode<any>) => any) | undefined;
26
26
  "onFolder-drop"?: ((node: PathNode<any>) => any) | undefined;
27
27
  "onToggle-visibility"?: ((node: PathNode<any>) => any) | undefined;
@@ -19,8 +19,20 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
19
19
  type: StringConstructor;
20
20
  default: string;
21
21
  };
22
- }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
23
- select: (...args: any[]) => void;
22
+ variant: {
23
+ type: () => "dropdown" | "panel";
24
+ default: string;
25
+ };
26
+ overlays: {
27
+ type: BooleanConstructor;
28
+ default: boolean;
29
+ };
30
+ }>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
31
+ close: () => any;
32
+ select: (value: {
33
+ name: string;
34
+ coordinates: [number, number];
35
+ }) => any;
24
36
  }, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
25
37
  label: {
26
38
  type: StringConstructor;
@@ -42,14 +54,28 @@ declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractP
42
54
  type: StringConstructor;
43
55
  default: string;
44
56
  };
57
+ variant: {
58
+ type: () => "dropdown" | "panel";
59
+ default: string;
60
+ };
61
+ overlays: {
62
+ type: BooleanConstructor;
63
+ default: boolean;
64
+ };
45
65
  }>> & Readonly<{
46
- onSelect?: ((...args: any[]) => any) | undefined;
66
+ onClose?: (() => any) | undefined;
67
+ onSelect?: ((value: {
68
+ name: string;
69
+ coordinates: [number, number];
70
+ }) => any) | undefined;
47
71
  }>, {
48
72
  label: string;
49
73
  autofocus: boolean;
50
74
  placeholder: string;
75
+ variant: "dropdown" | "panel";
51
76
  locationPicker: boolean;
52
77
  initialValue: string;
78
+ overlays: boolean;
53
79
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
54
80
  declare const _default: typeof __VLS_export;
55
81
  export default _default;
@@ -1,6 +1,17 @@
1
1
  /**
2
- * Rewrite remote <img> sources in an HTML fragment to load through the
3
- * CloudTAK image proxy so they are permitted by the Content-Security-Policy
2
+ * Rewrite a remote image URL to load through the CloudTAK image proxy so it
3
+ * is permitted by the Content-Security-Policy - same-origin URLs pass through
4
+ */
5
+ export declare function proxyImageUrl(src: string, token?: string | null): string | null;
6
+ /**
7
+ * Whether a CoT link points at an image, by declared mime type or URL extension
8
+ */
9
+ export declare function isImageLink(link: {
10
+ url?: string;
11
+ mime?: string;
12
+ }): boolean;
13
+ /**
14
+ * Rewrite remote <img> sources in an HTML fragment through the image proxy
4
15
  */
5
16
  export declare function proxyHtmlImages(html: string, token?: string | null): string;
6
17
  /**
@@ -0,0 +1,8 @@
1
+ export interface StyleLayerDef {
2
+ id: string;
3
+ type: string;
4
+ name?: string;
5
+ layout: Record<string, unknown>;
6
+ paint: Record<string, unknown>;
7
+ [key: string]: unknown;
8
+ }
@@ -37,8 +37,8 @@ declare const __VLS_export: import("vue").DefineComponent<Props, {
37
37
  }) => any) | undefined;
38
38
  }>, {
39
39
  cancel: boolean;
40
- method: string;
41
40
  headers: Record<string, string>;
41
+ method: string;
42
42
  label: string;
43
43
  format: "formdata" | "raw";
44
44
  immediate: boolean;
@@ -210,6 +210,12 @@ export interface DBCache {
210
210
  key: string;
211
211
  updated: number;
212
212
  }
213
+ /** Human readable name for a CoT type or MIL-STD-2525 SIDC */
214
+ export interface DBTaxonomy {
215
+ type: string;
216
+ name: string;
217
+ desc: string;
218
+ }
213
219
  export interface DBSprite {
214
220
  /** Sprite id, e.g. 'default' */
215
221
  id: string;
@@ -248,6 +254,7 @@ export type DatabaseType = Dexie & {
248
254
  config: EntityTable<DBConfig, 'key'>;
249
255
  cache: EntityTable<DBCache, 'key'>;
250
256
  contact: EntityTable<Contact, 'uid'>;
257
+ taxonomy: EntityTable<DBTaxonomy, 'type'>;
251
258
  };
252
259
  export declare const db: DatabaseType;
253
260
  export declare function ensureDatabase(): Promise<void>;
@@ -4,6 +4,16 @@ export declare const serverUrl: string;
4
4
  export declare const server: import("openapi-fetch").Client<paths, `${string}/${string}`>;
5
5
  export declare function setSessionRefresher(fn: (() => Promise<string | undefined>) | undefined): void;
6
6
  export declare function getServer(): Promise<import("openapi-fetch").Client<paths, `${string}/${string}`>>;
7
+ /**
8
+ * Authorization header for an explicit token, or none so the client's
9
+ * middleware supplies the session token
10
+ */
11
+ export declare function bearer(token?: string | null): Record<string, string> | undefined;
12
+ /**
13
+ * A fetch that rejects after `timeoutMs` so a stalled connection never hangs
14
+ * a caller - the caller's own AbortSignal is honoured as well
15
+ */
16
+ export declare function fetchWithTimeout(timeoutMs: number): typeof fetch;
7
17
  export declare function getRuntimeToken(): Promise<string | undefined>;
8
18
  export declare function stdurl(url: string | URL): URL;
9
19
  /**
@@ -26,8 +26,8 @@ export declare const useDeviceStore: import("pinia").SetupStoreDefinition<"devic
26
26
  permissions: {
27
27
  notification: BrowserPermissionState;
28
28
  storage: BrowserPermissionState;
29
- orientation: BrowserPermissionState;
30
29
  location: BrowserPermissionState;
30
+ orientation: BrowserPermissionState;
31
31
  backgroundLocation: BrowserPermissionState;
32
32
  camera: BrowserPermissionState;
33
33
  wakeLock: BrowserPermissionState;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/cloudtak",
3
3
  "type": "module",
4
- "version": "13.109.2",
4
+ "version": "13.109.4",
5
5
  "types": "dist/types/plugin.d.ts",
6
6
  "files": [
7
7
  "dist/types"
@@ -56,7 +56,7 @@
56
56
  "@tabler/icons-vue": "^3.0.0",
57
57
  "@tak-ps/node-cot": "^14.53.1",
58
58
  "@tak-ps/node-p12": "^1.0.3",
59
- "@tak-ps/vue-tabler": "^5.9.0",
59
+ "@tak-ps/vue-tabler": "^5.10.0",
60
60
  "@turf/area": "^7.2.0",
61
61
  "@turf/bbox": "^7.1.0",
62
62
  "@turf/boolean-point-in-polygon": "^7.3.1",
@@ -90,7 +90,7 @@
90
90
  "hls.js": "^1.6.5",
91
91
  "imask": "^6.0.0",
92
92
  "jsonata": "^2.0.4",
93
- "maplibre-gl": "npm:@tak-ps/maplibre-gl@^6.12.0",
93
+ "maplibre-gl": "npm:@tak-ps/maplibre-gl@^6.15.0",
94
94
  "milsymbol": "^3.0.2",
95
95
  "openapi-fetch": "^0.17.0",
96
96
  "phone": "^3.1.59",
@@ -1,12 +0,0 @@
1
- type __VLS_Props = {
2
- active: boolean;
3
- priority: string;
4
- edit?: boolean;
5
- };
6
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {} & {
7
- "update:active": (value: boolean) => any;
8
- }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
9
- "onUpdate:active"?: ((value: boolean) => any) | undefined;
10
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
11
- declare const _default: typeof __VLS_export;
12
- export default _default;
@@ -1,13 +0,0 @@
1
- declare var __VLS_1: {};
2
- type __VLS_Slots = {} & {
3
- default?: (props: typeof __VLS_1) => any;
4
- };
5
- declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
6
- declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
7
- declare const _default: typeof __VLS_export;
8
- export default _default;
9
- type __VLS_WithSlots<T, S> = T & {
10
- new (): {
11
- $slots: S;
12
- };
13
- };