@tak-ps/cloudtak 13.75.1 → 13.77.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,6 +1,7 @@
1
1
  import type { ProfileOverlay, ProfileOverlay_Create } from '../types.ts';
2
2
  import type { LayerSpecification, MapLayerMouseEvent } from 'maplibre-gl';
3
3
  import { type DBOverlay } from '../database.ts';
4
+ import { type OverlayTileJSON } from '../stores/modules/tilejson.ts';
4
5
  export default class Overlay {
5
6
  _destroyed: boolean;
6
7
  _internal: boolean;
@@ -32,10 +33,12 @@ export default class Overlay {
32
33
  mode: string;
33
34
  mode_id: string | null;
34
35
  encoding: 'mapbox' | 'terrarium' | null;
36
+ attribution: string;
35
37
  actions: ProfileOverlay["actions"];
36
38
  url?: string;
37
39
  styles: Array<LayerSpecification>;
38
40
  token: string | null;
41
+ tilejson: OverlayTileJSON | null;
39
42
  static create(body: ProfileOverlay | ProfileOverlay_Create, opts?: {
40
43
  internal?: boolean;
41
44
  skipSave?: boolean;
@@ -63,6 +66,12 @@ export default class Overlay {
63
66
  internal?: boolean;
64
67
  });
65
68
  healthy(): boolean;
69
+ isTiled(): boolean;
70
+ private sourceSpec;
71
+ applyTerrain(opts?: {
72
+ ease?: boolean;
73
+ }): void;
74
+ private disableTerrain;
66
75
  hasBounds(): boolean;
67
76
  zoomTo(): Promise<void>;
68
77
  addLayers(before?: string): Promise<void>;
@@ -88,8 +97,10 @@ export default class Overlay {
88
97
  mode?: string;
89
98
  mode_id?: string;
90
99
  encoding?: 'mapbox' | 'terrarium' | null;
100
+ attribution?: string;
91
101
  url?: string;
92
102
  token?: string;
103
+ tilejson?: OverlayTileJSON | null;
93
104
  styles?: Array<LayerSpecification>;
94
105
  }, opts?: {
95
106
  before?: string;
@@ -108,7 +119,6 @@ export default class Overlay {
108
119
  pos?: number;
109
120
  visible?: boolean;
110
121
  opacity?: number;
111
- encoding?: 'mapbox' | 'terrarium' | null;
112
122
  }): Promise<void>;
113
123
  save(): Promise<void>;
114
124
  toDBOverlay(): DBOverlay;
@@ -1,7 +1,6 @@
1
1
  import { type Observable } from 'dexie';
2
2
  import { type DBOverlay } from '../database.ts';
3
3
  import type { paths } from '@cloudtak/api-types';
4
- import type { ProfileOverlay } from '../types.ts';
5
4
  import BaseInterface from './interface.ts';
6
5
  import Overlay from './overlay-class.ts';
7
6
  import type { BaseInterface_ListOptions, BaseInterface_FromOptions } from './interface.ts';
@@ -65,8 +64,8 @@ export default class OverlayManager extends BaseInterface {
65
64
  } ? Overlay_Page : DBOverlay[]>;
66
65
  static from(id: string, opts?: BaseInterface_FromOptions): Promise<DBOverlay | undefined>;
67
66
  static liveFrom(id: string): Observable<DBOverlay | undefined>;
68
- static get(id: string | number): Promise<ProfileOverlay>;
69
- static generate(body: paths['/api/profile/overlay']['post']['requestBody']['content']['application/json']): Promise<ProfileOverlay>;
67
+ static get(id: string | number): Promise<DBOverlay>;
68
+ static generate(body: paths['/api/profile/overlay']['post']['requestBody']['content']['application/json']): Promise<DBOverlay>;
70
69
  static update(id: string, body: paths['/api/profile/overlay/{:overlay}']['patch']['requestBody']['content']['application/json']): Promise<void>;
71
70
  static sync(): Promise<void>;
72
71
  static delete(id: string, opts?: Overlay_DeleteOptions): Promise<void>;
@@ -7,6 +7,7 @@ import COT from '../base/cot.ts';
7
7
  import RoutingControl from '../lib/routing/main.ts';
8
8
  import type { NavigationState, NavigationDirection } from '../lib/routing/main.ts';
9
9
  import { LocationState } from '../utils/events.ts';
10
+ import Overlay from '../base/overlay-class.ts';
10
11
  import Subscription from '../base/subscription.ts';
11
12
  import * as mapgl from 'maplibre-gl';
12
13
  import type Atlas from '../workers/atlas.ts';
@@ -119,8 +120,8 @@ export declare const useMapStore: import("pinia").StoreDefinition<"cloudtak", {
119
120
  startWorker: () => void;
120
121
  destroy: () => Promise<void>;
121
122
  makeActiveMission: (mission?: Subscription) => Promise<void>;
122
- addTerrain: () => Promise<void>;
123
- removeTerrain: () => void;
123
+ terrainOverlay: () => Overlay | undefined;
124
+ toggleTerrain: () => Promise<void>;
124
125
  returnHome: () => Promise<void>;
125
126
  /**
126
127
  * Trigger a rerender of the underlying GeoJSON Features
@@ -0,0 +1,10 @@
1
+ import type { OverlayTileJSON } from '../../types.ts';
2
+ export type { OverlayTileJSON };
3
+ type TileJSONEntry = {
4
+ url: string;
5
+ tilejson: OverlayTileJSON | null;
6
+ };
7
+ export declare function tileJSONSourceUrl(id: number): string;
8
+ export declare function setOverlayTileJSON(id: number, entry: TileJSONEntry): void;
9
+ export declare function clearOverlayTileJSON(id: number): void;
10
+ export declare function registerTileJSONProtocol(): void;
@@ -58,21 +58,21 @@ export type VideoConnection = paths["/api/marti/video/{:uid}"]["get"]["responses
58
58
  export type VideoConnectionFeed = paths["/api/marti/video/{:uid}"]["get"]["responses"]["200"]["content"]["application/json"]["feeds"][0];
59
59
  export type VideoConnection_Create = paths["/api/marti/video"]["post"]["requestBody"]["content"]["application/json"];
60
60
  export type VideoConnectionList = paths["/api/marti/video"]["get"]["responses"]["200"]["content"]["application/json"];
61
- export type Mission = paths["/api/marti/missions/{:name}"]["get"]["responses"]["200"]["content"]["application/json"];
61
+ export type Mission = paths["/api/marti/missions/{:guid}"]["get"]["responses"]["200"]["content"]["application/json"];
62
62
  export type Mission_Create = paths["/api/marti/mission"]["post"]["requestBody"]["content"]["application/json"];
63
63
  export type MissionList = paths["/api/marti/mission"]["get"]["responses"]["200"]["content"]["application/json"];
64
64
  export type MissionInvite = paths["/api/marti/mission"]["get"]["responses"]["200"]["content"]["application/json"]["invites"][0];
65
- export type MissionRole = paths["/api/marti/missions/{:name}/role"]["get"]["responses"]["200"]["content"]["application/json"];
65
+ export type MissionRole = paths["/api/marti/missions/{:guid}/role"]["get"]["responses"]["200"]["content"]["application/json"];
66
66
  export type MissionRoleType = MissionRole["type"];
67
- export type MissionLog = paths["/api/marti/missions/{:name}/log/{:logid}"]["patch"]["responses"]["200"]["content"]["application/json"]["data"];
68
- export type MissionLogList = paths["/api/marti/missions/{:name}/log"]["get"]["responses"]["200"]["content"]["application/json"];
69
- export type MissionLayer = paths["/api/marti/missions/{:name}/layer/{:layerid}"]["get"]["responses"]["200"]["content"]["application/json"]["data"];
70
- export type MissionLayer_Create = paths["/api/marti/missions/{:name}/layer"]["post"]["requestBody"]["content"]["application/json"];
71
- export type MissionLayer_Update = paths["/api/marti/missions/{:name}/layer/{:uid}"]["patch"]["requestBody"]["content"]["application/json"];
72
- export type MissionLayerList = paths["/api/marti/missions/{:name}/layer"]["get"]["responses"]["200"]["content"]["application/json"];
73
- export type MissionChanges = paths["/api/marti/missions/{:name}/changes"]["get"]["responses"]["200"]["content"]["application/json"];
67
+ export type MissionLog = paths["/api/marti/missions/{:guid}/log/{:logid}"]["patch"]["responses"]["200"]["content"]["application/json"]["data"];
68
+ export type MissionLogList = paths["/api/marti/missions/{:guid}/log"]["get"]["responses"]["200"]["content"]["application/json"];
69
+ export type MissionLayer = paths["/api/marti/missions/{:guid}/layer/{:layerid}"]["get"]["responses"]["200"]["content"]["application/json"]["data"];
70
+ export type MissionLayer_Create = paths["/api/marti/missions/{:guid}/layer"]["post"]["requestBody"]["content"]["application/json"];
71
+ export type MissionLayer_Update = paths["/api/marti/missions/{:guid}/layer/{:uid}"]["patch"]["requestBody"]["content"]["application/json"];
72
+ export type MissionLayerList = paths["/api/marti/missions/{:guid}/layer"]["get"]["responses"]["200"]["content"]["application/json"];
73
+ export type MissionChanges = paths["/api/marti/missions/{:guid}/changes"]["get"]["responses"]["200"]["content"]["application/json"];
74
74
  export type MissionChange = MissionChanges["data"][0];
75
- export type MissionSubscriptions = paths["/api/marti/missions/{:name}/subscriptions/roles"]["get"]["responses"]["200"]["content"]["application/json"]["data"];
75
+ export type MissionSubscriptions = paths["/api/marti/missions/{:guid}/subscriptions/roles"]["get"]["responses"]["200"]["content"]["application/json"]["data"];
76
76
  export type Server_Update = paths["/api/server"]["patch"]["requestBody"]["content"]["application/json"];
77
77
  export type Server = paths["/api/server"]["get"]["responses"]["200"]["content"]["application/json"];
78
78
  export type Login = paths["/api/login"]["get"]["responses"]["200"]["content"]["application/json"];
@@ -169,6 +169,7 @@ export type ProfileOverlay = paths["/api/profile/overlay/{:overlay}"]["get"]["re
169
169
  export type ProfileOverlayList = paths["/api/profile/overlay"]["get"]["responses"]["200"]["content"]["application/json"];
170
170
  export type ProfileOverlay_Create = paths["/api/profile/overlay"]["post"]["requestBody"]["content"]["application/json"];
171
171
  export type ProfileOverlay_Update = paths["/api/profile/overlay/{:overlay}"]["patch"]["requestBody"]["content"]["application/json"];
172
+ export type OverlayTileJSON = NonNullable<ProfileOverlay["tilejson"]>;
172
173
  export type ProfileTokenList = paths["/api/profile/token"]["get"]["responses"]["200"]["content"]["application/json"];
173
174
  export type ProfileToken = ProfileTokenList["items"][0];
174
175
  export type ProfilePagingList = paths["/api/profile/paging"]["get"]["responses"]["200"]["content"]["application/json"];
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Append the session token to tile URLs on CloudTAK hosts only - never third
3
+ * party tile servers. String-edited: `URL` percent-encodes `{z}/{x}/{y}`.
4
+ */
5
+ export declare function authorizeTileJSON<T extends {
6
+ tiles: string[];
7
+ }>(tilejson: T, token: string | undefined, hosts: Iterable<string>): T;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/cloudtak",
3
3
  "type": "module",
4
- "version": "13.75.1",
4
+ "version": "13.77.0",
5
5
  "types": "dist/types/plugin.d.ts",
6
6
  "files": [
7
7
  "dist/types"