@tak-ps/cloudtak 13.16.1 → 13.17.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.
- package/dist/types/src/base/feature.d.ts +53 -0
- package/dist/types/src/base/interface.d.ts +1 -1
- package/dist/types/src/components/CloudTAK/Menu/MenuItemCard.vue.d.ts +3 -3
- package/dist/types/src/components/CloudTAK/util/CopyField.vue.d.ts +2 -2
- package/dist/types/src/session.d.ts +33 -0
- package/package.json +1 -1
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FeatureManager provides methods for managing Features in both the API
|
|
3
|
+
* and the dexie database. It is designed implement BaseInterface and
|
|
4
|
+
* provides additional methods specific to the Feature entity, such as counting,
|
|
5
|
+
* listing with filters, downloading, and deleting features.
|
|
6
|
+
*
|
|
7
|
+
* Note that it currently does not handle re-rendering calls in the map stack and therefore
|
|
8
|
+
* must be used in conjunction with the cot.ts module or atlas-database.ts to ensure
|
|
9
|
+
* that re-rendering is triggered.
|
|
10
|
+
*/
|
|
11
|
+
import { type Observable } from 'dexie';
|
|
12
|
+
import { type DBFeature } from '../database.ts';
|
|
13
|
+
import type { paths } from '@cloudtak/api-types';
|
|
14
|
+
import BaseInterface from './interface.ts';
|
|
15
|
+
import type { BaseInterface_ListOptions, BaseInterface_FromOptions } from './interface.ts';
|
|
16
|
+
type FeatureListQuery = NonNullable<paths['/api/profile/feature']['get']['parameters']['query']>;
|
|
17
|
+
type FeatureDeleteQuery = NonNullable<paths['/api/profile/feature']['delete']['parameters']['query']>;
|
|
18
|
+
export type Feature_ExportFormat = FeatureListQuery['format'];
|
|
19
|
+
export type Feature_ListOptions = BaseInterface_ListOptions & {
|
|
20
|
+
path?: string;
|
|
21
|
+
filter?: string;
|
|
22
|
+
};
|
|
23
|
+
export type Feature_FromOptions = BaseInterface_FromOptions;
|
|
24
|
+
export type Feature_DeleteOptions = {
|
|
25
|
+
path?: FeatureDeleteQuery['path'];
|
|
26
|
+
permanent?: FeatureDeleteQuery['permanent'];
|
|
27
|
+
};
|
|
28
|
+
export type Feature_DownloadOptions = {
|
|
29
|
+
format?: Feature_ExportFormat;
|
|
30
|
+
};
|
|
31
|
+
export default class FeatureManager extends BaseInterface {
|
|
32
|
+
static readonly listCacheKey = "feature";
|
|
33
|
+
static count(): Promise<number>;
|
|
34
|
+
static liveCount(): Observable<number>;
|
|
35
|
+
static liveList(): Observable<DBFeature[]>;
|
|
36
|
+
static list(opts?: Feature_ListOptions): Promise<DBFeature[]>;
|
|
37
|
+
static from(id: string, opts?: Feature_FromOptions): Promise<DBFeature | undefined>;
|
|
38
|
+
static liveFrom(id: string): Observable<DBFeature | undefined>;
|
|
39
|
+
/**
|
|
40
|
+
* Export the profile features from the server and trigger a browser download.
|
|
41
|
+
*
|
|
42
|
+
* @param opts.format - The export format to request (defaults to GeoJSON)
|
|
43
|
+
*/
|
|
44
|
+
static download(opts?: Feature_DownloadOptions): Promise<void>;
|
|
45
|
+
/**
|
|
46
|
+
* Delete profile features on the server.
|
|
47
|
+
*
|
|
48
|
+
* Without a `path`, all of the user's features are removed. By default features
|
|
49
|
+
* are archived (soft deleted) unless `permanent` is set.
|
|
50
|
+
*/
|
|
51
|
+
static delete(opts?: Feature_DeleteOptions): Promise<void>;
|
|
52
|
+
}
|
|
53
|
+
export {};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Component, PropType } from 'vue';
|
|
2
2
|
type LayoutVariant = 'list' | 'tiles';
|
|
3
|
-
declare var
|
|
3
|
+
declare var __VLS_11: {}, __VLS_18: {};
|
|
4
4
|
type __VLS_Slots = {} & {
|
|
5
|
-
prefix?: (props: typeof
|
|
5
|
+
prefix?: (props: typeof __VLS_11) => any;
|
|
6
6
|
} & {
|
|
7
|
-
default?: (props: typeof
|
|
7
|
+
default?: (props: typeof __VLS_18) => any;
|
|
8
8
|
};
|
|
9
9
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
10
10
|
icon: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
declare var
|
|
1
|
+
declare var __VLS_25: {};
|
|
2
2
|
type __VLS_Slots = {} & {
|
|
3
|
-
default?: (props: typeof
|
|
3
|
+
default?: (props: typeof __VLS_25) => any;
|
|
4
4
|
};
|
|
5
5
|
declare const __VLS_base: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
6
6
|
mode: {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export default class Session {
|
|
2
|
+
/**
|
|
3
|
+
* Persist the server URL into the KV store (and Preferences on native).
|
|
4
|
+
*/
|
|
5
|
+
static serverUrl(serverUrl: string): Promise<void>;
|
|
6
|
+
/**
|
|
7
|
+
* Persist login details for the authenticated user.
|
|
8
|
+
*/
|
|
9
|
+
static login(opts: {
|
|
10
|
+
token: string;
|
|
11
|
+
username: string;
|
|
12
|
+
}): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Return the username of the existing session, if one is present.
|
|
15
|
+
*/
|
|
16
|
+
static username(): Promise<string | undefined>;
|
|
17
|
+
/**
|
|
18
|
+
* Remove the active token from all stores. The Dexie database is left
|
|
19
|
+
* intact so that a re-login (e.g. after an expired token) does not need to
|
|
20
|
+
* resynchronize all data.
|
|
21
|
+
*/
|
|
22
|
+
static clear(): Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* Fully clear the session - removes the token and wipes the Dexie database.
|
|
25
|
+
* Used on explicit sign-out or when a different user logs in.
|
|
26
|
+
*
|
|
27
|
+
* Dexie's `delete()`/`open()` is used (instead of
|
|
28
|
+
* `indexedDB.deleteDatabase`) so the live connection is closed cleanly and
|
|
29
|
+
* immediately reopened, leaving the database ready for subsequent reads and
|
|
30
|
+
* writes instead of hanging on a blocked delete request.
|
|
31
|
+
*/
|
|
32
|
+
static destroy(): Promise<void>;
|
|
33
|
+
}
|