@tak-ps/cloudtak 13.94.4 → 13.96.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.
@@ -59,6 +59,8 @@ export default class SubscriptionFeature {
59
59
  */
60
60
  push(): Promise<boolean>;
61
61
  private flush;
62
+ private upsert;
63
+ private submit;
62
64
  /**
63
65
  * Mark rows as synced unless they were changed again while the request was in flight
64
66
  */
@@ -13,6 +13,7 @@ export declare enum SubscriptionEventType {
13
13
  export type SubscriptionEvent = {
14
14
  guid: string;
15
15
  type: SubscriptionEventType;
16
+ origin: string;
16
17
  state: {
17
18
  dirty: boolean;
18
19
  subscribed: boolean;
@@ -36,16 +37,22 @@ export default class Subscription {
36
37
  dirty: boolean;
37
38
  subscribed: boolean;
38
39
  templateid: string | null;
39
- _sync: BroadcastChannel;
40
+ private _sync?;
41
+ private readonly _id;
40
42
  constructor(mission: Mission, role: MissionRole, opts: {
41
43
  subscribed: boolean;
42
44
  missiontoken?: string;
45
+ live?: boolean;
43
46
  });
47
+ listen(): void;
48
+ get live(): boolean;
49
+ close(): void;
44
50
  /**
45
51
  * Return a Subscription instance of one already exists in the local DB,
46
52
  */
47
53
  static from(guid: string, opts?: {
48
54
  subscribed?: boolean;
55
+ live?: boolean;
49
56
  }): Promise<Subscription | undefined>;
50
57
  /**
51
58
  * Loads an existing Subscription from the local DB an refreshes it,
@@ -55,6 +62,7 @@ export default class Subscription {
55
62
  reload?: boolean;
56
63
  missiontoken?: string;
57
64
  subscribed?: boolean;
65
+ live?: boolean;
58
66
  }): Promise<Subscription>;
59
67
  update(body: {
60
68
  dirty?: boolean;
@@ -12,6 +12,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
12
12
  priority: "none" | "low" | "medium" | "high" | "critical";
13
13
  location: string;
14
14
  remarks: string;
15
+ started: string;
15
16
  active: boolean;
16
17
  external_id: string;
17
18
  editable: boolean;
@@ -29,7 +30,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
29
30
  mission_guid: null | string;
30
31
  created: string;
31
32
  updated: string;
32
- started: string;
33
33
  ended: null | string;
34
34
  username: null | string;
35
35
  connection: null | number;
@@ -62,6 +62,7 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
62
62
  priority: "none" | "low" | "medium" | "high" | "critical";
63
63
  location: string;
64
64
  remarks: string;
65
+ started: string;
65
66
  active: boolean;
66
67
  external_id: string;
67
68
  editable: boolean;
@@ -79,7 +80,6 @@ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {
79
80
  mission_guid: null | string;
80
81
  created: string;
81
82
  updated: string;
82
- started: string;
83
83
  ended: null | string;
84
84
  username: null | string;
85
85
  connection: null | number;
@@ -0,0 +1,8 @@
1
+ type __VLS_Props = {
2
+ title?: string;
3
+ };
4
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
5
+ title: string;
6
+ }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
7
+ declare const _default: typeof __VLS_export;
8
+ export default _default;
@@ -11,6 +11,10 @@ type __VLS_Props = {
11
11
  active: boolean;
12
12
  };
13
13
  };
14
- declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
14
+ declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
15
+ terminate: (id: string) => any;
16
+ }, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
17
+ onTerminate?: ((id: string) => any) | undefined;
18
+ }>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
15
19
  declare const _default: typeof __VLS_export;
16
20
  export default _default;
@@ -2,6 +2,7 @@ import type { paths } from '@cloudtak/api-types';
2
2
  import type { Router } from 'vue-router';
3
3
  export declare const serverUrl: string;
4
4
  export declare const server: import("openapi-fetch").Client<paths, `${string}/${string}`>;
5
+ export declare function setSessionRefresher(fn: (() => Promise<string | undefined>) | undefined): void;
5
6
  export declare function getServer(): Promise<import("openapi-fetch").Client<paths, `${string}/${string}`>>;
6
7
  export declare function getRuntimeToken(): Promise<string | undefined>;
7
8
  export declare function stdurl(url: string | URL): URL;
@@ -2,6 +2,7 @@ export type DisplayStyleMode = 'System Default' | 'Light' | 'Dark';
2
2
  export type ResolvedThemeMode = 'light' | 'dark';
3
3
  export declare const useAppStore: import("pinia").StoreDefinition<"cloudtak-app", {
4
4
  tokenExpiry: number | null;
5
+ tokenLifetime: number | null;
5
6
  user: boolean;
6
7
  isMobileDetected: boolean;
7
8
  loginLogo: string | undefined;
@@ -14,17 +15,32 @@ export declare const useAppStore: import("pinia").StoreDefinition<"cloudtak-app"
14
15
  setServerUrl(serverUrl: string): Promise<void>;
15
16
  persistSession(opts: {
16
17
  token: string;
18
+ refresh?: string;
17
19
  username: string;
18
20
  session: string;
19
21
  }): Promise<void>;
22
+ applyToken(token: string): void;
20
23
  getSessionId(): Promise<string | undefined>;
21
24
  getUsername(): Promise<string | undefined>;
22
25
  clearSession(): Promise<void>;
23
26
  destroySession(): Promise<void>;
24
27
  applyTheme(style?: string): void;
25
28
  routeLogin(): Promise<void>;
26
- refreshLogin(): Promise<void>;
29
+ /**
30
+ * Exchange the stored refresh token for a new login token, returning
31
+ * the new token or undefined when the session cannot be extended
32
+ */
33
+ refreshSession(): Promise<string | undefined>;
34
+ /**
35
+ * Restore the stored login - with `extend` every launch also rotates
36
+ * the token pair in the background so the session's inactivity
37
+ * window restarts; boot only waits on it when the token has expired
38
+ */
39
+ refreshLogin(opts?: {
40
+ extend?: boolean;
41
+ }): Promise<void>;
27
42
  sessionExpired(): Promise<void>;
43
+ sessionRevoked(): Promise<void>;
28
44
  logout(): Promise<void>;
29
45
  bootstrap(): Promise<boolean>;
30
46
  teardown(): void;
@@ -120,6 +120,7 @@ export declare const useMapStore: import("pinia").StoreDefinition<"cloudtak", {
120
120
  bottomBar: () => BottomBarManager;
121
121
  worker: () => Comlink.Remote<Atlas>;
122
122
  }, {
123
+ updateToken: (token: string) => Promise<void>;
123
124
  startLocationWatch: () => Promise<void>;
124
125
  syncGeolocateControl: () => void;
125
126
  routingControl: () => RoutingControl | undefined;
@@ -18,6 +18,7 @@ export declare enum WorkerMessageType {
18
18
  Connection_Open = "connection:open",
19
19
  Connection_Close = "connection:close",
20
20
  Connection_AuthFailure = "connection:authfailure",
21
+ Connection_Revoked = "connection:revoked",
21
22
  Mission_Change_Feature = "mission:change:feature",
22
23
  Mission_Invite = "mission:invite",
23
24
  Channel_Change = "channel:change",
@@ -33,6 +33,10 @@ export default class AtlasConnection {
33
33
  private scheduleReconnect;
34
34
  private isAuthRejected;
35
35
  private handleAuthFailure;
36
+ /**
37
+ * The server terminated this login session - the main thread must log out
38
+ */
39
+ private handleRevoked;
36
40
  private clearReconnectTimer;
37
41
  destroy(): void;
38
42
  sendCOT(data: object, type?: string): void;
@@ -45,6 +45,12 @@ export default class AtlasDatabase {
45
45
  * Generate a GeoJSONDiff on existing COT Features
46
46
  */
47
47
  diff(): Promise<GeoJSONSourceDiff>;
48
+ /**
49
+ * Delete removed features from IndexedDB without blocking the caller.
50
+ * A feature re-created while the delete is queued is written back
51
+ * afterwards so the offline cache matches memory.
52
+ */
53
+ persistRemoval(ids: Set<string>): void;
48
54
  /** Current display_stale setting from the in-memory profile cache */
49
55
  displayStale(): string;
50
56
  /**
@@ -18,6 +18,11 @@ export default class Atlas {
18
18
  tiles: AtlasTiles & Comlink.ProxyMarked;
19
19
  constructor();
20
20
  postMessage(msg: WorkerMessage): Promise<void>;
21
+ /**
22
+ * Swap in a refreshed login token - a socket that is already open was
23
+ * authenticated at upgrade and keeps running, only a closed one reconnects
24
+ */
25
+ setToken(authToken: string): Promise<void>;
21
26
  init(authToken: string): Promise<void>;
22
27
  /**
23
28
  * Native background: keep the WebSocket, stop every IndexedDB touch.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/cloudtak",
3
3
  "type": "module",
4
- "version": "13.94.4",
4
+ "version": "13.96.0",
5
5
  "types": "dist/types/plugin.d.ts",
6
6
  "files": [
7
7
  "dist/types"
@@ -51,7 +51,7 @@
51
51
  "@mapbox/tile-cover": "^3.0.2",
52
52
  "@scalar/api-reference": "^1.66.1",
53
53
  "@simplewebauthn/browser": "^14.0.0",
54
- "@tabler/core": "^1.4.0",
54
+ "@tabler/core": "1.5.1",
55
55
  "@tabler/icons-vue": "^3.0.0",
56
56
  "@tak-ps/node-cot": "^14.47.0",
57
57
  "@tak-ps/node-p12": "^1.0.3",