@tak-ps/cloudtak 13.67.1 → 13.68.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,13 @@
1
1
  import { type Observable } from 'dexie';
2
2
  import type { Group, GroupChannel } from '../types.ts';
3
- export default class GroupManager {
3
+ import BaseInterface from './interface.ts';
4
+ import type { BaseInterface_ListOptions, BaseInterface_FromOptions } from './interface.ts';
5
+ export type Group_ListOptions = BaseInterface_ListOptions & {
6
+ active?: boolean;
7
+ direction?: string;
8
+ };
9
+ export default class GroupManager extends BaseInterface {
10
+ static readonly listCacheKey = "group";
4
11
  /**
5
12
  * Merge an array of API Group entries (each with a single direction string)
6
13
  * into GroupChannel entries keyed by name with direction as a string array
@@ -11,22 +18,28 @@ export default class GroupManager {
11
18
  * API Group entries (each with a single direction string)
12
19
  */
13
20
  static explode(channels: GroupChannel[]): Group[];
14
- static live(opts?: {
15
- active?: boolean;
16
- direction?: string;
17
- }): Observable<GroupChannel[]>;
18
- static list(opts?: {
19
- active?: boolean;
20
- direction?: string;
21
- }): Promise<GroupChannel[]>;
21
+ static count(opts?: Omit<Group_ListOptions, 'sync'>): Promise<number>;
22
+ static liveCount(opts?: Omit<Group_ListOptions, 'sync'>): Observable<number>;
23
+ static liveList(opts?: Group_ListOptions): Observable<GroupChannel[]>;
24
+ static list(opts?: Group_ListOptions): Promise<GroupChannel[]>;
22
25
  /**
23
26
  * Get a single GroupChannel by name.
24
27
  */
25
- static get(name: string): Promise<GroupChannel | undefined>;
28
+ static from(name: string, opts?: BaseInterface_FromOptions): Promise<GroupChannel | undefined>;
29
+ static liveFrom(name: string): Observable<GroupChannel | undefined>;
26
30
  /**
27
31
  * Put one or more GroupChannels into the database.
28
32
  */
29
33
  static put(channels: GroupChannel[] | GroupChannel): Promise<void>;
30
- static sync(): Promise<GroupChannel[]>;
31
- static update(channels: GroupChannel[]): Promise<GroupChannel[]>;
34
+ static sync(): Promise<void>;
35
+ /**
36
+ * Replace the user's full channel set via the API.
37
+ *
38
+ * The Marti endpoint is a bulk PUT of every channel, so this cannot be
39
+ * expressed as BaseInterface.update(id, data) - it is a whole-collection
40
+ * write rather than a single-item update.
41
+ */
42
+ static updateAll(channels: GroupChannel[]): Promise<GroupChannel[]>;
43
+ private static cache;
44
+ private static query;
32
45
  }
@@ -33,7 +33,7 @@ export default class IconsetManager extends BaseInterface {
33
33
  static from(uid: string, opts?: BaseInterface_FromOptions): Promise<DBIconset | undefined>;
34
34
  static liveFrom(uid: string): Observable<DBIconset | undefined>;
35
35
  static get(uid: string): Promise<Iconset>;
36
- static create(body: paths['/api/iconset']['post']['requestBody']['content']['application/json']): Promise<Iconset>;
36
+ static generate(body: paths['/api/iconset']['post']['requestBody']['content']['application/json']): Promise<Iconset>;
37
37
  static update(uid: string, body: paths['/api/iconset/{:iconset}']['patch']['requestBody']['content']['application/json']): Promise<void>;
38
38
  static regenerate(uid: string): Promise<void>;
39
39
  static download(uid: string): Promise<void>;
@@ -1,7 +1,11 @@
1
1
  import { NotificationType } from '../database.ts';
2
+ import { type Observable } from 'dexie';
2
3
  import type { DBNotification } from '../database.ts';
4
+ import BaseInterface from './interface.ts';
5
+ import type { BaseInterface_FromOptions } from './interface.ts';
3
6
  export { NotificationType };
4
- export default class TAKNotification {
7
+ export default class TAKNotification extends BaseInterface {
8
+ static readonly listCacheKey = "notification";
5
9
  id: string;
6
10
  type: NotificationType;
7
11
  name: string;
@@ -18,7 +22,8 @@ export default class TAKNotification {
18
22
  /**
19
23
  * Return a Notification instance if one already exists in the local DB,
20
24
  */
21
- static from(id: string): Promise<TAKNotification | null>;
25
+ static from(id: string, opts?: BaseInterface_FromOptions): Promise<TAKNotification | null>;
26
+ static liveFrom(id: string): Observable<DBNotification | undefined>;
22
27
  static create(type: NotificationType, name: string, body: string, url: string, toast?: boolean): Promise<TAKNotification>;
23
28
  static update(id: string, opts: {
24
29
  read?: boolean;
@@ -35,5 +40,12 @@ export default class TAKNotification {
35
40
  static existsByUrl(url: string): Promise<boolean>;
36
41
  static countByType(type: NotificationType): Promise<number>;
37
42
  static count(): Promise<number>;
43
+ static liveCount(): Observable<number>;
38
44
  static list(): Promise<DBNotification[]>;
45
+ static liveList(): Observable<DBNotification[]>;
46
+ /**
47
+ * Notifications are generated locally and have no server-side collection to
48
+ * pull from - syncing only stamps the cache so hydrated() reports a value.
49
+ */
50
+ static sync(): Promise<void>;
39
51
  }
@@ -56,7 +56,7 @@ export default class OverlayManager extends BaseInterface {
56
56
  static from(id: string, opts?: BaseInterface_FromOptions): Promise<DBOverlay | undefined>;
57
57
  static liveFrom(id: string): Observable<DBOverlay | undefined>;
58
58
  static get(id: string | number): Promise<ProfileOverlay>;
59
- static create(body: paths['/api/profile/overlay']['post']['requestBody']['content']['application/json']): Promise<ProfileOverlay>;
59
+ static generate(body: paths['/api/profile/overlay']['post']['requestBody']['content']['application/json']): Promise<ProfileOverlay>;
60
60
  static update(id: string, body: paths['/api/profile/overlay/{:overlay}']['patch']['requestBody']['content']['application/json']): Promise<void>;
61
61
  static sync(): Promise<void>;
62
62
  static delete(id: string, opts?: Overlay_DeleteOptions): Promise<void>;
@@ -1,4 +1,4 @@
1
- import { type CoordMode } from '../../../base/utils/coordinateFormat.ts';
1
+ import { type CoordMode } from '../../../utils/coordinateFormat.ts';
2
2
  declare const __VLS_export: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
3
3
  label: {
4
4
  type: StringConstructor;
@@ -1,4 +1,4 @@
1
- import type { PathNode } from '../../../base/path-manager.ts';
1
+ import type { PathNode } from '../../../utils/path-manager.ts';
2
2
  declare const _default: typeof __VLS_export;
3
3
  export default _default;
4
4
  declare const __VLS_export: import("vue").DefineComponent<{
@@ -6,7 +6,7 @@ import * as Comlink from 'comlink';
6
6
  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
- import { LocationState } from '../base/events.ts';
9
+ import { LocationState } from '../utils/events.ts';
10
10
  import Subscription from '../base/subscription.ts';
11
11
  import * as mapgl from 'maplibre-gl';
12
12
  import type Atlas from '../workers/atlas.ts';
@@ -211,7 +211,6 @@ export type AdminLayerUpdate = {
211
211
  latest_version: string | null;
212
212
  has_update: boolean;
213
213
  has_stack: boolean;
214
- template: boolean;
215
214
  connection: number | null;
216
215
  parent_name: string | null;
217
216
  };
@@ -1,5 +1,5 @@
1
1
  import type Atlas from './atlas.ts';
2
- import { LocationState } from '../base/events.ts';
2
+ import { LocationState } from '../utils/events.ts';
3
3
  import type { GroupChannel, Server, Profile_Update, FeaturePropertyCreator } from '../types.ts';
4
4
  import ProfileConfig from '../base/profile.ts';
5
5
  export type ProfileLocationState = {
@@ -1,4 +1,4 @@
1
- import type { WorkerMessage } from '../base/events.ts';
1
+ import type { WorkerMessage } from '../utils/events.ts';
2
2
  import * as Comlink from 'comlink';
3
3
  import AtlasProfile from './atlas-profile.ts';
4
4
  import AtlasDatabase from './atlas-database.ts';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tak-ps/cloudtak",
3
3
  "type": "module",
4
- "version": "13.67.1",
4
+ "version": "13.68.0",
5
5
  "types": "dist/types/plugin.d.ts",
6
6
  "files": [
7
7
  "dist/types"
File without changes
File without changes
File without changes
File without changes
File without changes