@tak-ps/cloudtak 13.55.0 → 13.55.2

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.
@@ -4,10 +4,8 @@ import type { MissionChange } from '../types.ts';
4
4
  */
5
5
  export default class SubscriptionChanges {
6
6
  guid: string;
7
- token: string;
8
7
  missiontoken?: string;
9
8
  constructor(guid: string, opts: {
10
- token: string;
11
9
  missiontoken?: string;
12
10
  });
13
11
  headers(): Record<string, string>;
@@ -5,10 +5,8 @@ import type { Mission } from '../types.ts';
5
5
  */
6
6
  export default class SubscriptionContents {
7
7
  guid: string;
8
- token: string;
9
8
  missiontoken?: string;
10
9
  constructor(guid: string, opts: {
11
- token: string;
12
10
  missiontoken?: string;
13
11
  });
14
12
  headers(): Record<string, string>;
@@ -8,10 +8,8 @@ import type { Feature, FeatureCollection } from '../types.ts';
8
8
  */
9
9
  export default class SubscriptionFeature {
10
10
  parent: Subscription;
11
- token: string;
12
11
  missiontoken?: string;
13
12
  constructor(parent: Subscription, opts: {
14
- token: string;
15
13
  missiontoken?: string;
16
14
  });
17
15
  headers(): Record<string, string>;
@@ -9,10 +9,8 @@ import type { MissionLayer, MissionLayer_Create, MissionLayer_Update } from '../
9
9
  */
10
10
  export default class SubscriptionLayer {
11
11
  parent: Subscription;
12
- token: string;
13
12
  missiontoken?: string;
14
13
  constructor(parent: Subscription, opts: {
15
- token: string;
16
14
  missiontoken?: string;
17
15
  });
18
16
  headers(): Record<string, string>;
@@ -38,6 +36,24 @@ export default class SubscriptionLayer {
38
36
  * Update an existing mission layer, then refresh the local store.
39
37
  */
40
38
  update(layerid: string, layer: MissionLayer_Update): Promise<MissionLayer>;
39
+ /**
40
+ * File existing mission features under a mission layer, moving them from
41
+ * any layer they are currently filed under.
42
+ *
43
+ * The move is applied to the local store first so the UI updates
44
+ * immediately - TAK Server layer listings can lag behind mutations, so the
45
+ * local store is authoritative until the next full refresh. On API failure
46
+ * the local store is re-synced from the server.
47
+ */
48
+ attachFeatures(layeruid: string, uids: string[]): Promise<void>;
49
+ /**
50
+ * Move a mission feature out of a mission layer and back to the mission
51
+ * root - the feature remains part of the mission.
52
+ *
53
+ * The move is applied to the local store first so the UI updates
54
+ * immediately. On API failure the local store is re-synced from the server.
55
+ */
56
+ detachFeature(layeruid: string, uid: string): Promise<void>;
41
57
  /**
42
58
  * Delete a mission layer, then refresh the local store.
43
59
  */
@@ -5,10 +5,8 @@ import type { MissionLog } from '../types.ts';
5
5
  */
6
6
  export default class SubscriptionLog {
7
7
  guid: string;
8
- token: string;
9
8
  missiontoken?: string;
10
9
  constructor(guid: string, opts: {
11
- token: string;
12
10
  missiontoken?: string;
13
11
  });
14
12
  headers(): Record<string, string>;
@@ -32,7 +32,6 @@ export default class Subscription {
32
32
  feature: SubscriptionFeature;
33
33
  layer: SubscriptionLayer;
34
34
  chat: SubscriptionChat;
35
- token: string;
36
35
  missiontoken?: string;
37
36
  dirty: boolean;
38
37
  subscribed: boolean;
@@ -40,21 +39,19 @@ export default class Subscription {
40
39
  _sync: BroadcastChannel;
41
40
  constructor(mission: Mission, role: MissionRole, opts: {
42
41
  subscribed: boolean;
43
- token: string;
44
42
  missiontoken?: string;
45
43
  });
46
44
  /**
47
45
  * Return a Subscription instance of one already exists in the local DB,
48
46
  */
49
- static from(guid: string, token: string, opts?: {
47
+ static from(guid: string, opts?: {
50
48
  subscribed?: boolean;
51
49
  }): Promise<Subscription | undefined>;
52
50
  /**
53
51
  * Loads an existing Subscription from the local DB an refreshes it,
54
52
  * or creates a new Subscription from the server if it does not exist locally.
55
53
  */
56
- static load(guid: string, opts: {
57
- token: string;
54
+ static load(guid: string, opts?: {
58
55
  reload?: boolean;
59
56
  missiontoken?: string;
60
57
  subscribed?: boolean;
@@ -69,6 +66,11 @@ export default class Subscription {
69
66
  }): Promise<void>;
70
67
  delete(): Promise<void>;
71
68
  headers(): Record<string, string>;
69
+ /**
70
+ * Update the Mission Token, propagating it to the sub-stores which
71
+ * each hold their own copy for generating MissionAuthorization headers
72
+ */
73
+ setMissionToken(token?: string): void;
72
74
  /**
73
75
  * Reload the Mission from the local Database
74
76
  */
@@ -1,10 +1,24 @@
1
+ type __VLS_Props = {
2
+ /** Explicit segment labels - when provided navigation is emitted as a depth instead of writing to the collection model */
3
+ segments?: string[];
4
+ /** Allow segments (and Home) to act as drag & drop targets, emitting segment-drop with the depth */
5
+ droppable?: boolean;
6
+ };
1
7
  type __VLS_ModelProps = {
2
- 'collection': string;
8
+ 'collection'?: string;
3
9
  };
4
- declare const __VLS_export: import("vue").DefineComponent<__VLS_ModelProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
5
- "update:collection": (value: string) => any;
6
- }, string, import("vue").PublicProps, Readonly<__VLS_ModelProps> & Readonly<{
7
- "onUpdate:collection"?: ((value: string) => any) | undefined;
8
- }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
10
+ type __VLS_PublicProps = __VLS_Props & __VLS_ModelProps;
11
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
12
+ navigate: (depth: number) => any;
13
+ "segment-drop": (depth: number) => any;
14
+ "update:collection": (value: string | undefined) => any;
15
+ }, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
16
+ onNavigate?: ((depth: number) => any) | undefined;
17
+ "onSegment-drop"?: ((depth: number) => any) | undefined;
18
+ "onUpdate:collection"?: ((value: string | undefined) => any) | undefined;
19
+ }>, {
20
+ segments: string[];
21
+ droppable: boolean;
22
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
9
23
  declare const _default: typeof __VLS_export;
10
24
  export default _default;
@@ -36,6 +36,12 @@ export declare class RoutingControl implements IControl {
36
36
  getDefaultPosition(): ControlPosition;
37
37
  get active(): boolean;
38
38
  setRoute(route: Feature<LineString> | null): void;
39
+ /**
40
+ * Rehydrate a previously persisted route from the KV store. Returns true
41
+ * if a route was restored - the caller is responsible for re-feeding
42
+ * location updates via setLocation().
43
+ */
44
+ restore(): Promise<boolean>;
39
45
  setLocation(location: {
40
46
  lng: number;
41
47
  lat: number;
@@ -1,3 +1,9 @@
1
+ export interface BatteryInfo {
2
+ /** Battery level as a percentage (0-100), or null when unknown. */
3
+ level: number | null;
4
+ /** Whether the device is charging, or null when unknown. */
5
+ charging: boolean | null;
6
+ }
1
7
  /**
2
8
  * Cross-platform charging-state source for the "Charging" wake lock mode.
3
9
  * Native uses `@capacitor/device` (imported lazily, polled); web uses the
@@ -7,7 +13,9 @@ export declare class BatteryStatus {
7
13
  private pollTimer;
8
14
  private webBattery;
9
15
  private webListener;
16
+ private webManagerPromise;
10
17
  isCharging(): Promise<boolean>;
18
+ info(): Promise<BatteryInfo>;
11
19
  watch(onChange: (charging: boolean) => void): Promise<void>;
12
20
  unwatch(): Promise<void>;
13
21
  private webBatteryManager;
@@ -7,6 +7,7 @@ import { OrientationPermission } from './device/orientation.ts';
7
7
  import { StoragePermission } from './device/storage.ts';
8
8
  import { WakeLockPermission } from './device/wake-lock.ts';
9
9
  import { NetworkStatus } from './device/network.ts';
10
+ import { BatteryStatus } from './device/battery.ts';
10
11
  import type { BrowserPermissionState, BrowserPermissionType } from './device/types.ts';
11
12
  export type { BrowserPermissionState, BrowserPermissionType } from './device/types.ts';
12
13
  export { CameraPermission } from './device/camera.ts';
@@ -18,6 +19,8 @@ export { OrientationPermission } from './device/orientation.ts';
18
19
  export { StoragePermission } from './device/storage.ts';
19
20
  export { WakeLockPermission } from './device/wake-lock.ts';
20
21
  export { NetworkStatus } from './device/network.ts';
22
+ export { BatteryStatus } from './device/battery.ts';
23
+ export type { BatteryInfo } from './device/battery.ts';
21
24
  export declare const useDeviceStore: import("pinia").SetupStoreDefinition<"device", {
22
25
  permissions: {
23
26
  notification: BrowserPermissionState;
@@ -29,6 +32,7 @@ export declare const useDeviceStore: import("pinia").SetupStoreDefinition<"devic
29
32
  fileSystem: BrowserPermissionState;
30
33
  };
31
34
  network: import("vue").Raw<NetworkStatus>;
35
+ battery: import("vue").Raw<BatteryStatus>;
32
36
  geolocation: import("vue").Raw<GeolocationPermission>;
33
37
  notification: import("vue").Raw<BrowserNotificationPermission>;
34
38
  orientation: import("vue").Raw<OrientationPermission>;
@@ -105,6 +105,7 @@ export declare const useMapStore: import("pinia").StoreDefinition<"cloudtak", {
105
105
  routingControl: () => RoutingControl | undefined;
106
106
  syncRoutingControl: () => void;
107
107
  startNavigation: (cotId: string) => Promise<void>;
108
+ restoreNavigation: () => Promise<void>;
108
109
  stopNavigation: () => void;
109
110
  reverseNavigation: () => void;
110
111
  openSelfFeature: () => Promise<void>;
@@ -7,6 +7,9 @@ export type ProfileLocationState = {
7
7
  accuracy: number | undefined;
8
8
  altitude: number | null | undefined;
9
9
  coordinates: number[];
10
+ /** Battery level as a percentage (0-100) - null/undefined when unknown */
11
+ battery?: number | null;
12
+ charging?: boolean | null;
10
13
  };
11
14
  export default class AtlasProfile {
12
15
  atlas: Atlas;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/cloudtak",
3
3
  "type": "module",
4
- "version": "13.55.0",
4
+ "version": "13.55.2",
5
5
  "types": "dist/types/plugin.d.ts",
6
6
  "files": [
7
7
  "dist/types"