c3nav 3.4.7 → 3.5.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/README.md +1 -1
- package/dist/Endpoints.d.ts +44 -0
- package/dist/Endpoints.js +165 -126
- package/dist/api/EditorAPI.d.ts +7 -5
- package/dist/api/EditorAPI.js +42 -7
- package/dist/api/LocationsAPI.d.ts +1 -1
- package/dist/api/LocationsAPI.js +3 -2
- package/dist/api/MapAPI.d.ts +16 -1
- package/dist/api/MapAPI.js +145 -0
- package/dist/api/MeshAPI.d.ts +10 -0
- package/dist/api/MeshAPI.js +64 -0
- package/dist/api/PositioningAPI.d.ts +8 -0
- package/dist/api/PositioningAPI.js +34 -0
- package/dist/api/RoutingAPI.d.ts +5 -1
- package/dist/api/RoutingAPI.js +28 -0
- package/dist/api/SessionAPI.d.ts +4 -5
- package/dist/api/SessionAPI.js +15 -7
- package/dist/api/UpdatesAPI.d.ts +2 -4
- package/dist/api/UpdatesAPI.js +9 -8
- package/dist/api/index.d.ts +2 -0
- package/dist/api/index.js +2 -0
- package/dist/c3nav.d.ts +3 -1
- package/dist/c3nav.js +8 -3
- package/dist/interfaces/API.d.ts +3 -1
- package/dist/interfaces/Editor.d.ts +8 -1
- package/dist/interfaces/Map.d.ts +54 -0
- package/dist/interfaces/Map.js +2 -0
- package/dist/interfaces/Mesh.d.ts +24 -0
- package/dist/interfaces/Mesh.js +2 -0
- package/dist/interfaces/Positioning.d.ts +13 -0
- package/dist/interfaces/Positioning.js +2 -0
- package/dist/interfaces/Routing.d.ts +46 -0
- package/dist/interfaces/Session.d.ts +6 -0
- package/dist/interfaces/Updates.d.ts +3 -0
- package/dist/interfaces/index.d.ts +3 -0
- package/dist/interfaces/index.js +3 -0
- package/package.json +7 -4
package/dist/api/MapAPI.js
CHANGED
|
@@ -24,5 +24,150 @@ class MapAPI extends APIBase_1.APIBase {
|
|
|
24
24
|
return data;
|
|
25
25
|
});
|
|
26
26
|
}
|
|
27
|
+
getLegend(themeId) {
|
|
28
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
29
|
+
const endpoint = Endpoints_1.Endpoint.Map.legend(themeId);
|
|
30
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
31
|
+
return data;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
getLoad() {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const endpoint = Endpoints_1.Endpoint.Map.load();
|
|
37
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
38
|
+
return data;
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
getLocation(idOrSlug_1) {
|
|
42
|
+
return __awaiter(this, arguments, void 0, function* (idOrSlug, options = {}) {
|
|
43
|
+
const params = new URLSearchParams();
|
|
44
|
+
if (options.geometry !== undefined) {
|
|
45
|
+
params.set('geometry', String(options.geometry));
|
|
46
|
+
}
|
|
47
|
+
if (options.showRedirects !== undefined) {
|
|
48
|
+
params.set('show_redirects', String(options.showRedirects));
|
|
49
|
+
}
|
|
50
|
+
const endpoint = typeof idOrSlug === 'string'
|
|
51
|
+
? Endpoints_1.Endpoint.Map.locationBySlug(idOrSlug, options.full)
|
|
52
|
+
: Endpoints_1.Endpoint.Map.locationById(idOrSlug, options.full);
|
|
53
|
+
const requestPath = params.size > 0 ? `${endpoint}?${params.toString()}` : endpoint;
|
|
54
|
+
const { data } = yield this.apiClient.get(requestPath);
|
|
55
|
+
return data;
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
getLocationDisplay(idOrSlug) {
|
|
59
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
+
const endpoint = typeof idOrSlug === 'string'
|
|
61
|
+
? Endpoints_1.Endpoint.Map.locationDisplayBySlug(idOrSlug)
|
|
62
|
+
: Endpoints_1.Endpoint.Map.locationDisplayById(idOrSlug);
|
|
63
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
64
|
+
return data;
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
getLocationGeometry(idOrSlug) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const endpoint = typeof idOrSlug === 'string'
|
|
70
|
+
? Endpoints_1.Endpoint.Map.locationGeometryBySlug(idOrSlug)
|
|
71
|
+
: Endpoints_1.Endpoint.Map.locationGeometryById(idOrSlug);
|
|
72
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
73
|
+
return data;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
getLocations() {
|
|
77
|
+
return __awaiter(this, arguments, void 0, function* (options = {}) {
|
|
78
|
+
const params = new URLSearchParams();
|
|
79
|
+
if (options.geometry !== undefined) {
|
|
80
|
+
params.set('geometry', String(options.geometry));
|
|
81
|
+
}
|
|
82
|
+
if (options.searchable !== undefined) {
|
|
83
|
+
params.set('searchable', String(options.searchable));
|
|
84
|
+
}
|
|
85
|
+
const endpoint = Endpoints_1.Endpoint.Map.locations(false);
|
|
86
|
+
const requestPath = params.size > 0 ? `${endpoint}?${params.toString()}` : endpoint;
|
|
87
|
+
const { data } = yield this.apiClient.get(requestPath);
|
|
88
|
+
return data;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
getLocationsFull() {
|
|
92
|
+
return __awaiter(this, arguments, void 0, function* (options = {}) {
|
|
93
|
+
const params = new URLSearchParams();
|
|
94
|
+
if (options.geometry !== undefined) {
|
|
95
|
+
params.set('geometry', String(options.geometry));
|
|
96
|
+
}
|
|
97
|
+
if (options.searchable !== undefined) {
|
|
98
|
+
params.set('searchable', String(options.searchable));
|
|
99
|
+
}
|
|
100
|
+
const endpoint = Endpoints_1.Endpoint.Map.locations(true);
|
|
101
|
+
const requestPath = params.size > 0 ? `${endpoint}?${params.toString()}` : endpoint;
|
|
102
|
+
const { data } = yield this.apiClient.get(requestPath);
|
|
103
|
+
return data;
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
getMyPositions() {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
const endpoint = Endpoints_1.Endpoint.Map.myPositions();
|
|
109
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
110
|
+
return data;
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
getPositionById(positionId) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
const endpoint = Endpoints_1.Endpoint.Map.position(positionId);
|
|
116
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
117
|
+
return data;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
getProjection() {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
const endpoint = Endpoints_1.Endpoint.Map.projection();
|
|
123
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
124
|
+
return data;
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
getQuests(questType, level) {
|
|
128
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
129
|
+
const params = new URLSearchParams();
|
|
130
|
+
if (questType) {
|
|
131
|
+
params.set('quest_type', questType);
|
|
132
|
+
}
|
|
133
|
+
if (level !== undefined) {
|
|
134
|
+
params.set('level', String(level));
|
|
135
|
+
}
|
|
136
|
+
const endpoint = Endpoints_1.Endpoint.Map.quests();
|
|
137
|
+
const requestPath = params.size > 0 ? `${endpoint}?${params.toString()}` : endpoint;
|
|
138
|
+
const { data } = yield this.apiClient.get(requestPath);
|
|
139
|
+
return data;
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
getSettings() {
|
|
143
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
const endpoint = Endpoints_1.Endpoint.Map.settings();
|
|
145
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
146
|
+
return data;
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
getWifiData() {
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
const endpoint = Endpoints_1.Endpoint.Map.wifidata();
|
|
152
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
153
|
+
return data;
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
setPosition(positionId, coordinatesId, timeout) {
|
|
157
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
158
|
+
const endpoint = Endpoints_1.Endpoint.Map.position(positionId);
|
|
159
|
+
const { data } = yield this.apiClient.put(endpoint, {
|
|
160
|
+
coordinates_id: coordinatesId,
|
|
161
|
+
timeout,
|
|
162
|
+
});
|
|
163
|
+
return data;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
updateLoad(aps) {
|
|
167
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
168
|
+
const endpoint = Endpoints_1.Endpoint.Map.load();
|
|
169
|
+
yield this.apiClient.post(endpoint, { aps });
|
|
170
|
+
});
|
|
171
|
+
}
|
|
27
172
|
}
|
|
28
173
|
exports.MapAPI = MapAPI;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
+
import type { ClientOptions, MeshFirmware, MeshListResponse, MeshMap, MeshMessage } from '../interfaces';
|
|
3
|
+
import { APIBase } from './APIBase';
|
|
4
|
+
export declare class MeshAPI extends APIBase {
|
|
5
|
+
constructor(apiClient: APIClient, options: ClientOptions);
|
|
6
|
+
getFirmwareById(firmwareId: number): Promise<MeshFirmware>;
|
|
7
|
+
getMap(levelId: number): Promise<MeshMap>;
|
|
8
|
+
listFirmwares(limit?: number, offset?: number): Promise<MeshListResponse<MeshFirmware>>;
|
|
9
|
+
listMessages(limit?: number, offset?: number): Promise<MeshListResponse<MeshMessage>>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.MeshAPI = void 0;
|
|
13
|
+
const Endpoints_1 = require("../Endpoints");
|
|
14
|
+
const APIBase_1 = require("./APIBase");
|
|
15
|
+
class MeshAPI extends APIBase_1.APIBase {
|
|
16
|
+
constructor(apiClient, options) {
|
|
17
|
+
super(apiClient, options);
|
|
18
|
+
}
|
|
19
|
+
getFirmwareById(firmwareId) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const endpoint = Endpoints_1.Endpoint.Mesh.firmwareById(firmwareId);
|
|
22
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
23
|
+
return data;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
getMap(levelId) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const endpoint = Endpoints_1.Endpoint.Mesh.map(levelId);
|
|
29
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
30
|
+
return data;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
listFirmwares(limit, offset) {
|
|
34
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
const params = new URLSearchParams();
|
|
36
|
+
if (limit !== undefined) {
|
|
37
|
+
params.set('limit', String(limit));
|
|
38
|
+
}
|
|
39
|
+
if (offset !== undefined) {
|
|
40
|
+
params.set('offset', String(offset));
|
|
41
|
+
}
|
|
42
|
+
const endpoint = Endpoints_1.Endpoint.Mesh.firmwares();
|
|
43
|
+
const requestPath = params.size > 0 ? `${endpoint}?${params.toString()}` : endpoint;
|
|
44
|
+
const { data } = yield this.apiClient.get(requestPath);
|
|
45
|
+
return data;
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
listMessages(limit, offset) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const params = new URLSearchParams();
|
|
51
|
+
if (limit !== undefined) {
|
|
52
|
+
params.set('limit', String(limit));
|
|
53
|
+
}
|
|
54
|
+
if (offset !== undefined) {
|
|
55
|
+
params.set('offset', String(offset));
|
|
56
|
+
}
|
|
57
|
+
const endpoint = Endpoints_1.Endpoint.Mesh.messages();
|
|
58
|
+
const requestPath = params.size > 0 ? `${endpoint}?${params.toString()}` : endpoint;
|
|
59
|
+
const { data } = yield this.apiClient.get(requestPath);
|
|
60
|
+
return data;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.MeshAPI = MeshAPI;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
+
import type { ClientOptions, PositioningLocateRequest, PositioningLocateResponse } from '../interfaces';
|
|
3
|
+
import { APIBase } from './APIBase';
|
|
4
|
+
export declare class PositioningAPI extends APIBase {
|
|
5
|
+
constructor(apiClient: APIClient, options: ClientOptions);
|
|
6
|
+
locate(payload: PositioningLocateRequest): Promise<PositioningLocateResponse>;
|
|
7
|
+
locateTest(): Promise<PositioningLocateResponse>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.PositioningAPI = void 0;
|
|
13
|
+
const Endpoints_1 = require("../Endpoints");
|
|
14
|
+
const APIBase_1 = require("./APIBase");
|
|
15
|
+
class PositioningAPI extends APIBase_1.APIBase {
|
|
16
|
+
constructor(apiClient, options) {
|
|
17
|
+
super(apiClient, options);
|
|
18
|
+
}
|
|
19
|
+
locate(payload) {
|
|
20
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
21
|
+
const endpoint = Endpoints_1.Endpoint.Positioning.locate();
|
|
22
|
+
const { data } = yield this.apiClient.post(endpoint, payload);
|
|
23
|
+
return data;
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
locateTest() {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
const endpoint = Endpoints_1.Endpoint.Positioning.locateTest();
|
|
29
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
30
|
+
return data;
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.PositioningAPI = PositioningAPI;
|
package/dist/api/RoutingAPI.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
-
import type { ClientOptions, Routing } from '../interfaces/';
|
|
2
|
+
import type { ClientOptions, Routing, RoutingOptions, RoutingOptionsFormItem, RoutingRequest } from '../interfaces/';
|
|
3
3
|
import { APIBase } from './APIBase';
|
|
4
4
|
export declare class RoutingAPI extends APIBase {
|
|
5
5
|
constructor(apiClient: APIClient, options: ClientOptions);
|
|
@@ -8,4 +8,8 @@ export declare class RoutingAPI extends APIBase {
|
|
|
8
8
|
*/
|
|
9
9
|
getById(id: number): Promise<Routing>;
|
|
10
10
|
getList(): Promise<Routing[]>;
|
|
11
|
+
getOptions(): Promise<RoutingOptions>;
|
|
12
|
+
getOptionsForm(): Promise<RoutingOptionsFormItem[]>;
|
|
13
|
+
postRoute(request: RoutingRequest): Promise<Routing>;
|
|
14
|
+
setOptions(options: Partial<RoutingOptions>): Promise<RoutingOptions>;
|
|
11
15
|
}
|
package/dist/api/RoutingAPI.js
CHANGED
|
@@ -33,5 +33,33 @@ class RoutingAPI extends APIBase_1.APIBase {
|
|
|
33
33
|
return data;
|
|
34
34
|
});
|
|
35
35
|
}
|
|
36
|
+
getOptions() {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const endpoint = Endpoints_1.Endpoint.Routing.options();
|
|
39
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
40
|
+
return data;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
getOptionsForm() {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const endpoint = Endpoints_1.Endpoint.Routing.optionsForm();
|
|
46
|
+
const { data } = yield this.apiClient.get(endpoint);
|
|
47
|
+
return data;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
postRoute(request) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const endpoint = Endpoints_1.Endpoint.Routing.route();
|
|
53
|
+
const { data } = yield this.apiClient.post(endpoint, request);
|
|
54
|
+
return data;
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
setOptions(options) {
|
|
58
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
59
|
+
const endpoint = Endpoints_1.Endpoint.Routing.options();
|
|
60
|
+
const { data } = yield this.apiClient.put(endpoint, options);
|
|
61
|
+
return data;
|
|
62
|
+
});
|
|
63
|
+
}
|
|
36
64
|
}
|
|
37
65
|
exports.RoutingAPI = RoutingAPI;
|
package/dist/api/SessionAPI.d.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import type { APIClient } from '@ffflorian/api-client';
|
|
2
|
-
import type { ClientOptions, Session } from '../interfaces/';
|
|
2
|
+
import type { ClientOptions, Session, SessionKey } from '../interfaces/';
|
|
3
3
|
import { APIBase } from './APIBase';
|
|
4
4
|
export declare class SessionAPI extends APIBase {
|
|
5
5
|
constructor(apiClient: APIClient, options: ClientOptions);
|
|
6
|
-
|
|
7
|
-
* @param id The id to get
|
|
8
|
-
*/
|
|
9
|
-
getById(id: number): Promise<Session>;
|
|
6
|
+
getById(_id: number): Promise<Session>;
|
|
10
7
|
getList(): Promise<Session[]>;
|
|
8
|
+
getSessionKey(): Promise<SessionKey>;
|
|
9
|
+
getStatus(): Promise<Session>;
|
|
11
10
|
}
|
package/dist/api/SessionAPI.js
CHANGED
|
@@ -16,19 +16,27 @@ class SessionAPI extends APIBase_1.APIBase {
|
|
|
16
16
|
constructor(apiClient, options) {
|
|
17
17
|
super(apiClient, options);
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
* @param id The id to get
|
|
21
|
-
*/
|
|
22
|
-
getById(id) {
|
|
19
|
+
getById(_id) {
|
|
23
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
|
|
21
|
+
return this.getStatus();
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
getList() {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
const status = yield this.getStatus();
|
|
27
|
+
return [status];
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
getSessionKey() {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const endpoint = Endpoints_1.Endpoint.Session.key();
|
|
25
33
|
const { data } = yield this.apiClient.get(endpoint);
|
|
26
34
|
return data;
|
|
27
35
|
});
|
|
28
36
|
}
|
|
29
|
-
|
|
37
|
+
getStatus() {
|
|
30
38
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
const endpoint = Endpoints_1.Endpoint.
|
|
39
|
+
const endpoint = Endpoints_1.Endpoint.Session.status();
|
|
32
40
|
const { data } = yield this.apiClient.get(endpoint);
|
|
33
41
|
return data;
|
|
34
42
|
});
|
package/dist/api/UpdatesAPI.d.ts
CHANGED
|
@@ -3,9 +3,7 @@ import type { ClientOptions, Updates } from '../interfaces/';
|
|
|
3
3
|
import { APIBase } from './APIBase';
|
|
4
4
|
export declare class UpdatesAPI extends APIBase {
|
|
5
5
|
constructor(apiClient: APIClient, options: ClientOptions);
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
*/
|
|
9
|
-
getById(id: number): Promise<Updates>;
|
|
6
|
+
fetchUpdates(): Promise<Updates>;
|
|
7
|
+
getById(_id: number): Promise<Updates>;
|
|
10
8
|
getList(): Promise<Updates[]>;
|
|
11
9
|
}
|
package/dist/api/UpdatesAPI.js
CHANGED
|
@@ -16,21 +16,22 @@ class UpdatesAPI extends APIBase_1.APIBase {
|
|
|
16
16
|
constructor(apiClient, options) {
|
|
17
17
|
super(apiClient, options);
|
|
18
18
|
}
|
|
19
|
-
|
|
20
|
-
* @param id The id to get
|
|
21
|
-
*/
|
|
22
|
-
getById(id) {
|
|
19
|
+
fetchUpdates() {
|
|
23
20
|
return __awaiter(this, void 0, void 0, function* () {
|
|
24
|
-
const endpoint = Endpoints_1.Endpoint.
|
|
21
|
+
const endpoint = Endpoints_1.Endpoint.Updates.fetch();
|
|
25
22
|
const { data } = yield this.apiClient.get(endpoint);
|
|
26
23
|
return data;
|
|
27
24
|
});
|
|
28
25
|
}
|
|
26
|
+
getById(_id) {
|
|
27
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
+
return this.fetchUpdates();
|
|
29
|
+
});
|
|
30
|
+
}
|
|
29
31
|
getList() {
|
|
30
32
|
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
return data;
|
|
33
|
+
const updates = yield this.fetchUpdates();
|
|
34
|
+
return [updates];
|
|
34
35
|
});
|
|
35
36
|
}
|
|
36
37
|
}
|
package/dist/api/index.d.ts
CHANGED
|
@@ -15,8 +15,10 @@ export * from './LocationGroupCategoriesAPI';
|
|
|
15
15
|
export * from './LocationGroupsAPI';
|
|
16
16
|
export * from './LocationsAPI';
|
|
17
17
|
export * from './MapAPI';
|
|
18
|
+
export * from './MeshAPI';
|
|
18
19
|
export * from './ObstaclesAPI';
|
|
19
20
|
export * from './POIs';
|
|
21
|
+
export * from './PositioningAPI';
|
|
20
22
|
export * from './RampsAPI';
|
|
21
23
|
export * from './RoutingAPI';
|
|
22
24
|
export * from './SessionAPI';
|
package/dist/api/index.js
CHANGED
|
@@ -31,8 +31,10 @@ __exportStar(require("./LocationGroupCategoriesAPI"), exports);
|
|
|
31
31
|
__exportStar(require("./LocationGroupsAPI"), exports);
|
|
32
32
|
__exportStar(require("./LocationsAPI"), exports);
|
|
33
33
|
__exportStar(require("./MapAPI"), exports);
|
|
34
|
+
__exportStar(require("./MeshAPI"), exports);
|
|
34
35
|
__exportStar(require("./ObstaclesAPI"), exports);
|
|
35
36
|
__exportStar(require("./POIs"), exports);
|
|
37
|
+
__exportStar(require("./PositioningAPI"), exports);
|
|
36
38
|
__exportStar(require("./RampsAPI"), exports);
|
|
37
39
|
__exportStar(require("./RoutingAPI"), exports);
|
|
38
40
|
__exportStar(require("./SessionAPI"), exports);
|
package/dist/c3nav.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { API, ClientOptions } from './interfaces';
|
|
2
|
-
export declare class
|
|
2
|
+
export declare class c3nav {
|
|
3
3
|
readonly api: API;
|
|
4
4
|
private readonly apiClient;
|
|
5
5
|
constructor(apiUrl: string);
|
|
@@ -10,3 +10,5 @@ export declare class LibrariesIO {
|
|
|
10
10
|
*/
|
|
11
11
|
setApiUrl(newURL: string): void;
|
|
12
12
|
}
|
|
13
|
+
export declare class LibrariesIO extends c3nav {
|
|
14
|
+
}
|
package/dist/c3nav.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.LibrariesIO = void 0;
|
|
3
|
+
exports.LibrariesIO = exports.c3nav = void 0;
|
|
4
4
|
const api_client_1 = require("@ffflorian/api-client");
|
|
5
5
|
const api_1 = require("./api");
|
|
6
|
-
class
|
|
6
|
+
class c3nav {
|
|
7
7
|
constructor(options) {
|
|
8
8
|
if (typeof options === 'string') {
|
|
9
9
|
options = { apiUrl: options };
|
|
10
10
|
}
|
|
11
|
-
this.apiClient = new api_client_1.APIClient('https://c3nav.de
|
|
11
|
+
this.apiClient = new api_client_1.APIClient(options.apiUrl || 'https://c3nav.de');
|
|
12
12
|
this.api = {
|
|
13
13
|
accessRestrictionGroups: new api_1.AccessRestrictionGroupsAPI(this.apiClient, options),
|
|
14
14
|
accessRestrictions: new api_1.AccessRestrictionsAPI(this.apiClient, options),
|
|
@@ -27,8 +27,10 @@ class LibrariesIO {
|
|
|
27
27
|
locationGroups: new api_1.LocationGroupsAPI(this.apiClient, options),
|
|
28
28
|
locations: new api_1.LocationsAPI(this.apiClient, options),
|
|
29
29
|
map: new api_1.MapAPI(this.apiClient, options),
|
|
30
|
+
mesh: new api_1.MeshAPI(this.apiClient, options),
|
|
30
31
|
obstacles: new api_1.ObstaclesAPI(this.apiClient, options),
|
|
31
32
|
pois: new api_1.PoisAPI(this.apiClient, options),
|
|
33
|
+
positioning: new api_1.PositioningAPI(this.apiClient, options),
|
|
32
34
|
ramps: new api_1.RampsAPI(this.apiClient, options),
|
|
33
35
|
routing: new api_1.RoutingAPI(this.apiClient, options),
|
|
34
36
|
session: new api_1.SessionAPI(this.apiClient, options),
|
|
@@ -46,4 +48,7 @@ class LibrariesIO {
|
|
|
46
48
|
this.apiClient.setBaseURL(newURL);
|
|
47
49
|
}
|
|
48
50
|
}
|
|
51
|
+
exports.c3nav = c3nav;
|
|
52
|
+
class LibrariesIO extends c3nav {
|
|
53
|
+
}
|
|
49
54
|
exports.LibrariesIO = LibrariesIO;
|
package/dist/interfaces/API.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AccessRestrictionGroupsAPI, AccessRestrictionsAPI, AreasAPI, BuildingsAPI, ChangesetsAPI, ColumnsAPI, CrossDescriptionsAPI, DoorsAPI, EditorAPI, HolesAPI, LeaveDescriptionsAPI, LevelListAPI, LineObstaclesAPI, LocationGroupCategoriesAPI, LocationGroupsAPI, LocationsAPI, MapAPI, ObstaclesAPI, PoisAPI, RampsAPI, RoutingAPI, SessionAPI, SourcesAPI, SpacesAPI, StairsAPI, UpdatesAPI } from '../api/';
|
|
1
|
+
import type { AccessRestrictionGroupsAPI, AccessRestrictionsAPI, AreasAPI, BuildingsAPI, ChangesetsAPI, ColumnsAPI, CrossDescriptionsAPI, DoorsAPI, EditorAPI, HolesAPI, LeaveDescriptionsAPI, LevelListAPI, LineObstaclesAPI, LocationGroupCategoriesAPI, LocationGroupsAPI, LocationsAPI, MapAPI, MeshAPI, ObstaclesAPI, PoisAPI, PositioningAPI, RampsAPI, RoutingAPI, SessionAPI, SourcesAPI, SpacesAPI, StairsAPI, UpdatesAPI } from '../api/';
|
|
2
2
|
export interface API {
|
|
3
3
|
accessRestrictionGroups: AccessRestrictionGroupsAPI;
|
|
4
4
|
accessRestrictions: AccessRestrictionsAPI;
|
|
@@ -17,8 +17,10 @@ export interface API {
|
|
|
17
17
|
locationGroups: LocationGroupsAPI;
|
|
18
18
|
locations: LocationsAPI;
|
|
19
19
|
map: MapAPI;
|
|
20
|
+
mesh: MeshAPI;
|
|
20
21
|
obstacles: ObstaclesAPI;
|
|
21
22
|
pois: PoisAPI;
|
|
23
|
+
positioning: PositioningAPI;
|
|
22
24
|
ramps: RampsAPI;
|
|
23
25
|
routing: RoutingAPI;
|
|
24
26
|
session: SessionAPI;
|
|
@@ -1,2 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import type { Bounds } from './Bounds';
|
|
2
|
+
export interface Editor extends Bounds {
|
|
2
3
|
}
|
|
4
|
+
export interface EditorBeaconsLookup {
|
|
5
|
+
ibeacons: Record<string, unknown>;
|
|
6
|
+
wifi_beacons: Record<string, unknown>;
|
|
7
|
+
}
|
|
8
|
+
export type EditorGeometries = Array<[string, string] | Record<string, unknown>>;
|
|
9
|
+
export type GeometryStyles = Record<string, string>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { Location, LocationDetails, LocationGeometry } from './Location';
|
|
2
|
+
export interface MapLegend {
|
|
3
|
+
base: MapLegendItem[];
|
|
4
|
+
groups: MapLegendItem[];
|
|
5
|
+
obstacles: MapLegendItem[];
|
|
6
|
+
}
|
|
7
|
+
export interface MapLegendItem {
|
|
8
|
+
border: string;
|
|
9
|
+
fill: string;
|
|
10
|
+
title: string;
|
|
11
|
+
}
|
|
12
|
+
export type MapLocation = Location;
|
|
13
|
+
export type MapLocationDisplay = LocationDetails;
|
|
14
|
+
export type MapLocationGeometry = LocationGeometry;
|
|
15
|
+
export interface MapLocationOptions extends MapLocationQueryOptions {
|
|
16
|
+
full?: boolean;
|
|
17
|
+
showRedirects?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface MapLocationQueryOptions {
|
|
20
|
+
geometry?: boolean;
|
|
21
|
+
searchable?: boolean;
|
|
22
|
+
}
|
|
23
|
+
export interface MapSettings {
|
|
24
|
+
grid?: null | Record<string, unknown>;
|
|
25
|
+
initial_bounds: Array<[number, number]> | null;
|
|
26
|
+
initial_level: null | number;
|
|
27
|
+
tile_server?: null | string;
|
|
28
|
+
}
|
|
29
|
+
export interface Position {
|
|
30
|
+
available: boolean;
|
|
31
|
+
effective_slug: string;
|
|
32
|
+
icon: null | string;
|
|
33
|
+
id: number | string;
|
|
34
|
+
short_name: string;
|
|
35
|
+
slug: string;
|
|
36
|
+
subtitle: string;
|
|
37
|
+
title: string;
|
|
38
|
+
}
|
|
39
|
+
export interface Projection {
|
|
40
|
+
pipeline?: null | string;
|
|
41
|
+
proj4: string;
|
|
42
|
+
rotation: number;
|
|
43
|
+
rotation_matrix?: null | number[];
|
|
44
|
+
zero_point: [number, number];
|
|
45
|
+
}
|
|
46
|
+
export interface Quest {
|
|
47
|
+
identifier: string;
|
|
48
|
+
level_id: number;
|
|
49
|
+
point: {
|
|
50
|
+
coordinates: [number, number];
|
|
51
|
+
type: 'Point';
|
|
52
|
+
};
|
|
53
|
+
quest_type: string;
|
|
54
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface MeshFirmware {
|
|
2
|
+
builds: Array<Record<string, unknown>>;
|
|
3
|
+
created: string;
|
|
4
|
+
id: number;
|
|
5
|
+
idf_version: string;
|
|
6
|
+
project_name: string;
|
|
7
|
+
version: string;
|
|
8
|
+
}
|
|
9
|
+
export interface MeshListResponse<T> {
|
|
10
|
+
count: number;
|
|
11
|
+
items: T[];
|
|
12
|
+
}
|
|
13
|
+
export interface MeshMap {
|
|
14
|
+
connections: Array<Record<string, unknown>>;
|
|
15
|
+
ranges: Array<Record<string, unknown>>;
|
|
16
|
+
ranging_beacons: Array<Record<string, unknown>>;
|
|
17
|
+
}
|
|
18
|
+
export interface MeshMessage {
|
|
19
|
+
data: Record<string, unknown>;
|
|
20
|
+
datetime: string;
|
|
21
|
+
id: number;
|
|
22
|
+
message_type: string;
|
|
23
|
+
src_node: string;
|
|
24
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface PositioningLocateRequest {
|
|
2
|
+
ibeacon_peers: Array<Record<string, unknown>>;
|
|
3
|
+
wifi_peers: Array<Record<string, unknown>>;
|
|
4
|
+
}
|
|
5
|
+
export interface PositioningLocateResponse {
|
|
6
|
+
location: null | Record<string, unknown>;
|
|
7
|
+
precision: null | number;
|
|
8
|
+
suggested_peers: PositioningPeerSuggestion[];
|
|
9
|
+
}
|
|
10
|
+
export interface PositioningPeerSuggestion {
|
|
11
|
+
bssid: string;
|
|
12
|
+
frequencies: number[];
|
|
13
|
+
}
|