@amazon-devices/kepler-system-info 1.0.2
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/LICENSE +7 -0
- package/README.md +183 -0
- package/SystemBundles/e16a93a86b5ba76c92a98cffc1104c3097bec849eda18c214a4ba641eba38698.bundle +1252 -0
- package/SystemBundles/e16a93a86b5ba76c92a98cffc1104c3097bec849eda18c214a4ba641eba38698.bundle.map +1 -0
- package/SystemModules/amzn__kepler-system-info-1.modules.txt +10 -0
- package/SystemModules/amzn__kepler-system-info-1.private.modules.txt +12 -0
- package/SystemModules/keplerscript-system-bundle-config.json +7 -0
- package/THIRD_PARTY_NOTICES.txt +5993 -0
- package/dist/SystemInfoModule.d.ts +34 -0
- package/dist/SystemInfoModule.js +52 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +27 -0
- package/dist/kepler/tm-manifest.json +1 -0
- package/dist/turbo-modules/NativeSystemInfo.d.ts +18 -0
- package/dist/turbo-modules/NativeSystemInfo.js +4 -0
- package/dist/turbo-modules/interfaces/IBuildInfo.d.ts +55 -0
- package/dist/turbo-modules/interfaces/IBuildInfo.js +2 -0
- package/dist/turbo-modules/interfaces/IOperatingSystemInfo.d.ts +41 -0
- package/dist/turbo-modules/interfaces/IOperatingSystemInfo.js +2 -0
- package/dist/turbo-modules/interfaces/ISystemInfo.d.ts +25 -0
- package/dist/turbo-modules/interfaces/ISystemInfo.js +2 -0
- package/dist/turbo-modules/interfaces/index.d.ts +3 -0
- package/dist/turbo-modules/interfaces/index.js +2 -0
- package/dist/turbo-modules/types/BuildInfo.d.ts +10 -0
- package/dist/turbo-modules/types/BuildInfo.js +30 -0
- package/dist/turbo-modules/types/MonotonicDuration.d.ts +10 -0
- package/dist/turbo-modules/types/MonotonicDuration.js +14 -0
- package/dist/turbo-modules/types/OperatingSystemInfo.d.ts +8 -0
- package/dist/turbo-modules/types/OperatingSystemInfo.js +25 -0
- package/dist/turbo-modules/types/RawTimeValue.d.ts +8 -0
- package/dist/turbo-modules/types/RawTimeValue.js +14 -0
- package/dist/turbo-modules/types/RealTimeInstant.d.ts +10 -0
- package/dist/turbo-modules/types/RealTimeInstant.js +14 -0
- package/dist/turbo-modules/types/SystemInfo.d.ts +8 -0
- package/dist/turbo-modules/types/SystemInfo.js +22 -0
- package/dist/turbo-modules/types/index.d.ts +4 -0
- package/dist/turbo-modules/types/index.js +14 -0
- package/kepler-compatibility.json +6 -0
- package/kepler-transformed-package-info.json +3 -0
- package/package.json +1 -0
- package/react-native.config.js +17 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ISystemInfo } from "./turbo-modules/interfaces";
|
|
2
|
+
/**
|
|
3
|
+
* System Information APIs
|
|
4
|
+
*
|
|
5
|
+
* The package "@amazon-devices/kepler-system-info" provides interfaces for querying basic
|
|
6
|
+
* system-level information about the running operating system instance,
|
|
7
|
+
* including:
|
|
8
|
+
* - System uptime
|
|
9
|
+
* - Operating system version and name
|
|
10
|
+
* - Build information
|
|
11
|
+
* - System emulation status
|
|
12
|
+
*
|
|
13
|
+
* Key interfaces:
|
|
14
|
+
* - {@link SystemInfoModule}: Entry point for accessing system information.
|
|
15
|
+
* - {@link ISystemInfo}: Core interface for querying system information.
|
|
16
|
+
* - {@link IOperatingSystemInfo}: Interface for querying operating system information.
|
|
17
|
+
* - {@link IBuildInfo}: Interface for querying build-specific information.
|
|
18
|
+
*
|
|
19
|
+
* Example usage:
|
|
20
|
+
* ```ts
|
|
21
|
+
* import SystemInfoModule from "@amazon-devices/kepler-system-info"
|
|
22
|
+
* let systemInfo = SystemInfoModule.getSystemInfo();
|
|
23
|
+
* let uptime = await systemInfo.getUptime();
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
26
|
+
export default class SystemInfoModule {
|
|
27
|
+
/**
|
|
28
|
+
* Returns the instance of {@link ISystemInfo} for querying system
|
|
29
|
+
* information.
|
|
30
|
+
*
|
|
31
|
+
* @return instance of {@link ISystemInfo} for querying system information.
|
|
32
|
+
*/
|
|
33
|
+
static getSystemInfo(): ISystemInfo;
|
|
34
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/*
|
|
3
|
+
* Copyright 2025 Amazon.com, Inc. or its affiliates. All rights reserved.
|
|
4
|
+
*
|
|
5
|
+
* AMAZON PROPRIETARY/CONFIDENTIAL
|
|
6
|
+
*
|
|
7
|
+
* You may not use this file except in compliance with the terms and
|
|
8
|
+
* conditions set forth in the accompanying LICENSE.TXT file.
|
|
9
|
+
*
|
|
10
|
+
* THESE MATERIALS ARE PROVIDED ON AN "AS IS" BASIS. AMAZON SPECIFICALLY
|
|
11
|
+
* DISCLAIMS, WITH RESPECT TO THESE MATERIALS, ALL WARRANTIES, EXPRESS,
|
|
12
|
+
* IMPLIED, OR STATUTORY, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
|
13
|
+
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
const types_1 = require("./turbo-modules/types");
|
|
17
|
+
/**
|
|
18
|
+
* System Information APIs
|
|
19
|
+
*
|
|
20
|
+
* The package "@amazon-devices/kepler-system-info" provides interfaces for querying basic
|
|
21
|
+
* system-level information about the running operating system instance,
|
|
22
|
+
* including:
|
|
23
|
+
* - System uptime
|
|
24
|
+
* - Operating system version and name
|
|
25
|
+
* - Build information
|
|
26
|
+
* - System emulation status
|
|
27
|
+
*
|
|
28
|
+
* Key interfaces:
|
|
29
|
+
* - {@link SystemInfoModule}: Entry point for accessing system information.
|
|
30
|
+
* - {@link ISystemInfo}: Core interface for querying system information.
|
|
31
|
+
* - {@link IOperatingSystemInfo}: Interface for querying operating system information.
|
|
32
|
+
* - {@link IBuildInfo}: Interface for querying build-specific information.
|
|
33
|
+
*
|
|
34
|
+
* Example usage:
|
|
35
|
+
* ```ts
|
|
36
|
+
* import SystemInfoModule from "@amazon-devices/kepler-system-info"
|
|
37
|
+
* let systemInfo = SystemInfoModule.getSystemInfo();
|
|
38
|
+
* let uptime = await systemInfo.getUptime();
|
|
39
|
+
* ```
|
|
40
|
+
*/
|
|
41
|
+
class SystemInfoModule {
|
|
42
|
+
/**
|
|
43
|
+
* Returns the instance of {@link ISystemInfo} for querying system
|
|
44
|
+
* information.
|
|
45
|
+
*
|
|
46
|
+
* @return instance of {@link ISystemInfo} for querying system information.
|
|
47
|
+
*/
|
|
48
|
+
static getSystemInfo() {
|
|
49
|
+
return new types_1.SystemInfo();
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
exports.default = SystemInfoModule;
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { default as SystemInfoModule } from "./SystemInfoModule";
|
|
2
|
+
export { ISystemInfo } from "./turbo-modules/interfaces";
|
|
3
|
+
export { IOperatingSystemInfo } from "./turbo-modules/interfaces";
|
|
4
|
+
export { IBuildInfo } from "./turbo-modules/interfaces";
|
|
5
|
+
export { RawTimeValue } from "./turbo-modules/types";
|
|
6
|
+
export { RealTimeInstant } from "./turbo-modules/types";
|
|
7
|
+
export { MonotonicDuration } from "./turbo-modules/types";
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
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.MonotonicDuration = exports.RealTimeInstant = exports.RawTimeValue = exports.SystemInfoModule = void 0;
|
|
7
|
+
/*
|
|
8
|
+
* Copyright 2025 Amazon.com, Inc. or its affiliates. All rights reserved.
|
|
9
|
+
*
|
|
10
|
+
* AMAZON PROPRIETARY/CONFIDENTIAL
|
|
11
|
+
*
|
|
12
|
+
* You may not use this file except in compliance with the terms and
|
|
13
|
+
* conditions set forth in the accompanying LICENSE.TXT file.
|
|
14
|
+
*
|
|
15
|
+
* THESE MATERIALS ARE PROVIDED ON AN "AS IS" BASIS. AMAZON SPECIFICALLY
|
|
16
|
+
* DISCLAIMS, WITH RESPECT TO THESE MATERIALS, ALL WARRANTIES, EXPRESS,
|
|
17
|
+
* IMPLIED, OR STATUTORY, INCLUDING THE IMPLIED WARRANTIES OF MERCHANTABILITY,
|
|
18
|
+
* FITNESS FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
|
|
19
|
+
*/
|
|
20
|
+
var SystemInfoModule_1 = require("./SystemInfoModule");
|
|
21
|
+
Object.defineProperty(exports, "SystemInfoModule", { enumerable: true, get: function () { return __importDefault(SystemInfoModule_1).default; } });
|
|
22
|
+
var types_1 = require("./turbo-modules/types");
|
|
23
|
+
Object.defineProperty(exports, "RawTimeValue", { enumerable: true, get: function () { return types_1.RawTimeValue; } });
|
|
24
|
+
var types_2 = require("./turbo-modules/types");
|
|
25
|
+
Object.defineProperty(exports, "RealTimeInstant", { enumerable: true, get: function () { return types_2.RealTimeInstant; } });
|
|
26
|
+
var types_3 = require("./turbo-modules/types");
|
|
27
|
+
Object.defineProperty(exports, "MonotonicDuration", { enumerable: true, get: function () { return types_3.MonotonicDuration; } });
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"schema":1,"fileSets":{"native":[{"arch":"aarch64","variant":"release","directoryPath":"aarch64-release"},{"arch":"armv7","variant":"release","directoryPath":"armv7-release"},{"arch":"x86_64","variant":"release","directoryPath":"x86_64-release"}]}}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { KeplerTurboModule } from "@amazon-devices/keplerscript-turbomodule-api";
|
|
2
|
+
import { MonotonicDuration } from "./types";
|
|
3
|
+
import { RealTimeInstant } from "./types";
|
|
4
|
+
export interface NativeSystemInfo extends KeplerTurboModule {
|
|
5
|
+
getUptime(): Promise<MonotonicDuration>;
|
|
6
|
+
isEmulator(): Promise<boolean>;
|
|
7
|
+
getOsDisplayName(): Promise<string>;
|
|
8
|
+
getOsCodeName(): Promise<string>;
|
|
9
|
+
getOsVersion(): Promise<string>;
|
|
10
|
+
getBuildDisplayName(): Promise<string>;
|
|
11
|
+
getBuildId(): Promise<string>;
|
|
12
|
+
getBuildVariant(): Promise<string>;
|
|
13
|
+
getBuildTimestamp(): Promise<RealTimeInstant>;
|
|
14
|
+
getBuildTags(): Promise<string[]>;
|
|
15
|
+
getBuildFingerprint(): Promise<string>;
|
|
16
|
+
}
|
|
17
|
+
declare const _default: NativeSystemInfo;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const keplerscript_turbomodule_api_1 = require("@amazon-devices/keplerscript-turbomodule-api");
|
|
4
|
+
exports.default = keplerscript_turbomodule_api_1.TurboModuleRegistry.getEnforcing("SystemInfo");
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { RealTimeInstant } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Operating system build-specific information.
|
|
4
|
+
*/
|
|
5
|
+
export default interface IBuildInfo {
|
|
6
|
+
/**
|
|
7
|
+
* Returns the human-readable name of the operating system. The display name
|
|
8
|
+
* contains one or more properties of the operating system such as the
|
|
9
|
+
* codename and version separated by a delimiter.
|
|
10
|
+
*
|
|
11
|
+
* The display name DOES NOT follow a fixed schema and must be considered
|
|
12
|
+
* unique string for each OS release.
|
|
13
|
+
*
|
|
14
|
+
* For example, "Kepler/1.1".
|
|
15
|
+
*/
|
|
16
|
+
getDisplayName(): Promise<string>;
|
|
17
|
+
/**
|
|
18
|
+
* Returns the ID that uniquely identifies the build within the operating
|
|
19
|
+
* system.
|
|
20
|
+
*
|
|
21
|
+
* For example, "901010150820"
|
|
22
|
+
*/
|
|
23
|
+
getId(): Promise<string>;
|
|
24
|
+
/**
|
|
25
|
+
* Returns the variant representing the set of configurations used at the
|
|
26
|
+
* build time to determine how to compile and package with specific features
|
|
27
|
+
* and dependencies.
|
|
28
|
+
*
|
|
29
|
+
* For example, "user", "user-external" and more.
|
|
30
|
+
*/
|
|
31
|
+
getVariant(): Promise<string>;
|
|
32
|
+
/**
|
|
33
|
+
* Returns the timestamp of the build.
|
|
34
|
+
*/
|
|
35
|
+
getTimestamp(): Promise<RealTimeInstant>;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the list of tags describing the build.
|
|
38
|
+
*
|
|
39
|
+
* For example, "release-keys", "dev-keys" and more.
|
|
40
|
+
*/
|
|
41
|
+
getTags(): Promise<string[]>;
|
|
42
|
+
/**
|
|
43
|
+
* Returns the fingerprint string which uniquely identifies the build across
|
|
44
|
+
* devices and operating systems. It may contain one or more pieces of
|
|
45
|
+
* information such as device manufacturer, product, build id, variant, tags
|
|
46
|
+
* and more in the future separated by a delimiter.
|
|
47
|
+
*
|
|
48
|
+
* The fingerprint DOES NOT follow a fixed schema and must be considered
|
|
49
|
+
* unique string for each OS release.
|
|
50
|
+
*
|
|
51
|
+
* For example,
|
|
52
|
+
* "Amazon/kepler/901010150820/4.0.96525.0(3072cab629675a74)/1508N:user/release-keys"
|
|
53
|
+
*/
|
|
54
|
+
getFingerprint(): Promise<string>;
|
|
55
|
+
}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import IBuildInfo from "./IBuildInfo";
|
|
2
|
+
/**
|
|
3
|
+
* Operating System information.
|
|
4
|
+
*/
|
|
5
|
+
export default interface IOperatingSystemInfo {
|
|
6
|
+
/**
|
|
7
|
+
* Returns the human-readable, localized name of the operating system.
|
|
8
|
+
*
|
|
9
|
+
* The returned name is localized according to the following precedence:
|
|
10
|
+
* 1. User's locale preferences
|
|
11
|
+
* 2. System default locale
|
|
12
|
+
* 3. Static codename as fallback if localization is unavailable
|
|
13
|
+
*
|
|
14
|
+
* For example,
|
|
15
|
+
* ```
|
|
16
|
+
* "Kepler" (en-US)
|
|
17
|
+
* "केपलर" (hi-IN)
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
getDisplayName(): Promise<string>;
|
|
21
|
+
/**
|
|
22
|
+
* Returns the static codename of the operating system.
|
|
23
|
+
*
|
|
24
|
+
* For example, "Kepler".
|
|
25
|
+
*/
|
|
26
|
+
getCodeName(): Promise<string>;
|
|
27
|
+
/**
|
|
28
|
+
* Returns the version identifier of the operating system.
|
|
29
|
+
*
|
|
30
|
+
* For example, "1.1".
|
|
31
|
+
*
|
|
32
|
+
* The version string DOES NOT follow a fixed schema and must be considered
|
|
33
|
+
* unique string for each OS release.
|
|
34
|
+
*/
|
|
35
|
+
getVersion(): Promise<string>;
|
|
36
|
+
/**
|
|
37
|
+
* Returns the instance of {@link IBuildInfo} for querying operating system build
|
|
38
|
+
* information.
|
|
39
|
+
*/
|
|
40
|
+
getBuildInfo(): IBuildInfo;
|
|
41
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import IOperatingSystemInfo from "./IOperatingSystemInfo";
|
|
2
|
+
import { MonotonicDuration } from "../types";
|
|
3
|
+
/**
|
|
4
|
+
* Core interface for querying system information.
|
|
5
|
+
*/
|
|
6
|
+
export default interface ISystemInfo {
|
|
7
|
+
/**
|
|
8
|
+
* Returns the duration since the system was last booted.
|
|
9
|
+
*/
|
|
10
|
+
getUptime(): Promise<MonotonicDuration>;
|
|
11
|
+
/**
|
|
12
|
+
* Returns `true` if the system is running in a virtualized environment rather
|
|
13
|
+
* than on real hardware.
|
|
14
|
+
*
|
|
15
|
+
* The term “Emulator” is used as a general term to
|
|
16
|
+
* include both emulators and simulators, so this property returns true for
|
|
17
|
+
* any non-physical device, regardless of the platform.
|
|
18
|
+
*/
|
|
19
|
+
isEmulator(): Promise<boolean>;
|
|
20
|
+
/**
|
|
21
|
+
* Returns the instance of {@link IOperatingSystemInfo} for querying operating system
|
|
22
|
+
* information.
|
|
23
|
+
*/
|
|
24
|
+
getOperatingSystemInfo(): IOperatingSystemInfo;
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import IBuildInfo from '../interfaces/IBuildInfo';
|
|
2
|
+
import RealTimeInstant from './RealTimeInstant';
|
|
3
|
+
export default class BuildInfo implements IBuildInfo {
|
|
4
|
+
getDisplayName(): Promise<string>;
|
|
5
|
+
getId(): Promise<string>;
|
|
6
|
+
getVariant(): Promise<string>;
|
|
7
|
+
getTimestamp(): Promise<RealTimeInstant>;
|
|
8
|
+
getTags(): Promise<string[]>;
|
|
9
|
+
getFingerprint(): Promise<string>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
const NativeSystemInfo_1 = __importDefault(require("../NativeSystemInfo"));
|
|
7
|
+
if (!NativeSystemInfo_1.default) {
|
|
8
|
+
throw new Error('System info is unavailable');
|
|
9
|
+
}
|
|
10
|
+
class BuildInfo {
|
|
11
|
+
async getDisplayName() {
|
|
12
|
+
return NativeSystemInfo_1.default.getBuildDisplayName();
|
|
13
|
+
}
|
|
14
|
+
async getId() {
|
|
15
|
+
return NativeSystemInfo_1.default.getBuildId();
|
|
16
|
+
}
|
|
17
|
+
async getVariant() {
|
|
18
|
+
return NativeSystemInfo_1.default.getBuildVariant();
|
|
19
|
+
}
|
|
20
|
+
async getTimestamp() {
|
|
21
|
+
return NativeSystemInfo_1.default.getBuildTimestamp();
|
|
22
|
+
}
|
|
23
|
+
async getTags() {
|
|
24
|
+
return NativeSystemInfo_1.default.getBuildTags();
|
|
25
|
+
}
|
|
26
|
+
async getFingerprint() {
|
|
27
|
+
return NativeSystemInfo_1.default.getBuildFingerprint();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.default = BuildInfo;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import RawTimeValue from './RawTimeValue';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a span of time. This type follows ISO 8601 Duration definition.
|
|
4
|
+
* This type is typically used for system timeouts and can be a result of
|
|
5
|
+
* comparison operations between two instances of `MonotonicInstant`.
|
|
6
|
+
*/
|
|
7
|
+
export default class MonotonicDuration {
|
|
8
|
+
time: RawTimeValue;
|
|
9
|
+
constructor(time: RawTimeValue);
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Represents a span of time. This type follows ISO 8601 Duration definition.
|
|
5
|
+
* This type is typically used for system timeouts and can be a result of
|
|
6
|
+
* comparison operations between two instances of `MonotonicInstant`.
|
|
7
|
+
*/
|
|
8
|
+
class MonotonicDuration {
|
|
9
|
+
time;
|
|
10
|
+
constructor(time) {
|
|
11
|
+
this.time = time;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.default = MonotonicDuration;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import IOperatingSystemInfo from "../interfaces/IOperatingSystemInfo";
|
|
2
|
+
import IBuildInfo from "../interfaces/IBuildInfo";
|
|
3
|
+
export default class OperatingSystemInfo implements IOperatingSystemInfo {
|
|
4
|
+
getDisplayName(): Promise<string>;
|
|
5
|
+
getCodeName(): Promise<string>;
|
|
6
|
+
getVersion(): Promise<string>;
|
|
7
|
+
getBuildInfo(): IBuildInfo;
|
|
8
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
const BuildInfo_1 = __importDefault(require("./BuildInfo"));
|
|
7
|
+
const NativeSystemInfo_1 = __importDefault(require("../NativeSystemInfo"));
|
|
8
|
+
if (!NativeSystemInfo_1.default) {
|
|
9
|
+
throw new Error("System info is unavailable");
|
|
10
|
+
}
|
|
11
|
+
class OperatingSystemInfo {
|
|
12
|
+
async getDisplayName() {
|
|
13
|
+
return NativeSystemInfo_1.default.getOsDisplayName();
|
|
14
|
+
}
|
|
15
|
+
async getCodeName() {
|
|
16
|
+
return NativeSystemInfo_1.default.getOsCodeName();
|
|
17
|
+
}
|
|
18
|
+
async getVersion() {
|
|
19
|
+
return NativeSystemInfo_1.default.getOsVersion();
|
|
20
|
+
}
|
|
21
|
+
getBuildInfo() {
|
|
22
|
+
return new BuildInfo_1.default();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
exports.default = OperatingSystemInfo;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* A basic type used to describe both absolute and relative time.
|
|
5
|
+
*/
|
|
6
|
+
class RawTimeValue {
|
|
7
|
+
seconds;
|
|
8
|
+
nanoseconds;
|
|
9
|
+
constructor(seconds, nanoseconds) {
|
|
10
|
+
this.seconds = seconds;
|
|
11
|
+
this.nanoseconds = nanoseconds;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.default = RawTimeValue;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import RawTimeValue from './RawTimeValue';
|
|
2
|
+
/**
|
|
3
|
+
* Represents a point in time in the system's clock. Useful for
|
|
4
|
+
* talking to external entities like the file system or
|
|
5
|
+
* other processes.
|
|
6
|
+
*/
|
|
7
|
+
export default class RealTimeInstant {
|
|
8
|
+
time: RawTimeValue;
|
|
9
|
+
constructor(time: RawTimeValue);
|
|
10
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
/**
|
|
4
|
+
* Represents a point in time in the system's clock. Useful for
|
|
5
|
+
* talking to external entities like the file system or
|
|
6
|
+
* other processes.
|
|
7
|
+
*/
|
|
8
|
+
class RealTimeInstant {
|
|
9
|
+
time;
|
|
10
|
+
constructor(time) {
|
|
11
|
+
this.time = time;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.default = RealTimeInstant;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import ISystemInfo from "../interfaces/ISystemInfo";
|
|
2
|
+
import IOperatingSystemInfo from "../interfaces/IOperatingSystemInfo";
|
|
3
|
+
import MonotonicDuration from "./MonotonicDuration";
|
|
4
|
+
export default class SystemInfo implements ISystemInfo {
|
|
5
|
+
getUptime(): Promise<MonotonicDuration>;
|
|
6
|
+
isEmulator(): Promise<boolean>;
|
|
7
|
+
getOperatingSystemInfo(): IOperatingSystemInfo;
|
|
8
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
const NativeSystemInfo_1 = __importDefault(require("../NativeSystemInfo"));
|
|
7
|
+
const OperatingSystemInfo_1 = __importDefault(require("./OperatingSystemInfo"));
|
|
8
|
+
if (!NativeSystemInfo_1.default) {
|
|
9
|
+
throw new Error("System info is unavailable");
|
|
10
|
+
}
|
|
11
|
+
class SystemInfo {
|
|
12
|
+
async getUptime() {
|
|
13
|
+
return NativeSystemInfo_1.default.getUptime();
|
|
14
|
+
}
|
|
15
|
+
async isEmulator() {
|
|
16
|
+
return NativeSystemInfo_1.default.isEmulator();
|
|
17
|
+
}
|
|
18
|
+
getOperatingSystemInfo() {
|
|
19
|
+
return new OperatingSystemInfo_1.default();
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.default = SystemInfo;
|
|
@@ -0,0 +1,14 @@
|
|
|
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.MonotonicDuration = exports.RealTimeInstant = exports.RawTimeValue = exports.SystemInfo = void 0;
|
|
7
|
+
var SystemInfo_1 = require("./SystemInfo");
|
|
8
|
+
Object.defineProperty(exports, "SystemInfo", { enumerable: true, get: function () { return __importDefault(SystemInfo_1).default; } });
|
|
9
|
+
var RawTimeValue_1 = require("./RawTimeValue");
|
|
10
|
+
Object.defineProperty(exports, "RawTimeValue", { enumerable: true, get: function () { return __importDefault(RawTimeValue_1).default; } });
|
|
11
|
+
var RealTimeInstant_1 = require("./RealTimeInstant");
|
|
12
|
+
Object.defineProperty(exports, "RealTimeInstant", { enumerable: true, get: function () { return __importDefault(RealTimeInstant_1).default; } });
|
|
13
|
+
var MonotonicDuration_1 = require("./MonotonicDuration");
|
|
14
|
+
Object.defineProperty(exports, "MonotonicDuration", { enumerable: true, get: function () { return __importDefault(MonotonicDuration_1).default; } });
|
package/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name": "@amazon-devices/kepler-system-info", "version": "1.0.2", "main": "dist/index.js", "types": "dist/index.d.ts", "files": ["dist", "react-native.config.js", "kepler-compatibility.json", "SystemModules", "SystemBundles", "THIRD_PARTY_NOTICES.txt", "kepler-transformed-package-info.json"], "scripts": {"clean": "rm -rf node_modules buildinfo.json dist bvm build", "build:js": "tsc -p tsconfig.json", "build:native:debug": "kepler build -b Debug", "build:native:release": "kepler build -b Release", "build": "npm-run-all build:js build:native:release", "build:debug": "npm-run-all build:js build:native:debug", "prepublishOnly": "KEPLER_NPM_COMMAND=npm-pretty-much react-native build-system-bundle-kepler"}, "dependencies": {"@amazon-devices/keplerscript-turbomodule-api": "^1.0.0"}, "devDependencies": {"@react-native/eslint-config": "0.72.2", "@types/jest": "^28.0.0", "@typescript-eslint/eslint-plugin": "^5.30.0", "babel-jest": "^28.0.0", "eslint": "^8.12.0", "jest": "^28.0.0", "metro-react-native-babel-preset": "^0.76.5", "npm-run-all": "^4.1.5", "prettier": "^2.6.2", "ts-jest": "^28.0.0", "typescript": "4.8.4", "@amazon-devices/kepler-cli-platform": "^0", "@react-native-community/cli": "^11.2.0"}, "kepler": {"projectType": "turbomodule", "targets": ["tv"], "features": ["vega"], "api": 0.1}, "license": "See license in LICENSE"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
dependency: {
|
|
3
|
+
platforms: {
|
|
4
|
+
kepler: {
|
|
5
|
+
autolink: {
|
|
6
|
+
keplersysteminfo: {
|
|
7
|
+
libraryName: 'libKeplerSystemInfoTM.so.1',
|
|
8
|
+
linkDynamic: true,
|
|
9
|
+
provider: 'custom',
|
|
10
|
+
components: [],
|
|
11
|
+
turbomodules: ['SystemInfo'],
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
};
|