@mentra/sdk 2.1.24 → 2.1.27
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/app/server/index.d.ts +2 -0
- package/dist/app/server/index.d.ts.map +1 -1
- package/dist/app/server/index.js +48 -26
- package/dist/app/session/dashboard.d.ts +7 -7
- package/dist/app/session/dashboard.d.ts.map +1 -1
- package/dist/app/session/dashboard.js +12 -12
- package/dist/app/session/events.d.ts +3 -1
- package/dist/app/session/events.d.ts.map +1 -1
- package/dist/app/session/events.js +12 -2
- package/dist/app/session/index.d.ts +1 -1
- package/dist/app/session/index.d.ts.map +1 -1
- package/dist/app/session/index.js +12 -7
- package/dist/app/session/modules/audio.js +1 -1
- package/dist/app/session/modules/camera.d.ts +17 -0
- package/dist/app/session/modules/camera.d.ts.map +1 -1
- package/dist/app/session/modules/camera.js +27 -0
- package/dist/app/session/modules/location.d.ts.map +1 -1
- package/dist/app/session/modules/location.js +3 -0
- package/dist/constants/log-messages/color.d.ts +5 -0
- package/dist/constants/log-messages/color.d.ts.map +1 -0
- package/dist/constants/log-messages/color.js +14 -0
- package/dist/constants/log-messages/logos.d.ts +4 -0
- package/dist/constants/log-messages/logos.d.ts.map +1 -0
- package/dist/constants/log-messages/logos.js +48 -0
- package/dist/constants/{messages.d.ts → log-messages/updates.d.ts} +2 -3
- package/dist/constants/log-messages/updates.d.ts.map +1 -0
- package/dist/constants/log-messages/updates.js +55 -0
- package/dist/constants/log-messages/warning.d.ts +8 -0
- package/dist/constants/log-messages/warning.d.ts.map +1 -0
- package/dist/constants/log-messages/warning.js +89 -0
- package/dist/index.d.ts +2 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18 -15
- package/dist/logging/logger.d.ts +2 -1
- package/dist/logging/logger.d.ts.map +1 -1
- package/dist/types/enums.d.ts +0 -20
- package/dist/types/enums.d.ts.map +1 -1
- package/dist/types/enums.js +2 -25
- package/dist/types/index.d.ts +1 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +0 -2
- package/dist/types/layouts.d.ts +3 -3
- package/dist/types/layouts.d.ts.map +1 -1
- package/dist/types/message-types.d.ts +6 -4
- package/dist/types/message-types.d.ts.map +1 -1
- package/dist/types/message-types.js +13 -13
- package/dist/types/messages/base.d.ts.map +1 -1
- package/dist/types/messages/cloud-to-app.d.ts +9 -0
- package/dist/types/messages/cloud-to-app.d.ts.map +1 -1
- package/dist/types/messages/cloud-to-glasses.d.ts +15 -8
- package/dist/types/messages/cloud-to-glasses.d.ts.map +1 -1
- package/dist/types/messages/glasses-to-cloud.d.ts +99 -9
- package/dist/types/messages/glasses-to-cloud.d.ts.map +1 -1
- package/dist/types/messages/glasses-to-cloud.js +45 -1
- package/dist/types/models.d.ts.map +1 -1
- package/dist/types/streams.js +1 -1
- package/dist/types/webhooks.d.ts +4 -51
- package/dist/types/webhooks.d.ts.map +1 -1
- package/dist/types/webhooks.js +0 -27
- package/dist/utils/permissions-utils.d.ts +8 -0
- package/dist/utils/permissions-utils.d.ts.map +1 -0
- package/dist/utils/permissions-utils.js +263 -0
- package/package.json +4 -1
- package/dist/constants/messages.d.ts.map +0 -1
- package/dist/constants/messages.js +0 -57
- package/dist/types/user-session.d.ts +0 -73
- package/dist/types/user-session.d.ts.map +0 -1
- package/dist/types/user-session.js +0 -17
|
@@ -10,6 +10,7 @@ exports.CameraModule = void 0;
|
|
|
10
10
|
const types_1 = require("../../../types");
|
|
11
11
|
const streams_1 = require("../../../types/streams");
|
|
12
12
|
const camera_managed_extension_1 = require("./camera-managed-extension");
|
|
13
|
+
const permissions_utils_1 = require("../../../utils/permissions-utils");
|
|
13
14
|
/**
|
|
14
15
|
* 📷 Camera Module Implementation
|
|
15
16
|
*
|
|
@@ -84,6 +85,8 @@ class CameraModule {
|
|
|
84
85
|
*/
|
|
85
86
|
async requestPhoto(options) {
|
|
86
87
|
return new Promise((resolve, reject) => {
|
|
88
|
+
const baseUrl = this.session?.getHttpsServerUrl?.() || "";
|
|
89
|
+
(0, permissions_utils_1.cameraWarnLog)(baseUrl, this.packageName, "requestPhoto");
|
|
87
90
|
try {
|
|
88
91
|
console.log("DEBUG: requestPhoto options:", options);
|
|
89
92
|
// Generate unique request ID
|
|
@@ -183,6 +186,29 @@ class CameraModule {
|
|
|
183
186
|
this.logger.warn({ requestId }, `📸 Received photo for unknown request ID: ${requestId}`);
|
|
184
187
|
}
|
|
185
188
|
}
|
|
189
|
+
/**
|
|
190
|
+
* ❌ Handle photo error from /photo-upload endpoint
|
|
191
|
+
*
|
|
192
|
+
* This method is called internally when a photo error response is received.
|
|
193
|
+
* It rejects the corresponding pending promise with the error information.
|
|
194
|
+
*
|
|
195
|
+
* @param errorResponse - The error response received
|
|
196
|
+
* @internal This method is used internally by AppSession
|
|
197
|
+
*/
|
|
198
|
+
handlePhotoError(errorResponse) {
|
|
199
|
+
const { requestId, error } = errorResponse;
|
|
200
|
+
const pendingRequest = this.pendingPhotoRequests.get(requestId);
|
|
201
|
+
if (pendingRequest) {
|
|
202
|
+
this.logger.error({ requestId, errorCode: error.code, errorMessage: error.message }, `📸 Photo capture failed: ${error.code} - ${error.message}`);
|
|
203
|
+
// Reject the promise with the error information
|
|
204
|
+
pendingRequest.reject(`${error.code}: ${error.message}`);
|
|
205
|
+
// Clean up
|
|
206
|
+
this.pendingPhotoRequests.delete(requestId);
|
|
207
|
+
}
|
|
208
|
+
else {
|
|
209
|
+
this.logger.warn({ requestId, errorCode: error.code, errorMessage: error.message }, `📸 Received photo error for unknown request ID: ${requestId}`);
|
|
210
|
+
}
|
|
211
|
+
}
|
|
186
212
|
/**
|
|
187
213
|
* 🔍 Check if there's a pending photo request for the given request ID
|
|
188
214
|
*
|
|
@@ -258,6 +284,7 @@ class CameraModule {
|
|
|
258
284
|
*/
|
|
259
285
|
async startStream(options) {
|
|
260
286
|
this.logger.info({ rtmpUrl: options.rtmpUrl }, `📹 RTMP stream request starting`);
|
|
287
|
+
(0, permissions_utils_1.cameraWarnLog)(this.session.getHttpsServerUrl?.(), this.packageName, "startStream");
|
|
261
288
|
if (!options.rtmpUrl) {
|
|
262
289
|
throw new Error("rtmpUrl is required");
|
|
263
290
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../../src/app/session/modules/location.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"location.d.ts","sourceRoot":"","sources":["../../../../src/app/session/modules/location.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,MAAM,IAAI,CAAC;AAChC,OAAO,EAEL,cAAc,EAEf,MAAM,gBAAgB,CAAC;AAExB,qBAAa,eAAe;IAIxB,OAAO,CAAC,OAAO;IACf,OAAO,CAAC,IAAI;IAJd,OAAO,CAAC,0BAA0B,CAAwB;gBAGhD,OAAO,EAAE,UAAU,EACnB,IAAI,EAAE,CAAC,OAAO,EAAE,GAAG,KAAK,IAAI;IAI/B,iBAAiB,CACtB,OAAO,EAAE;QACP,QAAQ,EACJ,UAAU,GACV,MAAM,GACN,UAAU,GACV,WAAW,GACX,eAAe,GACf,WAAW,GACX,iBAAiB,GACjB,SAAS,CAAC;KACf,EACD,OAAO,EAAE,CAAC,IAAI,EAAE,cAAc,KAAK,IAAI,GACtC,MAAM,IAAI;IAkBN,qBAAqB,IAAI,IAAI;IAUvB,iBAAiB,CAAC,OAAO,EAAE;QACtC,QAAQ,EAAE,MAAM,CAAC;KAClB,GAAG,OAAO,CAAC,cAAc,CAAC;CA+B5B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.LocationManager = void 0;
|
|
4
|
+
const permissions_utils_1 = require("../../../utils/permissions-utils");
|
|
4
5
|
const types_1 = require("../../../types");
|
|
5
6
|
class LocationManager {
|
|
6
7
|
constructor(session, send) {
|
|
@@ -10,6 +11,8 @@ class LocationManager {
|
|
|
10
11
|
}
|
|
11
12
|
// subscribes to the continuous location stream with a specified accuracy tier
|
|
12
13
|
subscribeToStream(options, handler) {
|
|
14
|
+
//Checking for permission location from dev console:
|
|
15
|
+
(0, permissions_utils_1.locationWarnLog)(this.session.getHttpsServerUrl() || "", this.session.getPackageName(), this.subscribeToStream.name);
|
|
13
16
|
const subscription = {
|
|
14
17
|
stream: "location_stream",
|
|
15
18
|
rate: options.accuracy,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"color.d.ts","sourceRoot":"","sources":["../../../src/constants/log-messages/color.ts"],"names":[],"mappings":"AAAA,iBAAS,KAAK,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEnC;AAED,iBAAS,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEpC;AAED,iBAAS,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjC;AAED,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,GAAG,EAAE,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.green = green;
|
|
4
|
+
exports.yellow = yellow;
|
|
5
|
+
exports.red = red;
|
|
6
|
+
function green(text) {
|
|
7
|
+
return `\x1b[32m${text}\x1b[0m`;
|
|
8
|
+
}
|
|
9
|
+
function yellow(text) {
|
|
10
|
+
return `\x1b[33m${text}\x1b[0m`;
|
|
11
|
+
}
|
|
12
|
+
function red(text) {
|
|
13
|
+
return `\x1b[31m${text}\x1b[0m`;
|
|
14
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare const warnLog: string;
|
|
2
|
+
export declare const mentraLogo_1: string;
|
|
3
|
+
export declare const newUpdateText = "\n\u252C\u2554\u2557\u2554\u2554\u2550\u2557\u2566 \u2566 \u2566 \u2566\u2554\u2550\u2557\u2554\u2566\u2557\u2554\u2550\u2557\u2554\u2566\u2557\u2554\u2550\u2557\u252C\n\u2502\u2551\u2551\u2551\u2551\u2563 \u2551\u2551\u2551 \u2551 \u2551\u2560\u2550\u255D \u2551\u2551\u2560\u2550\u2563 \u2551 \u2551\u2563 \u2502\no\u255D\u255A\u255D\u255A\u2550\u255D\u255A\u2569\u255D \u255A\u2550\u255D\u2569 \u2550\u2569\u255D\u2569 \u2569 \u2569 \u255A\u2550\u255Do\n";
|
|
4
|
+
//# sourceMappingURL=logos.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logos.d.ts","sourceRoot":"","sources":["../../../src/constants/log-messages/logos.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,QASc,CAAC;AAEnC,eAAO,MAAM,YAAY,QAUxB,CAAC;AAEF,eAAO,MAAM,aAAa,kdAIzB,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.newUpdateText = exports.mentraLogo_1 = exports.warnLog = void 0;
|
|
4
|
+
exports.warnLog = String.raw `
|
|
5
|
+
__/\\\\____________/\\\\_
|
|
6
|
+
_\/\\\\\\________/\\\\\\_
|
|
7
|
+
_\/\\\//\\\____/\\\//\\\_
|
|
8
|
+
_\/\\\\///\\\/\\\/_\/\\\_
|
|
9
|
+
_\/\\\__\///\\\/___\/\\\_
|
|
10
|
+
_\/\\\____\///_____\/\\\_
|
|
11
|
+
_\/\\\_____________\/\\\_
|
|
12
|
+
_\/\\\_____________\/\\\_
|
|
13
|
+
_\///______________\///__`;
|
|
14
|
+
exports.mentraLogo_1 = String.raw `
|
|
15
|
+
__ __ ________ __ __ ________ _______ ______
|
|
16
|
+
| \ / \| \| \ | \| \| \ / \
|
|
17
|
+
| $$\ / $$| $$$$$$$$| $$\ | $$ \$$$$$$$$| $$$$$$$\| $$$$$$\
|
|
18
|
+
| $$$\ / $$$| $$__ | $$$\| $$ | $$ | $$__| $$| $$__| $$
|
|
19
|
+
| $$$$\ $$$$| $$ \ | $$$$\ $$ | $$ | $$ $$| $$ $$
|
|
20
|
+
| $$\$$ $$ $$| $$$$$ | $$\$$ $$ | $$ | $$$$$$$\| $$$$$$$$
|
|
21
|
+
| $$ \$$$| $$| $$_____ | $$ \$$$$ | $$ | $$ | $$| $$ | $$
|
|
22
|
+
| $$ \$ | $$| $$ \| $$ \$$$ | $$ | $$ | $$| $$ | $$
|
|
23
|
+
\$$ \$$ \$$$$$$$$ \$$ \$$ \$$ \$$ \$$ \$$ \$$
|
|
24
|
+
`;
|
|
25
|
+
exports.newUpdateText = `
|
|
26
|
+
┬╔╗╔╔═╗╦ ╦ ╦ ╦╔═╗╔╦╗╔═╗╔╦╗╔═╗┬
|
|
27
|
+
│║║║║╣ ║║║ ║ ║╠═╝ ║║╠═╣ ║ ║╣ │
|
|
28
|
+
o╝╚╝╚═╝╚╩╝ ╚═╝╩ ═╩╝╩ ╩ ╩ ╚═╝o
|
|
29
|
+
`;
|
|
30
|
+
// export const newSDKUpdate = (versionNumb: string): string => {
|
|
31
|
+
// return `
|
|
32
|
+
// /$$ /$$ /$$$$$$$$ /$$ /$$ /$$$$$$$$ /$$$$$$$ /$$$$$$
|
|
33
|
+
// | $$$ /$$$| $$_____/| $$$ | $$|__ $$__/| $$__ $$ /$$__ $$
|
|
34
|
+
// | $$$$ /$$$$| $$ | $$$$| $$ | $$ | $$ \ $$| $$ \ $$
|
|
35
|
+
// | $$ $$/$$ $$| $$$$$ | $$ $$ $$ | $$ | $$$$$$$/| $$$$$$$$
|
|
36
|
+
// | $$ $$$| $$| $$__/ | $$ $$$$ | $$ | $$__ $$| $$__ $$
|
|
37
|
+
// | $$\ $ | $$| $$ | $$\ $$$ | $$ | $$ \ $$| $$ | $$
|
|
38
|
+
// | $$ \/ | $$| $$$$$$$$| $$ \ $$ | $$ | $$ | $$| $$ | $$
|
|
39
|
+
// |__/ |__/|________/|__/ \__/ |__/ |__/ |__/|__/ |__/
|
|
40
|
+
// ┬╔╗╔╔═╗╦ ╦ ╦ ╦╔═╗╔╦╗╔═╗╔╦╗╔═╗┬
|
|
41
|
+
// │║║║║╣ ║║║ ║ ║╠═╝ ║║╠═╣ ║ ║╣ │
|
|
42
|
+
// o╝╚╝╚═╝╚╩╝ ╚═╝╩ ═╩╝╩ ╩ ╩ ╚═╝o
|
|
43
|
+
// -------------------------------
|
|
44
|
+
// SDK VERSION V${versionNumb} is out!
|
|
45
|
+
// -------------------------------
|
|
46
|
+
// bun install @mentra/sdk@latest
|
|
47
|
+
// `;
|
|
48
|
+
// };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* updates.ts
|
|
3
3
|
*
|
|
4
4
|
* This file defines constant messages that should be displayed
|
|
5
5
|
* in the terminal to notify developers about new SDK releases.
|
|
@@ -14,6 +14,5 @@
|
|
|
14
14
|
*
|
|
15
15
|
*
|
|
16
16
|
*/
|
|
17
|
-
export declare const newSDKUpdate2: (versionNumb: string) => string;
|
|
18
17
|
export declare const newSDKUpdate: (versionNumb: string) => string;
|
|
19
|
-
//# sourceMappingURL=
|
|
18
|
+
//# sourceMappingURL=updates.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"updates.d.ts","sourceRoot":"","sources":["../../../src/constants/log-messages/updates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAmCH,eAAO,MAAM,YAAY,GAAI,aAAa,MAAM,KAAG,MAElD,CAAC"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* updates.ts
|
|
4
|
+
*
|
|
5
|
+
* This file defines constant messages that should be displayed
|
|
6
|
+
* in the terminal to notify developers about new SDK releases.
|
|
7
|
+
*
|
|
8
|
+
* Each function generates a stylized ASCII message (banner-style)
|
|
9
|
+
* that highlights the latest SDK version and provides the npm install command.
|
|
10
|
+
* https://patorjk.com/software/taag/
|
|
11
|
+
*
|
|
12
|
+
* These messages are intended to be logged to the console or shown in
|
|
13
|
+
* terminal output so developers are aware of updates in a clear
|
|
14
|
+
* and visually distinct way.
|
|
15
|
+
*
|
|
16
|
+
*
|
|
17
|
+
*/
|
|
18
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
19
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
20
|
+
};
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.newSDKUpdate = void 0;
|
|
23
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
24
|
+
const boxen_1 = __importDefault(require("boxen"));
|
|
25
|
+
const logos_1 = require("./logos");
|
|
26
|
+
const createUpdateNotification = (versionNumb) => {
|
|
27
|
+
const line = chalk_1.default.bold.gray("-------------------------------");
|
|
28
|
+
const logo = chalk_1.default.cyan(logos_1.mentraLogo_1);
|
|
29
|
+
const title = chalk_1.default.bold.cyan(logos_1.newUpdateText);
|
|
30
|
+
const versionMessage = `Version ${chalk_1.default.bold.cyan(`SDK VERSION V${versionNumb} is out! 🎉`)}`;
|
|
31
|
+
const currentNote = chalk_1.default.yellow("You are running an older version");
|
|
32
|
+
const instructions = chalk_1.default.yellow("Update to the latest version with:");
|
|
33
|
+
const command = chalk_1.default.green.bold("bun install @mentra/sdk@latest");
|
|
34
|
+
const content = [
|
|
35
|
+
logo,
|
|
36
|
+
title,
|
|
37
|
+
line,
|
|
38
|
+
versionMessage,
|
|
39
|
+
currentNote,
|
|
40
|
+
line,
|
|
41
|
+
instructions,
|
|
42
|
+
command,
|
|
43
|
+
].join("\n");
|
|
44
|
+
return (0, boxen_1.default)(content, {
|
|
45
|
+
padding: 1,
|
|
46
|
+
margin: 1,
|
|
47
|
+
borderStyle: "round",
|
|
48
|
+
borderColor: "cyan",
|
|
49
|
+
textAlignment: "left",
|
|
50
|
+
});
|
|
51
|
+
};
|
|
52
|
+
const newSDKUpdate = (versionNumb) => {
|
|
53
|
+
return createUpdateNotification(versionNumb);
|
|
54
|
+
};
|
|
55
|
+
exports.newSDKUpdate = newSDKUpdate;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare const noMicrophoneWarn: (funcName?: string, packageName?: string) => string;
|
|
2
|
+
export declare const locationWarn: (funcName?: string, packageName?: string) => string;
|
|
3
|
+
export declare const baackgroundLocationWarn: (funcName?: string, packageName?: string) => string;
|
|
4
|
+
export declare const calendarWarn: (funcName?: string, packageName?: string) => string;
|
|
5
|
+
export declare const readNotficationWarn: (funcName?: string, packageName?: string) => string;
|
|
6
|
+
export declare const postNotficationWarn: (funcName?: string, packageName?: string) => string;
|
|
7
|
+
export declare const cameraWarn: (funcName?: string, packageName?: string) => string;
|
|
8
|
+
//# sourceMappingURL=warning.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"warning.d.ts","sourceRoot":"","sources":["../../../src/constants/log-messages/warning.ts"],"names":[],"mappings":"AA0EA,eAAO,MAAM,gBAAgB,GAC3B,WAAW,MAAM,EACjB,cAAc,MAAM,KACnB,MAEF,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,WAAW,MAAM,EACjB,cAAc,MAAM,KACnB,MAEF,CAAC;AAEF,eAAO,MAAM,uBAAuB,GAClC,WAAW,MAAM,EACjB,cAAc,MAAM,KACnB,MAEF,CAAC;AAEF,eAAO,MAAM,YAAY,GACvB,WAAW,MAAM,EACjB,cAAc,MAAM,KACnB,MAEF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,WAAW,MAAM,EACjB,cAAc,MAAM,KACnB,MAEF,CAAC;AAEF,eAAO,MAAM,mBAAmB,GAC9B,WAAW,MAAM,EACjB,cAAc,MAAM,KACnB,MAEF,CAAC;AAEF,eAAO,MAAM,UAAU,GAAI,WAAW,MAAM,EAAE,cAAc,MAAM,KAAG,MAEpE,CAAC"}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.cameraWarn = exports.postNotficationWarn = exports.readNotficationWarn = exports.calendarWarn = exports.baackgroundLocationWarn = exports.locationWarn = exports.noMicrophoneWarn = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* warning.ts
|
|
9
|
+
*
|
|
10
|
+
* This file defines styled warning messages that are displayed when an app
|
|
11
|
+
* attempts to use functionality requiring permissions it hasn't declared.
|
|
12
|
+
*
|
|
13
|
+
* Each function generates a bordered terminal warning box with:
|
|
14
|
+
* - ASCII art logo (left side)
|
|
15
|
+
* - Permission requirement details (right side)
|
|
16
|
+
* - Link to developer portal for adding permissions
|
|
17
|
+
*
|
|
18
|
+
* The warnings use chalk for terminal colors and boxen for bordered output,
|
|
19
|
+
* creating a professional side-by-side layout that alerts developers to
|
|
20
|
+
* missing permissions in their app configuration.
|
|
21
|
+
*
|
|
22
|
+
* These are shown during SDK runtime when permission checks fail, helping
|
|
23
|
+
* developers identify and fix permission issues quickly.
|
|
24
|
+
*/
|
|
25
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
26
|
+
const boxen_1 = __importDefault(require("boxen"));
|
|
27
|
+
const logos_1 = require("./logos");
|
|
28
|
+
const createPermissionWarning = (permissionName, funcName, packageName) => {
|
|
29
|
+
// Strip ANSI codes for width calculation
|
|
30
|
+
// eslint-disable-next-line no-control-regex
|
|
31
|
+
const stripAnsi = (str) => str.replace(/\u001b\[\d+m/g, "");
|
|
32
|
+
const title = chalk_1.default.bold.yellow("⚠️ Permission Required");
|
|
33
|
+
const message = `${chalk_1.default.yellow(funcName || "This function")} requires ${chalk_1.default.bold(permissionName)} permission.`;
|
|
34
|
+
const instructions = chalk_1.default.dim("Please enable this permission in the developer portal at:");
|
|
35
|
+
const url = chalk_1.default.cyan.underline(`https://console.mentra.glass/apps/${packageName}/edit`);
|
|
36
|
+
const hint = chalk_1.default.dim("under *Required Permissions*.");
|
|
37
|
+
// Split logo into lines (without color for width calculation)
|
|
38
|
+
const logoLines = logos_1.warnLog.split("\n");
|
|
39
|
+
const coloredLogoLines = logoLines.map((line) => chalk_1.default.yellow(line));
|
|
40
|
+
const textContent = [title, "", message, "", instructions, url, "", hint];
|
|
41
|
+
// Find actual logo width (max line length without ANSI codes)
|
|
42
|
+
const logoWidth = Math.max(...logoLines.map((line) => stripAnsi(line).length));
|
|
43
|
+
// Create side-by-side layout
|
|
44
|
+
const maxLines = Math.max(coloredLogoLines.length, textContent.length);
|
|
45
|
+
const combinedLines = [];
|
|
46
|
+
for (let i = 0; i < maxLines; i++) {
|
|
47
|
+
const rawLogoLine = logoLines[i] || "";
|
|
48
|
+
const coloredLogoLine = coloredLogoLines[i] || "";
|
|
49
|
+
const actualLogoLength = stripAnsi(rawLogoLine).length;
|
|
50
|
+
const padding = " ".repeat(Math.max(0, logoWidth - actualLogoLength));
|
|
51
|
+
const textLine = textContent[i] || "";
|
|
52
|
+
combinedLines.push(`${coloredLogoLine}${padding} ${textLine}`);
|
|
53
|
+
}
|
|
54
|
+
return (0, boxen_1.default)(combinedLines.join("\n"), {
|
|
55
|
+
padding: 1,
|
|
56
|
+
margin: 1,
|
|
57
|
+
borderStyle: "round",
|
|
58
|
+
borderColor: "yellow",
|
|
59
|
+
float: "left",
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
const noMicrophoneWarn = (funcName, packageName) => {
|
|
63
|
+
return createPermissionWarning("microphone", funcName, packageName);
|
|
64
|
+
};
|
|
65
|
+
exports.noMicrophoneWarn = noMicrophoneWarn;
|
|
66
|
+
const locationWarn = (funcName, packageName) => {
|
|
67
|
+
return createPermissionWarning("location", funcName, packageName);
|
|
68
|
+
};
|
|
69
|
+
exports.locationWarn = locationWarn;
|
|
70
|
+
const baackgroundLocationWarn = (funcName, packageName) => {
|
|
71
|
+
return createPermissionWarning("background location", funcName, packageName);
|
|
72
|
+
};
|
|
73
|
+
exports.baackgroundLocationWarn = baackgroundLocationWarn;
|
|
74
|
+
const calendarWarn = (funcName, packageName) => {
|
|
75
|
+
return createPermissionWarning("calendar", funcName, packageName);
|
|
76
|
+
};
|
|
77
|
+
exports.calendarWarn = calendarWarn;
|
|
78
|
+
const readNotficationWarn = (funcName, packageName) => {
|
|
79
|
+
return createPermissionWarning("read notification", funcName, packageName);
|
|
80
|
+
};
|
|
81
|
+
exports.readNotficationWarn = readNotficationWarn;
|
|
82
|
+
const postNotficationWarn = (funcName, packageName) => {
|
|
83
|
+
return createPermissionWarning("post notification", funcName, packageName);
|
|
84
|
+
};
|
|
85
|
+
exports.postNotficationWarn = postNotficationWarn;
|
|
86
|
+
const cameraWarn = (funcName, packageName) => {
|
|
87
|
+
return createPermissionWarning("camera", funcName, packageName);
|
|
88
|
+
};
|
|
89
|
+
exports.cameraWarn = cameraWarn;
|
package/dist/index.d.ts
CHANGED
|
@@ -12,14 +12,13 @@ export * from "./types/streams";
|
|
|
12
12
|
export * from "./types/layouts";
|
|
13
13
|
export * from "./types/dashboard";
|
|
14
14
|
export * from "./types/rtmp-stream";
|
|
15
|
-
export { AppType,
|
|
15
|
+
export { AppType, LayoutType, ViewType, AppSettingType, HardwareType, HardwareRequirementLevel, } from "./types/enums";
|
|
16
16
|
export * from "./types/models";
|
|
17
|
-
export * from "./types/user-session";
|
|
18
17
|
export * from "./types/webhooks";
|
|
19
18
|
export * from "./types/capabilities";
|
|
20
19
|
export * from "./app/index";
|
|
21
20
|
export * from "./logging/logger";
|
|
22
|
-
export { ButtonPress, HeadPosition, GlassesBatteryUpdate, PhoneBatteryUpdate, GlassesConnectionState, LocationUpdate, CalendarEvent, Vad, PhoneNotification, PhoneNotificationDismissed, StartApp, StopApp, ConnectionInit, DashboardState, OpenDashboard, GlassesToCloudMessage, PhotoResponse, RtmpStreamStatus, KeepAliveAck, } from "./types/messages/glasses-to-cloud";
|
|
21
|
+
export { ButtonPress, HeadPosition, GlassesBatteryUpdate, PhoneBatteryUpdate, GlassesConnectionState, LocationUpdate, CalendarEvent, Vad, PhoneNotification, PhoneNotificationDismissed, StartApp, StopApp, ConnectionInit, DashboardState, OpenDashboard, GlassesToCloudMessage, PhotoResponse, PhotoErrorCode, PhotoStage, ConnectionState, PhotoErrorDetails, RtmpStreamStatus, KeepAliveAck, } from "./types/messages/glasses-to-cloud";
|
|
23
22
|
export { ConnectionAck, ConnectionError, AuthError, DisplayEvent, AppStateChange, MicrophoneStateChange, CloudToGlassesMessage, PhotoRequestToGlasses, SettingsUpdate, StartRtmpStream, StopRtmpStream, KeepRtmpStreamAlive, } from "./types/messages/cloud-to-glasses";
|
|
24
23
|
export { AppConnectionInit, AppSubscriptionUpdate, RtmpStreamRequest, RtmpStreamStopRequest, AppToCloudMessage, PhotoRequest, } from "./types/messages/app-to-cloud";
|
|
25
24
|
export { TextWall, DoubleTextWall, DashboardCard, ReferenceCard, Layout, DisplayRequest, BitmapView, ClearView, } from "./types/layouts";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,cAAc,eAAe,CAAC;AAG9B,cAAc,uBAAuB,CAAC;AAGtC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,mCAAmC,CAAC;AAClD,cAAc,mCAAmC,CAAC;AAClD,cAAc,+BAA+B,CAAC;AAG9C,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AAGxC,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,cAAc,IAAI,iBAAiB,EAAE,+DAA+D;AACpG,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,uBAAuB,EACvB,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,qBAAqB,EACrB,WAAW,EACX,UAAU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I,0BAA0B,EAC7C,kBAAkB,IAAI,6BAA6B,EACnD,cAAc,EACd,4BAA4B,GAC7B,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACL,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,cAAc,EACd,gBAAgB,IAAI,yBAAyB,EAC7C,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,mCAAmC,CAAC;AAE3C,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,IAAI,qBAAqB,GACxC,MAAM,+BAA+B,CAAC;AAGvC,OAAO,EACL,cAAc,EACd,UAAU,EACV,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,gBAAgB,CAAC;AAGxB,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,mBAAmB,GACpB,MAAM,qBAAqB,CAAC;AAG7B,cAAc,uBAAuB,CAAC;AAGtC,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAE/C;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,OAAO,EAAE,oBAAoB,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
16
16
|
};
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
exports.validateAppConfig = exports.isPhotoRequestFromApp = exports.isRtmpStreamStopRequest = exports.isRtmpStreamRequest = exports.isDisplayRequest = exports.isAppSubscriptionUpdate = exports.isAppConnectionInit = exports.isKeepRtmpStreamAlive = exports.isStopRtmpStream = exports.isStartRtmpStream = exports.isSettingsUpdateToGlasses = exports.isPhotoRequest = exports.isAppStateChange = exports.isDisplayEvent = exports.isConnectionAck = exports.isPhoneNotificationDismissed = exports.isKeepAliveAck = exports.isRtmpStreamStatusFromGlasses = exports.isPhotoResponseFromGlasses = exports.isStopApp = exports.isStartApp = exports.isConnectionInit = exports.isHeadPosition = exports.isButtonPress = exports.
|
|
18
|
+
exports.validateAppConfig = exports.isPhotoRequestFromApp = exports.isRtmpStreamStopRequest = exports.isRtmpStreamRequest = exports.isDisplayRequest = exports.isAppSubscriptionUpdate = exports.isAppConnectionInit = exports.isKeepRtmpStreamAlive = exports.isStopRtmpStream = exports.isStartRtmpStream = exports.isSettingsUpdateToGlasses = exports.isPhotoRequest = exports.isAppStateChange = exports.isDisplayEvent = exports.isConnectionAck = exports.isPhoneNotificationDismissed = exports.isKeepAliveAck = exports.isRtmpStreamStatusFromGlasses = exports.isPhotoResponseFromGlasses = exports.isStopApp = exports.isStartApp = exports.isConnectionInit = exports.isHeadPosition = exports.isButtonPress = exports.PhotoStage = exports.PhotoErrorCode = exports.HardwareRequirementLevel = exports.HardwareType = exports.AppSettingType = exports.ViewType = exports.LayoutType = exports.AppType = exports.isRtmpStreamStatusFromCloud = exports.isPhotoResponseFromCloud = exports.isManagedStreamStatus = exports.isDashboardAlwaysOnChanged = exports.isDashboardModeChanged = exports.isStreamStatusCheckResponse = exports.isAudioChunk = exports.isDataStream = exports.isCapabilitiesUpdate = exports.isSettingsUpdate = exports.isAppStopped = exports.isAppConnectionError = exports.isAppConnectionAck = void 0;
|
|
19
19
|
__exportStar(require("./types/token"), exports);
|
|
20
20
|
// Message type enums
|
|
21
21
|
__exportStar(require("./types/message-types"), exports);
|
|
@@ -57,8 +57,6 @@ __exportStar(require("./types/rtmp-stream"), exports);
|
|
|
57
57
|
// Other system enums
|
|
58
58
|
var enums_1 = require("./types/enums");
|
|
59
59
|
Object.defineProperty(exports, "AppType", { enumerable: true, get: function () { return enums_1.AppType; } });
|
|
60
|
-
Object.defineProperty(exports, "AppState", { enumerable: true, get: function () { return enums_1.AppState; } });
|
|
61
|
-
Object.defineProperty(exports, "Language", { enumerable: true, get: function () { return enums_1.Language; } });
|
|
62
60
|
Object.defineProperty(exports, "LayoutType", { enumerable: true, get: function () { return enums_1.LayoutType; } });
|
|
63
61
|
Object.defineProperty(exports, "ViewType", { enumerable: true, get: function () { return enums_1.ViewType; } });
|
|
64
62
|
Object.defineProperty(exports, "AppSettingType", { enumerable: true, get: function () { return enums_1.AppSettingType; } });
|
|
@@ -66,8 +64,6 @@ Object.defineProperty(exports, "HardwareType", { enumerable: true, get: function
|
|
|
66
64
|
Object.defineProperty(exports, "HardwareRequirementLevel", { enumerable: true, get: function () { return enums_1.HardwareRequirementLevel; } });
|
|
67
65
|
// Core model interfaces
|
|
68
66
|
__exportStar(require("./types/models"), exports);
|
|
69
|
-
// Session-related interfaces
|
|
70
|
-
__exportStar(require("./types/user-session"), exports);
|
|
71
67
|
// Webhook interfaces
|
|
72
68
|
__exportStar(require("./types/webhooks"), exports);
|
|
73
69
|
// Capability Discovery types
|
|
@@ -76,17 +72,24 @@ __exportStar(require("./types/capabilities"), exports);
|
|
|
76
72
|
__exportStar(require("./app/index"), exports);
|
|
77
73
|
// Logging exports
|
|
78
74
|
__exportStar(require("./logging/logger"), exports);
|
|
79
|
-
//
|
|
75
|
+
// Re-export common types for convenience
|
|
76
|
+
// This allows developers to import commonly used types directly from the package root
|
|
77
|
+
// without having to know exactly which file they come from
|
|
78
|
+
// From messages/glasses-to-cloud.ts
|
|
80
79
|
var glasses_to_cloud_1 = require("./types/messages/glasses-to-cloud");
|
|
81
|
-
Object.defineProperty(exports, "
|
|
82
|
-
Object.defineProperty(exports, "
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
Object.defineProperty(exports, "
|
|
86
|
-
Object.defineProperty(exports, "
|
|
87
|
-
Object.defineProperty(exports, "
|
|
88
|
-
Object.defineProperty(exports, "
|
|
89
|
-
Object.defineProperty(exports, "
|
|
80
|
+
Object.defineProperty(exports, "PhotoErrorCode", { enumerable: true, get: function () { return glasses_to_cloud_1.PhotoErrorCode; } });
|
|
81
|
+
Object.defineProperty(exports, "PhotoStage", { enumerable: true, get: function () { return glasses_to_cloud_1.PhotoStage; } });
|
|
82
|
+
// Type guards - re-export the most commonly used ones for convenience
|
|
83
|
+
var glasses_to_cloud_2 = require("./types/messages/glasses-to-cloud");
|
|
84
|
+
Object.defineProperty(exports, "isButtonPress", { enumerable: true, get: function () { return glasses_to_cloud_2.isButtonPress; } });
|
|
85
|
+
Object.defineProperty(exports, "isHeadPosition", { enumerable: true, get: function () { return glasses_to_cloud_2.isHeadPosition; } });
|
|
86
|
+
Object.defineProperty(exports, "isConnectionInit", { enumerable: true, get: function () { return glasses_to_cloud_2.isConnectionInit; } });
|
|
87
|
+
Object.defineProperty(exports, "isStartApp", { enumerable: true, get: function () { return glasses_to_cloud_2.isStartApp; } });
|
|
88
|
+
Object.defineProperty(exports, "isStopApp", { enumerable: true, get: function () { return glasses_to_cloud_2.isStopApp; } });
|
|
89
|
+
Object.defineProperty(exports, "isPhotoResponseFromGlasses", { enumerable: true, get: function () { return glasses_to_cloud_2.isPhotoResponse; } });
|
|
90
|
+
Object.defineProperty(exports, "isRtmpStreamStatusFromGlasses", { enumerable: true, get: function () { return glasses_to_cloud_2.isRtmpStreamStatus; } });
|
|
91
|
+
Object.defineProperty(exports, "isKeepAliveAck", { enumerable: true, get: function () { return glasses_to_cloud_2.isKeepAliveAck; } });
|
|
92
|
+
Object.defineProperty(exports, "isPhoneNotificationDismissed", { enumerable: true, get: function () { return glasses_to_cloud_2.isPhoneNotificationDismissed; } });
|
|
90
93
|
var cloud_to_glasses_1 = require("./types/messages/cloud-to-glasses");
|
|
91
94
|
Object.defineProperty(exports, "isConnectionAck", { enumerable: true, get: function () { return cloud_to_glasses_1.isConnectionAck; } });
|
|
92
95
|
Object.defineProperty(exports, "isDisplayEvent", { enumerable: true, get: function () { return cloud_to_glasses_1.isDisplayEvent; } });
|
package/dist/logging/logger.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logging/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/logging/logger.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AA2ExB,eAAO,MAAM,MAAM,6BAAuC,CAAC;AAS3D,eAAe,MAAM,CAAC"}
|
package/dist/types/enums.d.ts
CHANGED
|
@@ -6,25 +6,6 @@ export declare enum AppType {
|
|
|
6
6
|
BACKGROUND = "background",// Can temporarily take control of display
|
|
7
7
|
STANDARD = "standard"
|
|
8
8
|
}
|
|
9
|
-
/**
|
|
10
|
-
* Application states in the system
|
|
11
|
-
*/
|
|
12
|
-
export declare enum AppState {
|
|
13
|
-
NOT_INSTALLED = "not_installed",// Initial state
|
|
14
|
-
INSTALLED = "installed",// Installed but never run
|
|
15
|
-
BOOTING = "booting",// Starting up
|
|
16
|
-
RUNNING = "running",// Active and running
|
|
17
|
-
STOPPED = "stopped",// Manually stopped
|
|
18
|
-
ERROR = "error"
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Supported languages
|
|
22
|
-
*/
|
|
23
|
-
export declare enum Language {
|
|
24
|
-
EN = "en",
|
|
25
|
-
ES = "es",
|
|
26
|
-
FR = "fr"
|
|
27
|
-
}
|
|
28
9
|
/**
|
|
29
10
|
* Types of layouts for displaying content
|
|
30
11
|
*/
|
|
@@ -42,7 +23,6 @@ export declare enum LayoutType {
|
|
|
42
23
|
*/
|
|
43
24
|
export declare enum ViewType {
|
|
44
25
|
DASHBOARD = "dashboard",// Regular dashboard (main/expanded)
|
|
45
|
-
ALWAYS_ON = "always_on",// Persistent overlay dashboard
|
|
46
26
|
MAIN = "main"
|
|
47
27
|
}
|
|
48
28
|
export declare enum AppSettingType {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/types/enums.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,OAAO;IACjB,gBAAgB,qBAAqB,CAAE,6CAA6C;IACpF,UAAU,eAAe,CAAE,0CAA0C;IACrE,QAAQ,aAAa;CACtB;
|
|
1
|
+
{"version":3,"file":"enums.d.ts","sourceRoot":"","sources":["../../src/types/enums.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,oBAAY,OAAO;IACjB,gBAAgB,qBAAqB,CAAE,6CAA6C;IACpF,UAAU,eAAe,CAAE,0CAA0C;IACrE,QAAQ,aAAa;CACtB;AAED;;GAEG;AACH,oBAAY,UAAU;IACpB,SAAS,cAAc;IACvB,gBAAgB,qBAAqB;IACrC,cAAc,mBAAmB;IACjC,cAAc,mBAAmB;IACjC,WAAW,gBAAgB;IAC3B,gBAAgB,qBAAqB;IACrC,UAAU,eAAe;CAC1B;AAED;;GAEG;AACH,oBAAY,QAAQ;IAClB,SAAS,cAAc,CAAE,oCAAoC;IAE7D,IAAI,SAAS;CACd;AAGD,oBAAY,cAAc;IACxB,MAAM,WAAW;IACjB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,mBAAmB,wBAAwB;IAC3C,kBAAkB,uBAAuB;IACzC,WAAW,gBAAgB;IAC3B,WAAW,eAAe;IAC1B,aAAa,kBAAkB;IAC/B,WAAW,gBAAgB;CAC5B;AAKD;;GAEG;AACH,oBAAY,YAAY;IACtB,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,UAAU,eAAe;IACzB,OAAO,YAAY;IACnB,GAAG,QAAQ;IACX,MAAM,WAAW;IACjB,KAAK,UAAU;IACf,IAAI,SAAS;CACd;AAED;;GAEG;AACH,oBAAY,wBAAwB;IAClC,QAAQ,aAAa,CAAE,4CAA4C;IACnE,QAAQ,aAAa;CACtB"}
|
package/dist/types/enums.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// src/enums.ts
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.HardwareRequirementLevel = exports.HardwareType = exports.AppSettingType = exports.ViewType = exports.LayoutType = exports.
|
|
4
|
+
exports.HardwareRequirementLevel = exports.HardwareType = exports.AppSettingType = exports.ViewType = exports.LayoutType = exports.AppType = void 0;
|
|
5
5
|
/**
|
|
6
6
|
* Types of Third-Party Applications (Apps)
|
|
7
7
|
*/
|
|
@@ -11,29 +11,6 @@ var AppType;
|
|
|
11
11
|
AppType["BACKGROUND"] = "background";
|
|
12
12
|
AppType["STANDARD"] = "standard";
|
|
13
13
|
})(AppType || (exports.AppType = AppType = {}));
|
|
14
|
-
// TODO(isaiah): doesn't seem like this is actually used anywhere, remove?
|
|
15
|
-
/**
|
|
16
|
-
* Application states in the system
|
|
17
|
-
*/
|
|
18
|
-
var AppState;
|
|
19
|
-
(function (AppState) {
|
|
20
|
-
AppState["NOT_INSTALLED"] = "not_installed";
|
|
21
|
-
AppState["INSTALLED"] = "installed";
|
|
22
|
-
AppState["BOOTING"] = "booting";
|
|
23
|
-
AppState["RUNNING"] = "running";
|
|
24
|
-
AppState["STOPPED"] = "stopped";
|
|
25
|
-
AppState["ERROR"] = "error";
|
|
26
|
-
})(AppState || (exports.AppState = AppState = {}));
|
|
27
|
-
/**
|
|
28
|
-
* Supported languages
|
|
29
|
-
*/
|
|
30
|
-
var Language;
|
|
31
|
-
(function (Language) {
|
|
32
|
-
Language["EN"] = "en";
|
|
33
|
-
Language["ES"] = "es";
|
|
34
|
-
Language["FR"] = "fr";
|
|
35
|
-
// TODO: Add more languages
|
|
36
|
-
})(Language || (exports.Language = Language = {}));
|
|
37
14
|
/**
|
|
38
15
|
* Types of layouts for displaying content
|
|
39
16
|
*/
|
|
@@ -53,7 +30,7 @@ var LayoutType;
|
|
|
53
30
|
var ViewType;
|
|
54
31
|
(function (ViewType) {
|
|
55
32
|
ViewType["DASHBOARD"] = "dashboard";
|
|
56
|
-
|
|
33
|
+
// ALWAYS_ON = "always_on", // Persistent overlay dashboard
|
|
57
34
|
ViewType["MAIN"] = "main";
|
|
58
35
|
})(ViewType || (exports.ViewType = ViewType = {}));
|
|
59
36
|
// Types for AppSettings
|
package/dist/types/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ export * from "./dashboard";
|
|
|
12
12
|
export * from "./rtmp-stream";
|
|
13
13
|
export * from "./enums";
|
|
14
14
|
export * from "./models";
|
|
15
|
-
export * from "./user-session";
|
|
16
15
|
export * from "./webhooks";
|
|
17
16
|
export * from "./capabilities";
|
|
18
17
|
export * from "./photo-data";
|
|
@@ -35,7 +34,7 @@ export interface WebSocketError {
|
|
|
35
34
|
details?: unknown;
|
|
36
35
|
}
|
|
37
36
|
import { Request } from "express";
|
|
38
|
-
import { AppSession } from "
|
|
37
|
+
import { AppSession } from "../app/session";
|
|
39
38
|
export interface AuthenticatedRequest extends Request {
|
|
40
39
|
authUserId?: string;
|
|
41
40
|
activeSession: AppSession | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAEA,cAAc,SAAS,CAAC;AAGxB,cAAc,iBAAiB,CAAC;AAGhC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC;AAGxC,OAAO,EAEL,gBAAgB,EAChB,kBAAkB,EAClB,UAAU,EACV,cAAc,IAAI,iBAAiB,EAAE,+DAA+D;AACpG,kBAAkB,EAClB,UAAU,EACV,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,EACf,QAAQ,EACR,uBAAuB,EACvB,aAAa,EACb,mBAAmB,EACnB,yBAAyB,EACzB,YAAY,EACZ,sBAAsB,EACtB,iBAAiB,EACjB,q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gB,EAChB,cAAc,EACd,2BAA2B,EAC3B,2BAA2B,EAC3B,gBAAgB,IAAI,yBAAyB,EAC7C,iBAAiB,EACjB,gBAAgB,EAChB,qBAAqB,GACtB,MAAM,6BAA6B,CAAC;AAErC,OAAO,EACL,mBAAmB,EACnB,uBAAuB,EACvB,gBAAgB,EAChB,kBAAkB,EAClB,kBAAkB,EAClB,mBAAmB,EACnB,uBAAuB,EACvB,cAAc,IAAI,qBAAqB,GACxC,MAAM,yBAAyB,CAAC;AAGjC,OAAO,EACL,cAAc,EACd,UAAU,EACV,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,UAAU,EACV,mBAAmB,EACnB,mBAAmB,GACpB,MAAM,UAAU,CAAC;AAGlB,OAAO,EAAE,YAAY,EAAE,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAEjE,OAAO,EACL,WAAW,EACX,WAAW,EACX,YAAY,EACZ,mBAAmB,GACpB,MAAM,eAAe,CAAC;AAEvB;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,MAAM,WAAW,oBAAqB,SAAQ,OAAO;IACnD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,UAAU,GAAG,IAAI,CAAC;CAClC"}
|
package/dist/types/index.js
CHANGED
|
@@ -56,8 +56,6 @@ __exportStar(require("./rtmp-stream"), exports);
|
|
|
56
56
|
__exportStar(require("./enums"), exports);
|
|
57
57
|
// Core model interfaces
|
|
58
58
|
__exportStar(require("./models"), exports);
|
|
59
|
-
// Session-related interfaces
|
|
60
|
-
__exportStar(require("./user-session"), exports);
|
|
61
59
|
// Webhook interfaces
|
|
62
60
|
__exportStar(require("./webhooks"), exports);
|
|
63
61
|
// Capability Discovery types
|
package/dist/types/layouts.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LayoutType, ViewType } from
|
|
2
|
-
import { AppToCloudMessageType } from
|
|
3
|
-
import { BaseMessage } from
|
|
1
|
+
import { LayoutType, ViewType } from "./enums";
|
|
2
|
+
import { AppToCloudMessageType } from "./message-types";
|
|
3
|
+
import { BaseMessage } from "./messages/base";
|
|
4
4
|
/**
|
|
5
5
|
* Text wall layout
|
|
6
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"layouts.d.ts","sourceRoot":"","sources":["../../src/types/layouts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,QAAQ;
|
|
1
|
+
{"version":3,"file":"layouts.d.ts","sourceRoot":"","sources":["../../src/types/layouts.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;GAEG;AACH,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,UAAU,CAAC,SAAS,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,UAAU,CAAC,gBAAgB,CAAC;IACxC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC5B,UAAU,EAAE,UAAU,CAAC,cAAc,CAAC;IACtC,QAAQ,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