@amazon-devices/kepler-epg-sync-scheduler 1.2.94
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/SystemBundles/e5daca3a948d94191e9770d49f9bfd4b7836923f555f25442ae71cf2ae7ca95a.bundle +1263 -0
- package/SystemBundles/e5daca3a948d94191e9770d49f9bfd4b7836923f555f25442ae71cf2ae7ca95a.bundle.map +1 -0
- package/SystemModules/amzn__kepler-epg-sync-scheduler-1.modules.txt +6 -0
- package/SystemModules/amzn__kepler-epg-sync-scheduler-1.private.modules.txt +20 -0
- package/SystemModules/keplerscript-system-bundle-config.json +7 -0
- package/THIRD_PARTY_NOTICES.txt +5993 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +24 -0
- package/dist/kepler/tm-manifest.json +1 -0
- package/dist/turbo-modules/Builder.d.ts +7 -0
- package/dist/turbo-modules/Builder.js +16 -0
- package/dist/turbo-modules/EpgSyncTaskScheduler.d.ts +52 -0
- package/dist/turbo-modules/EpgSyncTaskScheduler.js +55 -0
- package/dist/turbo-modules/Error.d.ts +15 -0
- package/dist/turbo-modules/Error.js +21 -0
- package/dist/turbo-modules/NativeEpgSyncTaskScheduler.d.ts +12 -0
- package/dist/turbo-modules/NativeEpgSyncTaskScheduler.js +6 -0
- package/dist/turbo-modules/TimeProperties.d.ts +77 -0
- package/dist/turbo-modules/TimeProperties.js +137 -0
- package/dist/turbo-modules/__mocks__/NativeEpgSyncTaskScheduler.d.ts +7 -0
- package/dist/turbo-modules/__mocks__/NativeEpgSyncTaskScheduler.js +8 -0
- package/kepler-compatibility.json +44 -0
- package/kepler-transformed-package-info.json +3 -0
- package/package.json +1 -0
- package/react-native.config.js +20 -0
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
+
};
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.EpgSyncTaskScheduler = void 0;
|
|
21
|
+
__exportStar(require("./turbo-modules/Error"), exports);
|
|
22
|
+
__exportStar(require("./turbo-modules/TimeProperties"), exports);
|
|
23
|
+
var EpgSyncTaskScheduler_1 = require("./turbo-modules/EpgSyncTaskScheduler");
|
|
24
|
+
Object.defineProperty(exports, "EpgSyncTaskScheduler", { enumerable: true, get: function () { return __importDefault(EpgSyncTaskScheduler_1).default; } });
|
|
@@ -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"},{"arch":"aarch64","variant":"debug","directoryPath":"aarch64-debug"},{"arch":"armv7","variant":"debug","directoryPath":"armv7-debug"},{"arch":"x86_64","variant":"debug","directoryPath":"x86_64-debug"}]}}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Builder = void 0;
|
|
4
|
+
const Error_1 = require("./Error");
|
|
5
|
+
class Builder {
|
|
6
|
+
_hasAlreadyBeenBuilt = false;
|
|
7
|
+
throwErrorIfBuilderAlreadyUsed() {
|
|
8
|
+
if (this._hasAlreadyBeenBuilt) {
|
|
9
|
+
throw new Error_1.IllegalStateError(`${this._className} cannot be reused after it has been used to build an object.`);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
markBuilderAsUsed() {
|
|
13
|
+
this._hasAlreadyBeenBuilt = true;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.Builder = Builder;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { ITimeProperties } from './TimeProperties';
|
|
2
|
+
/**
|
|
3
|
+
* @brief An interface that exposes functions to schedule an EPG Sync task.
|
|
4
|
+
*/
|
|
5
|
+
export interface IEpgSyncTaskScheduler {
|
|
6
|
+
/**
|
|
7
|
+
* @brief Function to schedule the provided EPG Sync Task at the given time interval.
|
|
8
|
+
*
|
|
9
|
+
* @details This function will first schedule the EPG task to be run immediately. And then it will
|
|
10
|
+
* schedule the EPG Sync Task to be executed at the interval specified. The interval passed to this
|
|
11
|
+
* function is be in minutes and should be between 5 mins and 1440 mins inclusive.
|
|
12
|
+
* Only one EPG Sync Task can be scheduled at any point in time. The most recent EPG Sync Task
|
|
13
|
+
* method call will be fulfilled and persisted across reboots.
|
|
14
|
+
*
|
|
15
|
+
* @param {string} componentId - The component Id for the JS background task that has to be scheduled.
|
|
16
|
+
* @param {number} interval - The time interval in mins the OS will wait before triggering the next sync task.
|
|
17
|
+
*
|
|
18
|
+
* @throws {InternalError} Throws an `InternalError` if the scheduler encounters an error when scheduling the sync task.
|
|
19
|
+
*
|
|
20
|
+
* @returns {Promise<void>} A Promise that resolves to void if the operation completed successfully.
|
|
21
|
+
*/
|
|
22
|
+
scheduleTask: (componentId: string, interval: number) => Promise<void>;
|
|
23
|
+
/**
|
|
24
|
+
* @brief Function to schedule the provided periodic EPG Sync Task with a specified time window constraint for execution.
|
|
25
|
+
*
|
|
26
|
+
* @details This function will first schedule the EPG task to be run immediately. And then it will schedule the
|
|
27
|
+
* EPG Sync Task to be executed at the given start time and execution window in UTC everyday. Only one EPG Sync Task
|
|
28
|
+
* can be scheduled at any point in time. The most recent EPG Sync Task method call will be fulfilled and
|
|
29
|
+
* persisted across reboots.
|
|
30
|
+
*
|
|
31
|
+
* @param {string} componentId - The component Id for the JS background task that has to be scheduled.
|
|
32
|
+
* @param {ITimeProperties} timeProperties - The time properties to associate with the EPG Sync Task.
|
|
33
|
+
*
|
|
34
|
+
* @throws {InternalError} Throws an `InternalError` if the scheduler encounters an error when scheduling the sync task.
|
|
35
|
+
*
|
|
36
|
+
* @returns {Promise<void>} A Promise that resolves to void if the operation completed successfully.
|
|
37
|
+
*/
|
|
38
|
+
scheduleTaskWithExecutionWindow: (componentId: string, timeProperties: ITimeProperties) => Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* @brief Function to cancel the existing scheduled EPG sync tasks.
|
|
41
|
+
*
|
|
42
|
+
* @details This function will cancel the scheduled EPG sync tasks registered by scheduleTask() or scheduleTaskWithExecutionWindow().
|
|
43
|
+
* It succeeds even if there are no currently scheduled tasks.
|
|
44
|
+
*
|
|
45
|
+
* @throws {InternalError} Throws an `InternalError` if the scheduler encounters an error when canceling the scheduled sync tasks.
|
|
46
|
+
*
|
|
47
|
+
* @returns {Promise<void>} A Promise that resolves to void if the operation completed successfully.
|
|
48
|
+
*/
|
|
49
|
+
cancelScheduledTasks: () => Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
declare const _default: IEpgSyncTaskScheduler;
|
|
52
|
+
export default _default;
|
|
@@ -0,0 +1,55 @@
|
|
|
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 NativeEpgSyncTaskScheduler_1 = __importDefault(require("./NativeEpgSyncTaskScheduler"));
|
|
7
|
+
const Error_1 = require("./Error");
|
|
8
|
+
/**
|
|
9
|
+
* @copydoc IEpgSyncTaskScheduler
|
|
10
|
+
*/
|
|
11
|
+
class EpgSyncTaskScheduler {
|
|
12
|
+
/**
|
|
13
|
+
* @copydoc IEpgSyncTaskScheduler::scheduleTask
|
|
14
|
+
*/
|
|
15
|
+
scheduleTask(componentId, interval) {
|
|
16
|
+
return new Promise((resolve, reject) => {
|
|
17
|
+
NativeEpgSyncTaskScheduler_1.default.scheduleTask(componentId, interval)
|
|
18
|
+
.catch(_ => {
|
|
19
|
+
reject(new Error_1.InternalError('Schedule task failed due to internal error'));
|
|
20
|
+
})
|
|
21
|
+
.then(() => {
|
|
22
|
+
resolve();
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* @copydoc IEpgSyncTaskScheduler::scheduleTaskWithExecutionWindow
|
|
28
|
+
*/
|
|
29
|
+
scheduleTaskWithExecutionWindow(componentId, timeProperties) {
|
|
30
|
+
return new Promise((resolve, reject) => {
|
|
31
|
+
NativeEpgSyncTaskScheduler_1.default.scheduleTaskWithExecutionWindow(componentId, timeProperties)
|
|
32
|
+
.catch(_ => {
|
|
33
|
+
reject(new Error_1.InternalError('Schedule task with execution window failed due to internal error'));
|
|
34
|
+
})
|
|
35
|
+
.then(() => {
|
|
36
|
+
resolve();
|
|
37
|
+
});
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* @copydoc IEpgSyncTaskScheduler::cancelScheduledTask
|
|
42
|
+
*/
|
|
43
|
+
cancelScheduledTasks() {
|
|
44
|
+
return new Promise((resolve, reject) => {
|
|
45
|
+
NativeEpgSyncTaskScheduler_1.default.cancelScheduledTasks()
|
|
46
|
+
.catch(_ => {
|
|
47
|
+
reject(new Error_1.InternalError('Cancel task failed due to internal error'));
|
|
48
|
+
})
|
|
49
|
+
.then(() => {
|
|
50
|
+
resolve();
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
exports.default = new EpgSyncTaskScheduler();
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A custom Error type to indicate that something went wrong when scheduling the EPG Sync Task.
|
|
3
|
+
*/
|
|
4
|
+
export declare class InternalError extends Error {
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Exception thrown when there is a failure in creating a new object.
|
|
8
|
+
*/
|
|
9
|
+
export declare class InvalidArgumentError extends Error {
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Exception thrown when functions of a builder are called after it has already been used to build an object.
|
|
13
|
+
*/
|
|
14
|
+
export declare class IllegalStateError extends Error {
|
|
15
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.IllegalStateError = exports.InvalidArgumentError = exports.InternalError = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* A custom Error type to indicate that something went wrong when scheduling the EPG Sync Task.
|
|
6
|
+
*/
|
|
7
|
+
class InternalError extends Error {
|
|
8
|
+
}
|
|
9
|
+
exports.InternalError = InternalError;
|
|
10
|
+
/**
|
|
11
|
+
* Exception thrown when there is a failure in creating a new object.
|
|
12
|
+
*/
|
|
13
|
+
class InvalidArgumentError extends Error {
|
|
14
|
+
}
|
|
15
|
+
exports.InvalidArgumentError = InvalidArgumentError;
|
|
16
|
+
/**
|
|
17
|
+
* Exception thrown when functions of a builder are called after it has already been used to build an object.
|
|
18
|
+
*/
|
|
19
|
+
class IllegalStateError extends Error {
|
|
20
|
+
}
|
|
21
|
+
exports.IllegalStateError = IllegalStateError;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { KeplerTurboModule } from '@amazon-devices/keplerscript-turbomodule-api';
|
|
2
|
+
import { ITimeProperties } from './TimeProperties';
|
|
3
|
+
interface NativeEpgSyncTaskScheduler extends KeplerTurboModule {
|
|
4
|
+
getMajorVersion: () => number;
|
|
5
|
+
getMinorVersion: () => number;
|
|
6
|
+
getPatchVersion: () => number;
|
|
7
|
+
scheduleTask: (componentId: string, interval: number) => Promise<string>;
|
|
8
|
+
scheduleTaskWithExecutionWindow: (componentId: string, timeProperties: ITimeProperties) => Promise<string>;
|
|
9
|
+
cancelScheduledTasks: () => Promise<string>;
|
|
10
|
+
}
|
|
11
|
+
declare const _default: NativeEpgSyncTaskScheduler;
|
|
12
|
+
export default _default;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
//@ts-ignore
|
|
4
|
+
const keplerscript_turbomodule_api_1 = require("@amazon-devices/keplerscript-turbomodule-api");
|
|
5
|
+
/* // tslint:disable-next-line */
|
|
6
|
+
exports.default = keplerscript_turbomodule_api_1.TurboModuleRegistry.getEnforcing('NativeEpgSyncTaskScheduler');
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { Builder } from './Builder';
|
|
2
|
+
/**
|
|
3
|
+
* Interface for the `TimeProperties` class.
|
|
4
|
+
* The `ITimeProperties` describes the time constraint for task execution.
|
|
5
|
+
* Use the `UtcTimePropertiesBuilder` to create an object that conforms to
|
|
6
|
+
* `ITimeProperties`.
|
|
7
|
+
*/
|
|
8
|
+
export interface ITimeProperties {
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Builder that creates an instance of the `TimeProperties` object.
|
|
12
|
+
* The `UtcTimePropertiesBuilder` allows callers to create an instance
|
|
13
|
+
* `ITimeProperties` in UTC. The constraint is a combination of a start time
|
|
14
|
+
* and an execution window. For instance, if we want the EPG sync task
|
|
15
|
+
* to be executed between 2AM and 4AM UTC, then the timeProperties can be built as
|
|
16
|
+
* `UtcTimePropertiesBuilder.startHour(2).startMinute(0).startSecond(0).executionWindowInMinutes(120).build();`
|
|
17
|
+
*/
|
|
18
|
+
export declare class UtcTimePropertiesBuilder extends Builder<ITimeProperties> {
|
|
19
|
+
private _startHour?;
|
|
20
|
+
private _startMinute?;
|
|
21
|
+
private _startSecond?;
|
|
22
|
+
private _executionWindow?;
|
|
23
|
+
protected readonly _className: string;
|
|
24
|
+
/**
|
|
25
|
+
* Sets the start hour in the `TimeProperties`.
|
|
26
|
+
*
|
|
27
|
+
* @details This field is required for the time properties.
|
|
28
|
+
* @param {number} hour Represents Hour (0-23).
|
|
29
|
+
* @returns {UtcTimePropertiesBuilder} The `UtcTimePropertiesBuilder` object with the start hour set.
|
|
30
|
+
* @throws `IllegalStateError` if the function is called after this builder instance
|
|
31
|
+
* has already built an object once.
|
|
32
|
+
* @throws `InvalidArgumentError` if the number of hour is not in the range between 0 and 23.
|
|
33
|
+
*/
|
|
34
|
+
startHour(hour: number): UtcTimePropertiesBuilder;
|
|
35
|
+
/**
|
|
36
|
+
* Sets the start minute in the `TimeProperties`.
|
|
37
|
+
*
|
|
38
|
+
* @details This field is required for the time properties.
|
|
39
|
+
* @param {number} minute Represents Minute (0-59).
|
|
40
|
+
* @returns {UtcTimePropertiesBuilder} The `UtcTimePropertiesBuilder` object with the start minute set.
|
|
41
|
+
* @throws `IllegalStateError` if the function is called after this builder instance
|
|
42
|
+
* has already built an object once.
|
|
43
|
+
* @throws `InvalidArgumentError` if the number of minute is not in the range between 0 and 59.
|
|
44
|
+
*/
|
|
45
|
+
startMinute(minute: number): UtcTimePropertiesBuilder;
|
|
46
|
+
/**
|
|
47
|
+
* Sets the start second in the `TimeProperties`.
|
|
48
|
+
*
|
|
49
|
+
* @details This field is required for the time properties.
|
|
50
|
+
* @param {number} second Represents Second (0-59).
|
|
51
|
+
* @returns {UtcTimePropertiesBuilder} The `UtcTimePropertiesBuilder` object with the start second set.
|
|
52
|
+
* @throws `IllegalStateError` if the function is called after this builder instance
|
|
53
|
+
* has already built an object once.
|
|
54
|
+
* @throws `InvalidArgumentError` if the number of second is not in the range between 0 and 59.
|
|
55
|
+
*/
|
|
56
|
+
startSecond(second: number): UtcTimePropertiesBuilder;
|
|
57
|
+
/**
|
|
58
|
+
* Sets the length of the execution time window in the `TimeProperties`.
|
|
59
|
+
*
|
|
60
|
+
* @details This field is optional for the time properties. The default value is 60 mins.
|
|
61
|
+
* @param {number} window The length of the execution time window in mins.
|
|
62
|
+
* @returns {UtcTimePropertiesBuilder} The `UtcTimePropertiesBuilder` object with the execution window set.
|
|
63
|
+
* @throws `IllegalStateError` if the function is called after this builder instance
|
|
64
|
+
* has already built an object once.
|
|
65
|
+
* @throws `InvalidArgumentError` if the execution window is smaller than 1 hour.
|
|
66
|
+
*/
|
|
67
|
+
executionWindowInMinutes(window: number): UtcTimePropertiesBuilder;
|
|
68
|
+
/**
|
|
69
|
+
* Builds the `TimeProperties` object based on the parameters provided.
|
|
70
|
+
*
|
|
71
|
+
* @returns {ITimeProperties} The built `TimeProperties` object.
|
|
72
|
+
* @throws `InvalidArgumentError` if one or more of the required fields are missing.
|
|
73
|
+
* @throws `IllegalStateError` if the function is called after this builder instance
|
|
74
|
+
* has already built an object once.
|
|
75
|
+
*/
|
|
76
|
+
build(): ITimeProperties;
|
|
77
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.UtcTimePropertiesBuilder = void 0;
|
|
4
|
+
const Error_1 = require("./Error");
|
|
5
|
+
const Builder_1 = require("./Builder");
|
|
6
|
+
/**
|
|
7
|
+
* Class object representing a Time Struct.
|
|
8
|
+
* This object should be built using `TimePropertiesBuilder`.
|
|
9
|
+
*/
|
|
10
|
+
class TimeProperties {
|
|
11
|
+
_startHour;
|
|
12
|
+
_startMinute;
|
|
13
|
+
_startSecond;
|
|
14
|
+
_executionWindow;
|
|
15
|
+
_localTime;
|
|
16
|
+
/**
|
|
17
|
+
* Constructor function called for initialization of a `TimeProperties` object.
|
|
18
|
+
*/
|
|
19
|
+
constructor(startHour, startMinute, startSecond, executionWindow = 60, localTime) {
|
|
20
|
+
this._startHour = startHour;
|
|
21
|
+
this._startMinute = startMinute;
|
|
22
|
+
this._startSecond = startSecond;
|
|
23
|
+
this._executionWindow = executionWindow;
|
|
24
|
+
this._localTime = localTime;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Builder that creates an instance of the `TimeProperties` object.
|
|
29
|
+
* The `UtcTimePropertiesBuilder` allows callers to create an instance
|
|
30
|
+
* `ITimeProperties` in UTC. The constraint is a combination of a start time
|
|
31
|
+
* and an execution window. For instance, if we want the EPG sync task
|
|
32
|
+
* to be executed between 2AM and 4AM UTC, then the timeProperties can be built as
|
|
33
|
+
* `UtcTimePropertiesBuilder.startHour(2).startMinute(0).startSecond(0).executionWindowInMinutes(120).build();`
|
|
34
|
+
*/
|
|
35
|
+
class UtcTimePropertiesBuilder extends Builder_1.Builder {
|
|
36
|
+
_startHour;
|
|
37
|
+
_startMinute;
|
|
38
|
+
_startSecond;
|
|
39
|
+
_executionWindow;
|
|
40
|
+
_className = 'UtcTimePropertiesBuilder';
|
|
41
|
+
/**
|
|
42
|
+
* Sets the start hour in the `TimeProperties`.
|
|
43
|
+
*
|
|
44
|
+
* @details This field is required for the time properties.
|
|
45
|
+
* @param {number} hour Represents Hour (0-23).
|
|
46
|
+
* @returns {UtcTimePropertiesBuilder} The `UtcTimePropertiesBuilder` object with the start hour set.
|
|
47
|
+
* @throws `IllegalStateError` if the function is called after this builder instance
|
|
48
|
+
* has already built an object once.
|
|
49
|
+
* @throws `InvalidArgumentError` if the number of hour is not in the range between 0 and 23.
|
|
50
|
+
*/
|
|
51
|
+
startHour(hour) {
|
|
52
|
+
this.throwErrorIfBuilderAlreadyUsed();
|
|
53
|
+
if (hour < 0 || hour > 23) {
|
|
54
|
+
throw new Error_1.InvalidArgumentError('InvalidArgumentError - hour value is invalid');
|
|
55
|
+
}
|
|
56
|
+
this._startHour = hour;
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Sets the start minute in the `TimeProperties`.
|
|
61
|
+
*
|
|
62
|
+
* @details This field is required for the time properties.
|
|
63
|
+
* @param {number} minute Represents Minute (0-59).
|
|
64
|
+
* @returns {UtcTimePropertiesBuilder} The `UtcTimePropertiesBuilder` object with the start minute set.
|
|
65
|
+
* @throws `IllegalStateError` if the function is called after this builder instance
|
|
66
|
+
* has already built an object once.
|
|
67
|
+
* @throws `InvalidArgumentError` if the number of minute is not in the range between 0 and 59.
|
|
68
|
+
*/
|
|
69
|
+
startMinute(minute) {
|
|
70
|
+
this.throwErrorIfBuilderAlreadyUsed();
|
|
71
|
+
if (minute < 0 || minute > 59) {
|
|
72
|
+
throw new Error_1.InvalidArgumentError('InvalidArgumentError - minute value is invalid');
|
|
73
|
+
}
|
|
74
|
+
this._startMinute = minute;
|
|
75
|
+
return this;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Sets the start second in the `TimeProperties`.
|
|
79
|
+
*
|
|
80
|
+
* @details This field is required for the time properties.
|
|
81
|
+
* @param {number} second Represents Second (0-59).
|
|
82
|
+
* @returns {UtcTimePropertiesBuilder} The `UtcTimePropertiesBuilder` object with the start second set.
|
|
83
|
+
* @throws `IllegalStateError` if the function is called after this builder instance
|
|
84
|
+
* has already built an object once.
|
|
85
|
+
* @throws `InvalidArgumentError` if the number of second is not in the range between 0 and 59.
|
|
86
|
+
*/
|
|
87
|
+
startSecond(second) {
|
|
88
|
+
this.throwErrorIfBuilderAlreadyUsed();
|
|
89
|
+
if (second < 0 || second > 59) {
|
|
90
|
+
throw new Error_1.InvalidArgumentError('InvalidArgumentError - second value is invalid');
|
|
91
|
+
}
|
|
92
|
+
this._startSecond = second;
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Sets the length of the execution time window in the `TimeProperties`.
|
|
97
|
+
*
|
|
98
|
+
* @details This field is optional for the time properties. The default value is 60 mins.
|
|
99
|
+
* @param {number} window The length of the execution time window in mins.
|
|
100
|
+
* @returns {UtcTimePropertiesBuilder} The `UtcTimePropertiesBuilder` object with the execution window set.
|
|
101
|
+
* @throws `IllegalStateError` if the function is called after this builder instance
|
|
102
|
+
* has already built an object once.
|
|
103
|
+
* @throws `InvalidArgumentError` if the execution window is smaller than 1 hour.
|
|
104
|
+
*/
|
|
105
|
+
executionWindowInMinutes(window) {
|
|
106
|
+
this.throwErrorIfBuilderAlreadyUsed();
|
|
107
|
+
if (window < 60) {
|
|
108
|
+
throw new Error_1.InvalidArgumentError('InvalidArgumentError - Execution window must be at least 1 hour');
|
|
109
|
+
}
|
|
110
|
+
this._executionWindow = window;
|
|
111
|
+
return this;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Builds the `TimeProperties` object based on the parameters provided.
|
|
115
|
+
*
|
|
116
|
+
* @returns {ITimeProperties} The built `TimeProperties` object.
|
|
117
|
+
* @throws `InvalidArgumentError` if one or more of the required fields are missing.
|
|
118
|
+
* @throws `IllegalStateError` if the function is called after this builder instance
|
|
119
|
+
* has already built an object once.
|
|
120
|
+
*/
|
|
121
|
+
build() {
|
|
122
|
+
this.throwErrorIfBuilderAlreadyUsed();
|
|
123
|
+
if (this._startHour === undefined) {
|
|
124
|
+
throw new Error_1.InvalidArgumentError('InvalidArgumentError - hour is undefined');
|
|
125
|
+
}
|
|
126
|
+
if (this._startMinute === undefined) {
|
|
127
|
+
throw new Error_1.InvalidArgumentError('InvalidArgumentError - minute is undefined');
|
|
128
|
+
}
|
|
129
|
+
if (this._startSecond === undefined) {
|
|
130
|
+
throw new Error_1.InvalidArgumentError('InvalidArgumentError - second is undefined');
|
|
131
|
+
}
|
|
132
|
+
const timeProperties = new TimeProperties(this._startHour, this._startMinute, this._startSecond, this._executionWindow, false);
|
|
133
|
+
this.markBuilderAsUsed();
|
|
134
|
+
return timeProperties;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.UtcTimePropertiesBuilder = UtcTimePropertiesBuilder;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
{
|
|
2
|
+
"versions": {
|
|
3
|
+
"1.2.55": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
4
|
+
"1.2.56": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
5
|
+
"1.2.57": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
6
|
+
"1.2.58": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
7
|
+
"1.2.59": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
8
|
+
"1.2.60": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
9
|
+
"1.2.61": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
10
|
+
"1.2.62": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
11
|
+
"1.2.63": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
12
|
+
"1.2.64": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
13
|
+
"1.2.65": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
14
|
+
"1.2.66": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
15
|
+
"1.2.67": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
16
|
+
"1.2.68": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
17
|
+
"1.2.69": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
18
|
+
"1.2.70": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
19
|
+
"1.2.71": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
20
|
+
"1.2.72": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
21
|
+
"1.2.73": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
22
|
+
"1.2.74": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
23
|
+
"1.2.75": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
24
|
+
"1.2.76": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
25
|
+
"1.2.77": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
26
|
+
"1.2.78": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
27
|
+
"1.2.79": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
28
|
+
"1.2.80": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
29
|
+
"1.2.81": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
30
|
+
"1.2.82": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
31
|
+
"1.2.83": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
32
|
+
"1.2.84": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
33
|
+
"1.2.85": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
34
|
+
"1.2.86": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
35
|
+
"1.2.87": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
36
|
+
"1.2.88": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
37
|
+
"1.2.89": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
38
|
+
"1.2.90": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
39
|
+
"1.2.91": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
40
|
+
"1.2.92": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
41
|
+
"1.2.93": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2",
|
|
42
|
+
"1.2.94": "/com.amazon.kepler.kepler_epg_sync_scheduler_1@IKeplerEpgSyncScheduler_2"
|
|
43
|
+
}
|
|
44
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"name": "@amazon-devices/kepler-epg-sync-scheduler", "version": "1.2.94", "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 bundle kepler-build assets dist node_modules build generated", "test:snapshot": "jest --colors --updateSnapshot", "start": "node node_modules/react-native/local-cli/cli.js start", "test": "jest --colors", "lint": "eslint --fix src --ext .ts,.tsx && eslint --fix tst --ext .ts,.tsx", "compile": "tsc -p tsconfig-build.json", "build": "npm-run-all lint test compile checkLicenses generate-attribution", "checkLicenses": "license-checker --production --exclude MIT,Apache-2.0,BSD-2-Clause,BSD-3-Clause,ISC,0BSD", "generate-attribution": "generate-attribution -o ./.attr && mv .attr/attribution.txt THIRD_PARTY_NOTICES.txt && rm -rf .attr", "copy-system-conf": "cp kepler-system-conf.toml build/SystemBundles/@amazon-devices/kepler-epg-sync-scheduler/", "prepublishOnly": "npm-run-all check-dbg-syms build-system-bundle copy-system-conf", "check-dbg-syms": "$(brazil-path '[DebugSourceReferenceCheck]pkg.bin')/check_dbg_syms -b build -s kepler", "build-system-bundle": "KEPLER_NPM_COMMAND=npm-pretty-much react-native build-system-bundle-kepler"}, "dependencies": {"@amazon-devices/keplerscript-turbomodule-api": "^1.0.0"}, "peerDependencies": {}, "devDependencies": {"@react-native-community/eslint-config": "^3.0.1", "@types/jest": "*", "@types/react": "*", "@typescript-eslint/eslint-plugin": "^5.18.0", "@typescript-eslint/parser": "*", "metro-react-native-babel-preset": "*", "eslint": "*", "jest": "*", "npm-run-all": "*", "eslint-plugin-prettier": "*", "prettier": "*", "react-native": "*", "ts-jest": "*", "typescript": "*", "depcheck": "*", "oss-attribution-generator": ">=1.7.1", "@amazon-devices/kepler-cli-platform": "^0", "@react-native-community/cli": "^11.2.0"}, "kepler": {"projectType": "turbomodule", "targets": ["tv"], "features": ["vega"], "toolchain": "clang", "api": 0.1, "keplerInitializationSharedLibrary": "AmazonEpgSyncTaskSchedulerLib"}, "eslintConfig": {"extends": "@react-native-community", "parser": "@typescript-eslint/parser", "plugins": ["@typescript-eslint"], "root": true}, "prettier": {"arrowParens": "avoid", "bracketSameLine": true, "bracketSpacing": false, "singleQuote": true, "trailingComma": "all"}, "license": "See license in LICENSE"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
|
|
2
|
+
module.exports = {
|
|
3
|
+
dependency: {
|
|
4
|
+
platforms: {
|
|
5
|
+
kepler: {
|
|
6
|
+
autolink: {
|
|
7
|
+
"AmazonEpgSyncTaskSchedulerLib": {
|
|
8
|
+
"libraryName": "libkeplerscript-epg-sync-scheduler-lib-1.so",
|
|
9
|
+
"linkDynamic": true,
|
|
10
|
+
"provider": "system",
|
|
11
|
+
"components": [],
|
|
12
|
+
"turbomodules": [
|
|
13
|
+
"NativeEpgSyncTaskScheduler"
|
|
14
|
+
]
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
};
|