@terascope/job-components 0.75.1 → 1.0.1
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/src/builtin/collect/interfaces.d.ts +2 -2
- package/dist/src/builtin/collect/interfaces.d.ts.map +1 -1
- package/dist/src/builtin/collect/interfaces.js +1 -2
- package/dist/src/builtin/collect/processor.d.ts +4 -4
- package/dist/src/builtin/collect/processor.d.ts.map +1 -1
- package/dist/src/builtin/collect/processor.js +5 -7
- package/dist/src/builtin/collect/processor.js.map +1 -1
- package/dist/src/builtin/collect/schema.d.ts +2 -2
- package/dist/src/builtin/collect/schema.d.ts.map +1 -1
- package/dist/src/builtin/collect/schema.js +2 -5
- package/dist/src/builtin/collect/schema.js.map +1 -1
- package/dist/src/builtin/delay/interfaces.d.ts +1 -1
- package/dist/src/builtin/delay/interfaces.d.ts.map +1 -1
- package/dist/src/builtin/delay/interfaces.js +1 -2
- package/dist/src/builtin/delay/processor.d.ts +2 -2
- package/dist/src/builtin/delay/processor.d.ts.map +1 -1
- package/dist/src/builtin/delay/processor.js +4 -7
- package/dist/src/builtin/delay/processor.js.map +1 -1
- package/dist/src/builtin/delay/schema.d.ts +2 -2
- package/dist/src/builtin/delay/schema.d.ts.map +1 -1
- package/dist/src/builtin/delay/schema.js +2 -5
- package/dist/src/builtin/delay/schema.js.map +1 -1
- package/dist/src/builtin/index.d.ts +5 -5
- package/dist/src/builtin/index.d.ts.map +1 -1
- package/dist/src/builtin/index.js +6 -16
- package/dist/src/builtin/index.js.map +1 -1
- package/dist/src/builtin/noop/processor.d.ts +1 -1
- package/dist/src/builtin/noop/processor.d.ts.map +1 -1
- package/dist/src/builtin/noop/processor.js +2 -5
- package/dist/src/builtin/noop/processor.js.map +1 -1
- package/dist/src/builtin/noop/schema.d.ts +1 -1
- package/dist/src/builtin/noop/schema.d.ts.map +1 -1
- package/dist/src/builtin/noop/schema.js +2 -5
- package/dist/src/builtin/noop/schema.js.map +1 -1
- package/dist/src/builtin/test-reader/data/fetcher-data.d.ts +1 -1
- package/dist/src/builtin/test-reader/data/fetcher-data.d.ts.map +1 -1
- package/dist/src/builtin/test-reader/data/fetcher-data.js +1 -2
- package/dist/src/builtin/test-reader/data/fetcher-data.js.map +1 -1
- package/dist/src/builtin/test-reader/data/slicer-data.d.ts +1 -1
- package/dist/src/builtin/test-reader/data/slicer-data.d.ts.map +1 -1
- package/dist/src/builtin/test-reader/data/slicer-data.js +1 -2
- package/dist/src/builtin/test-reader/data/slicer-data.js.map +1 -1
- package/dist/src/builtin/test-reader/fetcher.d.ts +3 -3
- package/dist/src/builtin/test-reader/fetcher.d.ts.map +1 -1
- package/dist/src/builtin/test-reader/fetcher.js +12 -21
- package/dist/src/builtin/test-reader/fetcher.js.map +1 -1
- package/dist/src/builtin/test-reader/interfaces.d.ts +1 -1
- package/dist/src/builtin/test-reader/interfaces.d.ts.map +1 -1
- package/dist/src/builtin/test-reader/interfaces.js +1 -2
- package/dist/src/builtin/test-reader/schema.d.ts +2 -2
- package/dist/src/builtin/test-reader/schema.d.ts.map +1 -1
- package/dist/src/builtin/test-reader/schema.js +2 -5
- package/dist/src/builtin/test-reader/schema.js.map +1 -1
- package/dist/src/builtin/test-reader/slicer.d.ts +3 -3
- package/dist/src/builtin/test-reader/slicer.d.ts.map +1 -1
- package/dist/src/builtin/test-reader/slicer.js +10 -19
- package/dist/src/builtin/test-reader/slicer.js.map +1 -1
- package/dist/src/config-validators.d.ts +1 -1
- package/dist/src/config-validators.d.ts.map +1 -1
- package/dist/src/config-validators.js +10 -19
- package/dist/src/config-validators.js.map +1 -1
- package/dist/src/execution-context/api.d.ts +4 -5
- package/dist/src/execution-context/api.d.ts.map +1 -1
- package/dist/src/execution-context/api.js +16 -16
- package/dist/src/execution-context/api.js.map +1 -1
- package/dist/src/execution-context/base.d.ts +6 -6
- package/dist/src/execution-context/base.d.ts.map +1 -1
- package/dist/src/execution-context/base.js +30 -27
- package/dist/src/execution-context/base.js.map +1 -1
- package/dist/src/execution-context/index.d.ts +9 -12
- package/dist/src/execution-context/index.d.ts.map +1 -1
- package/dist/src/execution-context/index.js +16 -44
- package/dist/src/execution-context/index.js.map +1 -1
- package/dist/src/execution-context/interfaces.d.ts +2 -2
- package/dist/src/execution-context/interfaces.d.ts.map +1 -1
- package/dist/src/execution-context/interfaces.js +1 -2
- package/dist/src/execution-context/slicer.d.ts +5 -4
- package/dist/src/execution-context/slicer.d.ts.map +1 -1
- package/dist/src/execution-context/slicer.js +20 -20
- package/dist/src/execution-context/slicer.js.map +1 -1
- package/dist/src/execution-context/utils.d.ts +1 -1
- package/dist/src/execution-context/utils.d.ts.map +1 -1
- package/dist/src/execution-context/utils.js +5 -11
- package/dist/src/execution-context/utils.js.map +1 -1
- package/dist/src/execution-context/worker.d.ts +6 -5
- package/dist/src/execution-context/worker.d.ts.map +1 -1
- package/dist/src/execution-context/worker.js +50 -68
- package/dist/src/execution-context/worker.js.map +1 -1
- package/dist/src/formats.d.ts +2 -2
- package/dist/src/formats.d.ts.map +1 -1
- package/dist/src/formats.js +21 -27
- package/dist/src/formats.js.map +1 -1
- package/dist/src/index.d.ts +12 -12
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +13 -29
- package/dist/src/index.js.map +1 -1
- package/dist/src/interfaces/context.d.ts +23 -140
- package/dist/src/interfaces/context.d.ts.map +1 -1
- package/dist/src/interfaces/context.js +1 -2
- package/dist/src/interfaces/index.d.ts +4 -5
- package/dist/src/interfaces/index.d.ts.map +1 -1
- package/dist/src/interfaces/index.js +4 -21
- package/dist/src/interfaces/index.js.map +1 -1
- package/dist/src/interfaces/misc.d.ts +3 -0
- package/dist/src/interfaces/misc.d.ts.map +1 -1
- package/dist/src/interfaces/misc.js +2 -2
- package/dist/src/interfaces/misc.js.map +1 -1
- package/dist/src/interfaces/operation-lifecycle.d.ts +4 -3
- package/dist/src/interfaces/operation-lifecycle.d.ts.map +1 -1
- package/dist/src/interfaces/operation-lifecycle.js +1 -2
- package/dist/src/interfaces/operations.d.ts +11 -64
- package/dist/src/interfaces/operations.d.ts.map +1 -1
- package/dist/src/interfaces/operations.js +1 -4
- package/dist/src/interfaces/operations.js.map +1 -1
- package/dist/src/job-schemas.d.ts +1 -1
- package/dist/src/job-schemas.d.ts.map +1 -1
- package/dist/src/job-schemas.js +32 -39
- package/dist/src/job-schemas.js.map +1 -1
- package/dist/src/job-validator.d.ts +3 -2
- package/dist/src/job-validator.d.ts.map +1 -1
- package/dist/src/job-validator.js +19 -20
- package/dist/src/job-validator.js.map +1 -1
- package/dist/src/operation-loader/index.d.ts +2 -2
- package/dist/src/operation-loader/index.d.ts.map +1 -1
- package/dist/src/operation-loader/index.js +2 -18
- package/dist/src/operation-loader/index.js.map +1 -1
- package/dist/src/operation-loader/interfaces.d.ts +1 -1
- package/dist/src/operation-loader/interfaces.d.ts.map +1 -1
- package/dist/src/operation-loader/interfaces.js +15 -18
- package/dist/src/operation-loader/interfaces.js.map +1 -1
- package/dist/src/operation-loader/loader.d.ts +7 -9
- package/dist/src/operation-loader/loader.d.ts.map +1 -1
- package/dist/src/operation-loader/loader.js +96 -137
- package/dist/src/operation-loader/loader.js.map +1 -1
- package/dist/src/operations/api-factory.d.ts +2 -2
- package/dist/src/operations/api-factory.d.ts.map +1 -1
- package/dist/src/operations/api-factory.js +4 -13
- package/dist/src/operations/api-factory.js.map +1 -1
- package/dist/src/operations/batch-processor.d.ts +2 -2
- package/dist/src/operations/batch-processor.d.ts.map +1 -1
- package/dist/src/operations/batch-processor.js +5 -11
- package/dist/src/operations/batch-processor.js.map +1 -1
- package/dist/src/operations/convict-schema.d.ts +2 -2
- package/dist/src/operations/convict-schema.d.ts.map +1 -1
- package/dist/src/operations/convict-schema.js +11 -15
- package/dist/src/operations/convict-schema.js.map +1 -1
- package/dist/src/operations/core/api-core.d.ts +4 -4
- package/dist/src/operations/core/api-core.d.ts.map +1 -1
- package/dist/src/operations/core/api-core.js +7 -10
- package/dist/src/operations/core/api-core.js.map +1 -1
- package/dist/src/operations/core/core.d.ts +2 -2
- package/dist/src/operations/core/core.d.ts.map +1 -1
- package/dist/src/operations/core/core.js +5 -4
- package/dist/src/operations/core/core.js.map +1 -1
- package/dist/src/operations/core/fetcher-core.d.ts +2 -2
- package/dist/src/operations/core/fetcher-core.d.ts.map +1 -1
- package/dist/src/operations/core/fetcher-core.js +2 -8
- package/dist/src/operations/core/fetcher-core.js.map +1 -1
- package/dist/src/operations/core/index.d.ts +6 -6
- package/dist/src/operations/core/index.d.ts.map +1 -1
- package/dist/src/operations/core/index.js +7 -18
- package/dist/src/operations/core/index.js.map +1 -1
- package/dist/src/operations/core/operation-core.d.ts +5 -5
- package/dist/src/operations/core/operation-core.d.ts.map +1 -1
- package/dist/src/operations/core/operation-core.js +8 -11
- package/dist/src/operations/core/operation-core.js.map +1 -1
- package/dist/src/operations/core/processor-core.d.ts +2 -2
- package/dist/src/operations/core/processor-core.d.ts.map +1 -1
- package/dist/src/operations/core/processor-core.js +2 -8
- package/dist/src/operations/core/processor-core.js.map +1 -1
- package/dist/src/operations/core/schema-core.d.ts +1 -1
- package/dist/src/operations/core/schema-core.d.ts.map +1 -1
- package/dist/src/operations/core/schema-core.js +3 -4
- package/dist/src/operations/core/schema-core.js.map +1 -1
- package/dist/src/operations/core/slicer-core.d.ts +4 -4
- package/dist/src/operations/core/slicer-core.d.ts.map +1 -1
- package/dist/src/operations/core/slicer-core.js +13 -14
- package/dist/src/operations/core/slicer-core.js.map +1 -1
- package/dist/src/operations/each-processor.d.ts +2 -2
- package/dist/src/operations/each-processor.d.ts.map +1 -1
- package/dist/src/operations/each-processor.js +2 -8
- package/dist/src/operations/each-processor.js.map +1 -1
- package/dist/src/operations/fetcher.d.ts +2 -2
- package/dist/src/operations/fetcher.d.ts.map +1 -1
- package/dist/src/operations/fetcher.js +4 -10
- package/dist/src/operations/fetcher.js.map +1 -1
- package/dist/src/operations/filter-processor.d.ts +2 -2
- package/dist/src/operations/filter-processor.d.ts.map +1 -1
- package/dist/src/operations/filter-processor.js +2 -8
- package/dist/src/operations/filter-processor.js.map +1 -1
- package/dist/src/operations/index.d.ts +14 -15
- package/dist/src/operations/index.d.ts.map +1 -1
- package/dist/src/operations/index.js +15 -47
- package/dist/src/operations/index.js.map +1 -1
- package/dist/src/operations/interfaces.d.ts +12 -12
- package/dist/src/operations/interfaces.d.ts.map +1 -1
- package/dist/src/operations/interfaces.js +1 -2
- package/dist/src/operations/job-observer.d.ts +3 -3
- package/dist/src/operations/job-observer.d.ts.map +1 -1
- package/dist/src/operations/job-observer.js +14 -10
- package/dist/src/operations/job-observer.js.map +1 -1
- package/dist/src/operations/map-processor.d.ts +2 -2
- package/dist/src/operations/map-processor.d.ts.map +1 -1
- package/dist/src/operations/map-processor.js +4 -10
- package/dist/src/operations/map-processor.js.map +1 -1
- package/dist/src/operations/observer.d.ts +2 -2
- package/dist/src/operations/observer.d.ts.map +1 -1
- package/dist/src/operations/observer.js +2 -8
- package/dist/src/operations/observer.js.map +1 -1
- package/dist/src/operations/operation-api.d.ts +2 -2
- package/dist/src/operations/operation-api.d.ts.map +1 -1
- package/dist/src/operations/operation-api.js +2 -8
- package/dist/src/operations/operation-api.js.map +1 -1
- package/dist/src/operations/parallel-slicer.d.ts +2 -2
- package/dist/src/operations/parallel-slicer.d.ts.map +1 -1
- package/dist/src/operations/parallel-slicer.js +7 -16
- package/dist/src/operations/parallel-slicer.js.map +1 -1
- package/dist/src/operations/slicer.d.ts +2 -2
- package/dist/src/operations/slicer.d.ts.map +1 -1
- package/dist/src/operations/slicer.js +7 -16
- package/dist/src/operations/slicer.js.map +1 -1
- package/dist/src/register-apis.d.ts +2 -3
- package/dist/src/register-apis.d.ts.map +1 -1
- package/dist/src/register-apis.js +17 -49
- package/dist/src/register-apis.js.map +1 -1
- package/dist/src/test-helpers.d.ts +11 -31
- package/dist/src/test-helpers.d.ts.map +1 -1
- package/dist/src/test-helpers.js +67 -150
- package/dist/src/test-helpers.js.map +1 -1
- package/dist/src/utils.d.ts +1 -1
- package/dist/src/utils.d.ts.map +1 -1
- package/dist/src/utils.js +9 -14
- package/dist/src/utils.js.map +1 -1
- package/package.json +10 -7
- package/dist/src/interfaces/jobs.d.ts +0 -171
- package/dist/src/interfaces/jobs.d.ts.map +0 -1
- package/dist/src/interfaces/jobs.js +0 -10
- package/dist/src/interfaces/jobs.js.map +0 -1
- package/dist/src/operations/shims/index.d.ts +0 -9
- package/dist/src/operations/shims/index.d.ts.map +0 -1
- package/dist/src/operations/shims/index.js +0 -21
- package/dist/src/operations/shims/index.js.map +0 -1
- package/dist/src/operations/shims/legacy-processor-shim.d.ts +0 -5
- package/dist/src/operations/shims/legacy-processor-shim.d.ts.map +0 -1
- package/dist/src/operations/shims/legacy-processor-shim.js +0 -50
- package/dist/src/operations/shims/legacy-processor-shim.js.map +0 -1
- package/dist/src/operations/shims/legacy-reader-shim.d.ts +0 -7
- package/dist/src/operations/shims/legacy-reader-shim.d.ts.map +0 -1
- package/dist/src/operations/shims/legacy-reader-shim.js +0 -66
- package/dist/src/operations/shims/legacy-reader-shim.js.map +0 -1
- package/dist/src/operations/shims/legacy-slice-events-shim.d.ts +0 -10
- package/dist/src/operations/shims/legacy-slice-events-shim.d.ts.map +0 -1
- package/dist/src/operations/shims/legacy-slice-events-shim.js +0 -34
- package/dist/src/operations/shims/legacy-slice-events-shim.js.map +0 -1
- package/dist/src/operations/shims/operation-api-shim.d.ts +0 -7
- package/dist/src/operations/shims/operation-api-shim.d.ts.map +0 -1
- package/dist/src/operations/shims/operation-api-shim.js +0 -10
- package/dist/src/operations/shims/operation-api-shim.js.map +0 -1
- package/dist/src/operations/shims/processor-shim.d.ts +0 -4
- package/dist/src/operations/shims/processor-shim.d.ts.map +0 -1
- package/dist/src/operations/shims/processor-shim.js +0 -51
- package/dist/src/operations/shims/processor-shim.js.map +0 -1
- package/dist/src/operations/shims/reader-shim.d.ts +0 -4
- package/dist/src/operations/shims/reader-shim.d.ts.map +0 -1
- package/dist/src/operations/shims/reader-shim.js +0 -92
- package/dist/src/operations/shims/reader-shim.js.map +0 -1
- package/dist/src/operations/shims/schema-shim.d.ts +0 -4
- package/dist/src/operations/shims/schema-shim.d.ts.map +0 -1
- package/dist/src/operations/shims/schema-shim.js +0 -31
- package/dist/src/operations/shims/schema-shim.js.map +0 -1
- package/dist/src/operations/shims/shim-utils.d.ts +0 -9
- package/dist/src/operations/shims/shim-utils.d.ts.map +0 -1
- package/dist/src/operations/shims/shim-utils.js +0 -34
- package/dist/src/operations/shims/shim-utils.js.map +0 -1
package/dist/src/formats.js
CHANGED
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
|
|
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.addFormats = exports.formats = void 0;
|
|
7
|
-
const convict_1 = require("convict");
|
|
1
|
+
import pkg from 'convict';
|
|
8
2
|
// @ts-expect-error no types
|
|
9
|
-
|
|
3
|
+
import convict_format_with_validator from 'convict-format-with-validator';
|
|
10
4
|
// @ts-expect-error no types
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
(
|
|
16
|
-
|
|
5
|
+
import convict_format_with_moment from 'convict-format-with-moment';
|
|
6
|
+
import dateMath from 'datemath-parser';
|
|
7
|
+
import { startsWith, isValidDate, isString, isInteger, toInteger, } from '@terascope/utils';
|
|
8
|
+
const { addFormat, addFormats: nativeAddFormats } = pkg;
|
|
9
|
+
nativeAddFormats(convict_format_with_validator);
|
|
10
|
+
nativeAddFormats(convict_format_with_moment);
|
|
11
|
+
export const formats = [
|
|
17
12
|
{
|
|
18
13
|
name: 'required_String',
|
|
19
14
|
validate(val) {
|
|
20
|
-
if (!val || !
|
|
15
|
+
if (!val || !isString(val)) {
|
|
21
16
|
throw new Error('This field is required and must by of type string');
|
|
22
17
|
}
|
|
23
18
|
},
|
|
@@ -31,7 +26,7 @@ exports.formats = [
|
|
|
31
26
|
if (!val) {
|
|
32
27
|
return;
|
|
33
28
|
}
|
|
34
|
-
if (
|
|
29
|
+
if (isString(val)) {
|
|
35
30
|
return;
|
|
36
31
|
}
|
|
37
32
|
throw new Error('This field is optional but if specified it must be of type string');
|
|
@@ -46,12 +41,12 @@ exports.formats = [
|
|
|
46
41
|
if (!val) {
|
|
47
42
|
return;
|
|
48
43
|
}
|
|
49
|
-
if (
|
|
50
|
-
if (
|
|
44
|
+
if (isString(val) || isInteger(val)) {
|
|
45
|
+
if (isValidDate(val)) {
|
|
51
46
|
return;
|
|
52
47
|
}
|
|
53
48
|
try {
|
|
54
|
-
|
|
49
|
+
dateMath.parse(val);
|
|
55
50
|
}
|
|
56
51
|
catch (err) {
|
|
57
52
|
throw new Error(`value: "${val}" cannot be coerced into a proper date
|
|
@@ -75,9 +70,9 @@ exports.formats = [
|
|
|
75
70
|
if (val.length > 255) {
|
|
76
71
|
throw new Error(`value: ${val} should not exceed 255 characters`);
|
|
77
72
|
}
|
|
78
|
-
if (
|
|
79
|
-
||
|
|
80
|
-
||
|
|
73
|
+
if (startsWith(val, '_')
|
|
74
|
+
|| startsWith(val, '-')
|
|
75
|
+
|| startsWith(val, '+')) {
|
|
81
76
|
throw new Error(`value: ${val} should not start with _, -, or +`);
|
|
82
77
|
}
|
|
83
78
|
if (val === '.' || val === '..') {
|
|
@@ -100,19 +95,18 @@ exports.formats = [
|
|
|
100
95
|
{
|
|
101
96
|
name: 'positive_int',
|
|
102
97
|
validate(val) {
|
|
103
|
-
const int =
|
|
98
|
+
const int = toInteger(val);
|
|
104
99
|
if (int === false || int < 1) {
|
|
105
100
|
throw new Error('must be valid integer greater than zero');
|
|
106
101
|
}
|
|
107
102
|
},
|
|
108
103
|
coerce(val) {
|
|
109
|
-
return
|
|
104
|
+
return toInteger(val) || 0;
|
|
110
105
|
},
|
|
111
106
|
},
|
|
112
107
|
];
|
|
113
|
-
function addFormats() {
|
|
114
|
-
|
|
108
|
+
export function addFormats() {
|
|
109
|
+
formats.forEach(addFormat);
|
|
115
110
|
}
|
|
116
|
-
exports.addFormats = addFormats;
|
|
117
111
|
addFormats();
|
|
118
112
|
//# sourceMappingURL=formats.js.map
|
package/dist/src/formats.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"formats.js","sourceRoot":"","sources":["../../src/formats.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"formats.js","sourceRoot":"","sources":["../../src/formats.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,SAAS,CAAC;AAC1B,4BAA4B;AAC5B,OAAO,6BAA6B,MAAM,+BAA+B,CAAC;AAC1E,4BAA4B;AAC5B,OAAO,0BAA0B,MAAM,4BAA4B,CAAC;AACpE,OAAO,QAAQ,MAAM,iBAAiB,CAAC;AACvC,OAAO,EACH,UAAU,EACV,WAAW,EACX,QAAQ,EACR,SAAS,EACT,SAAS,GACZ,MAAM,kBAAkB,CAAC;AAE1B,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,gBAAgB,EAAE,GAAG,GAAG,CAAC;AAExD,gBAAgB,CAAC,6BAA6B,CAAC,CAAC;AAChD,gBAAgB,CAAC,0BAA0B,CAAC,CAAC;AAE7C,MAAM,CAAC,MAAM,OAAO,GAAiB;IACjC;QACI,IAAI,EAAE,iBAAiB;QACvB,QAAQ,CAAC,GAAY;YACjB,IAAI,CAAC,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE;gBACxB,MAAM,IAAI,KAAK,CAAC,mDAAmD,CAAC,CAAC;aACxE;QACL,CAAC;QACD,MAAM,CAAC,GAAQ;YACX,OAAO,GAAG,CAAC;QACf,CAAC;KACJ;IACD;QACI,IAAI,EAAE,iBAAiB;QACvB,QAAQ,CAAC,GAAY;YACjB,IAAI,CAAC,GAAG,EAAE;gBAAE,OAAO;aAAE;YACrB,IAAI,QAAQ,CAAC,GAAG,CAAC,EA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AAK,GAAG,IAAI,GAAG,KAAK,IAAI,EAAE;gBAC7B,MAAM,IAAI,KAAK,CAAC,UAAU,GAAG,2BAA2B,CAAC,CAAC;aAC7D;YAED,+DAA+D;YAC/D,MAAM,OAAO,GAAG,gBAAgB,CAAC;YACjC,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBACnB,MAAM,IAAI,KAAK,CAAC,UAAU,GAAG,wDAAwD,CAAC,CAAC;aAC1F;YAED,MAAM,OAAO,GAAG,OAAO,CAAC;YACxB,IAAI,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;gBACnB,MAAM,IAAI,KAAK,CAAC,UAAU,GAAG,uBAAuB,CAAC,CAAC;aACzD;QACL,CAAC;QACD,MAAM,CAAC,GAAG;YACN,OAAO,GAAG,CAAC;QACf,CAAC;KACJ;IACD;QACI,IAAI,EAAE,cAAc;QACpB,QAAQ,CAAC,GAAY;YACjB,MAAM,GAAG,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;YAC3B,IAAI,GAAG,KAAK,KAAK,IAAI,GAAG,GAAG,CAAC,EAAE;gBAC1B,MAAM,IAAI,KAAK,CAAC,yCAAyC,CAAC,CAAC;aAC9D;QACL,CAAC;QACD,MAAM,CAAC,GAAQ;YACX,OAAO,SAAS,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;QAC/B,CAAC;KACJ;CACJ,CAAC;AAEF,MAAM,UAAU,UAAU;IACtB,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;AAC/B,CAAC;AAED,UAAU,EAAE,CAAC"}
|
package/dist/src/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export * from '@terascope/utils';
|
|
2
|
-
export * from './utils';
|
|
3
|
-
export * from './builtin';
|
|
4
|
-
export * from './config-validators';
|
|
5
|
-
export * from './execution-context';
|
|
6
|
-
export * from './formats';
|
|
7
|
-
export * from './operation-loader';
|
|
8
|
-
export * from './operations';
|
|
9
|
-
export * from './job-validator';
|
|
10
|
-
export * from './job-schemas';
|
|
11
|
-
export * from './interfaces';
|
|
12
|
-
export * from './register-apis';
|
|
13
|
-
export * from './test-helpers';
|
|
2
|
+
export * from './utils.js';
|
|
3
|
+
export * from './builtin/index.js';
|
|
4
|
+
export * from './config-validators.js';
|
|
5
|
+
export * from './execution-context/index.js';
|
|
6
|
+
export * from './formats.js';
|
|
7
|
+
export * from './operation-loader/index.js';
|
|
8
|
+
export * from './operations/index.js';
|
|
9
|
+
export * from './job-validator.js';
|
|
10
|
+
export * from './job-schemas.js';
|
|
11
|
+
export * from './interfaces/index.js';
|
|
12
|
+
export * from './register-apis.js';
|
|
13
|
+
export * from './test-helpers.js';
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/src/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
|
package/dist/src/index.js
CHANGED
|
@@ -1,30 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("@terascope/utils"), exports);
|
|
18
|
-
__exportStar(require("./utils"), exports);
|
|
19
|
-
__exportStar(require("./builtin"), exports);
|
|
20
|
-
__exportStar(require("./config-validators"), exports);
|
|
21
|
-
__exportStar(require("./execution-context"), exports);
|
|
22
|
-
__exportStar(require("./formats"), exports);
|
|
23
|
-
__exportStar(require("./operation-loader"), exports);
|
|
24
|
-
__exportStar(require("./operations"), exports);
|
|
25
|
-
__exportStar(require("./job-validator"), exports);
|
|
26
|
-
__exportStar(require("./job-schemas"), exports);
|
|
27
|
-
__exportStar(require("./interfaces"), exports);
|
|
28
|
-
__exportStar(require("./register-apis"), exports);
|
|
29
|
-
__exportStar(require("./test-helpers"), exports);
|
|
1
|
+
export * from '@terascope/utils';
|
|
2
|
+
export * from './utils.js';
|
|
3
|
+
export * from './builtin/index.js';
|
|
4
|
+
export * from './config-validators.js';
|
|
5
|
+
export * from './execution-context/index.js';
|
|
6
|
+
export * from './formats.js';
|
|
7
|
+
export * from './operation-loader/index.js';
|
|
8
|
+
export * from './operations/index.js';
|
|
9
|
+
export * from './job-validator.js';
|
|
10
|
+
export * from './job-schemas.js';
|
|
11
|
+
export * from './interfaces/index.js';
|
|
12
|
+
export * from './register-apis.js';
|
|
13
|
+
export * from './test-helpers.js';
|
|
30
14
|
//# sourceMappingURL=index.js.map
|
package/dist/src/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,oBAAoB,CAAC;AACnC,cAAc,wBAAwB,CAAC;AACvC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,cAAc,CAAC;AAC7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC;AACnC,cAAc,mBAAmB,CAAC"}
|
|
@@ -1,143 +1,26 @@
|
|
|
1
|
-
|
|
2
|
-
import { EventEmitter } from 'events';
|
|
3
|
-
import { Logger } from '@terascope/utils';
|
|
4
|
-
import { Terafoundation as tf } from '@terascope/types';
|
|
5
|
-
import { OpConfig } from './jobs';
|
|
1
|
+
import type { Teraslice, Terafoundation } from '@terascope/types';
|
|
6
2
|
import { ExecutionContextAPI } from '../execution-context';
|
|
7
|
-
export interface ClusterStateConfig {
|
|
8
|
-
connection: string | 'default';
|
|
9
|
-
}
|
|
10
|
-
export type RolloverFrequency = 'daily' | 'montly' | 'yearly';
|
|
11
|
-
export interface IndexRolloverFrequency {
|
|
12
|
-
state: RolloverFrequency;
|
|
13
|
-
analytics: RolloverFrequency;
|
|
14
|
-
}
|
|
15
|
-
export type ClusterManagerType = 'native' | 'kubernetes';
|
|
16
|
-
export interface TerasliceConfig {
|
|
17
|
-
action_timeout: number | 300000;
|
|
18
|
-
analytics_rate: number | 60000;
|
|
19
|
-
api_response_timeout?: number | 300000;
|
|
20
|
-
assets_directory?: string[] | string;
|
|
21
|
-
asset_storage_connection_type?: string;
|
|
22
|
-
asset_storage_connection?: string;
|
|
23
|
-
asset_storage_bucket?: string;
|
|
24
|
-
assets_volume?: string;
|
|
25
|
-
cluster_manager_type: ClusterManagerType;
|
|
26
|
-
/** This will only be available in the context of k8s */
|
|
27
|
-
cpu?: number;
|
|
28
|
-
/** This will only be available in the context of k8s */
|
|
29
|
-
cpu_execution_controller?: number | 0.5;
|
|
30
|
-
/** This will only be available in the context of k8s */
|
|
31
|
-
ephemeral_storage?: boolean | false;
|
|
32
|
-
execution_controller_targets?: ExecutionControllerTargets[];
|
|
33
|
-
hostname: string;
|
|
34
|
-
index_rollover_frequency: IndexRolloverFrequency;
|
|
35
|
-
kubernetes_api_poll_delay?: number | 1000;
|
|
36
|
-
kubernetes_config_map_name?: string | 'teraslice-worker';
|
|
37
|
-
kubernetes_image_pull_secret?: string | '';
|
|
38
|
-
kubernetes_image?: string | 'terascope/teraslice';
|
|
39
|
-
kubernetes_namespace?: string | 'default';
|
|
40
|
-
kubernetes_overrides_enabled?: boolean | false;
|
|
41
|
-
kubernetes_priority_class_name?: string | '';
|
|
42
|
-
kubernetes_worker_antiaffinity?: boolean | false;
|
|
43
|
-
master_hostname: string | 'localhost';
|
|
44
|
-
master: boolean | false;
|
|
45
|
-
/** This will only be available in the context of k8s */
|
|
46
|
-
memory?: number;
|
|
47
|
-
/** This will only be available in the context of k8s */
|
|
48
|
-
memory_execution_controller?: number | 512000000;
|
|
49
|
-
name: string | 'teracluster';
|
|
50
|
-
network_latency_buffer: number | 15000;
|
|
51
|
-
node_disconnect_timeout: number | 300000;
|
|
52
|
-
node_state_interval: number | 5000;
|
|
53
|
-
port: number | 5678;
|
|
54
|
-
shutdown_timeout: number | number;
|
|
55
|
-
slicer_allocation_attempts: number | 3;
|
|
56
|
-
slicer_port_range: string | '45679:46678';
|
|
57
|
-
slicer_timeout: number | 180000;
|
|
58
|
-
state: ClusterStateConfig;
|
|
59
|
-
env_vars: {
|
|
60
|
-
[key: string]: string;
|
|
61
|
-
};
|
|
62
|
-
worker_disconnect_timeout: number | 300000;
|
|
63
|
-
workers: number | 4;
|
|
64
|
-
}
|
|
65
|
-
export interface TerafoundationConfig {
|
|
66
|
-
connectors: Record<string, any>;
|
|
67
|
-
asset_storage_connection_type?: string;
|
|
68
|
-
asset_storage_connection?: string;
|
|
69
|
-
asset_storage_bucket?: string;
|
|
70
|
-
prom_metrics_enabled: boolean;
|
|
71
|
-
prom_metrics_port: number;
|
|
72
|
-
prom_metrics_add_default: boolean;
|
|
73
|
-
}
|
|
74
|
-
export interface SysConfig {
|
|
75
|
-
terafoundation: TerafoundationConfig;
|
|
76
|
-
teraslice: TerasliceConfig;
|
|
77
|
-
_nodeName: string;
|
|
78
|
-
}
|
|
79
|
-
export interface ConnectionConfig {
|
|
80
|
-
endpoint: string;
|
|
81
|
-
cached?: boolean;
|
|
82
|
-
type: string;
|
|
83
|
-
}
|
|
84
|
-
export type ClientFactoryFn = (config: Record<string, any>, logger: Logger, options: ConnectionConfig) => {
|
|
85
|
-
client: any;
|
|
86
|
-
};
|
|
87
|
-
export type CreateClientFactoryFn = (config: Record<string, any>, logger: Logger, options: ConnectionConfig) => Promise<{
|
|
88
|
-
client: any;
|
|
89
|
-
}>;
|
|
90
|
-
export interface ExecutionControllerTargets {
|
|
91
|
-
key: string;
|
|
92
|
-
value: string;
|
|
93
|
-
}
|
|
94
|
-
export interface FoundationApis {
|
|
95
|
-
makeLogger(...params: any[]): Logger;
|
|
96
|
-
getSystemEvents(): EventEmitter;
|
|
97
|
-
getConnection(config: ConnectionConfig): {
|
|
98
|
-
client: any;
|
|
99
|
-
};
|
|
100
|
-
createClient(config: ConnectionConfig): Promise<{
|
|
101
|
-
client: any;
|
|
102
|
-
}>;
|
|
103
|
-
promMetrics: tf.PromMetrics;
|
|
104
|
-
}
|
|
105
|
-
export interface LegacyFoundationApis {
|
|
106
|
-
makeLogger(...params: any[]): Logger;
|
|
107
|
-
getEventEmitter(): EventEmitter;
|
|
108
|
-
getConnection(config: ConnectionConfig): {
|
|
109
|
-
client: any;
|
|
110
|
-
};
|
|
111
|
-
}
|
|
112
|
-
export interface ContextApis {
|
|
113
|
-
readonly foundation: FoundationApis;
|
|
114
|
-
registerAPI(namespace: string, apis: any): void;
|
|
115
|
-
[namespace: string]: any;
|
|
116
|
-
}
|
|
117
|
-
export interface ContextAPIs extends ContextApis {
|
|
118
|
-
}
|
|
119
3
|
export interface GetClientConfig {
|
|
120
4
|
connection?: string;
|
|
121
5
|
endpoint?: string;
|
|
122
6
|
connection_cache?: boolean;
|
|
123
7
|
}
|
|
124
8
|
export interface OpRunnerAPI {
|
|
125
|
-
getClient(config: GetClientConfig, type: string): any
|
|
126
|
-
getClientAsync(config: GetClientConfig, type: string): Promise<any>;
|
|
9
|
+
getClient(config: GetClientConfig, type: string): Promise<any>;
|
|
127
10
|
}
|
|
128
11
|
export interface JobRunnerAPI {
|
|
129
12
|
/** Get the first opConfig from an operation name */
|
|
130
|
-
getOpConfig(name: string): OpConfig | undefined;
|
|
13
|
+
getOpConfig(name: string): Teraslice.OpConfig | undefined;
|
|
131
14
|
}
|
|
132
15
|
export interface AssetsAPI {
|
|
133
16
|
getPath(name: string): Promise<string>;
|
|
134
17
|
}
|
|
135
18
|
/**
|
|
136
|
-
*
|
|
19
|
+
* Context includes the type definitions for
|
|
137
20
|
* the APIs available to Worker or Slicer.
|
|
138
21
|
* This extends the Terafoundation Context.
|
|
139
22
|
*/
|
|
140
|
-
export interface
|
|
23
|
+
export interface ExecutionContextAPIs {
|
|
141
24
|
/**
|
|
142
25
|
* Includes an API for getting a client from Terafoundation
|
|
143
26
|
*/
|
|
@@ -155,25 +38,25 @@ export interface WorkerContextAPIs extends ContextAPIs {
|
|
|
155
38
|
*/
|
|
156
39
|
executionContext: ExecutionContextAPI;
|
|
157
40
|
}
|
|
158
|
-
export interface
|
|
159
|
-
|
|
160
|
-
|
|
41
|
+
export interface Context extends Terafoundation.Context<Teraslice.SysConfig, ExecutionContextAPIs> {
|
|
42
|
+
assignment: Teraslice.Assignment;
|
|
43
|
+
}
|
|
44
|
+
export interface TestClientConfig {
|
|
45
|
+
type: string;
|
|
46
|
+
createClient?: Terafoundation.CreateClientFactoryFn;
|
|
47
|
+
config?: Record<string, any>;
|
|
48
|
+
endpoint?: string;
|
|
49
|
+
}
|
|
50
|
+
export interface TestContextApis extends ExecutionContextAPIs {
|
|
51
|
+
setTestClients(clients: TestClientConfig[]): void;
|
|
52
|
+
getTestClients(): TestClients;
|
|
53
|
+
}
|
|
54
|
+
export interface TestClients {
|
|
55
|
+
[type: string]: TestClientsByEndpoint;
|
|
161
56
|
}
|
|
162
|
-
export interface
|
|
163
|
-
|
|
164
|
-
arch: string;
|
|
165
|
-
assignment: Assignment;
|
|
166
|
-
foundation: LegacyFoundationApis;
|
|
167
|
-
logger: Logger;
|
|
168
|
-
name: string;
|
|
169
|
-
platform: string;
|
|
170
|
-
sysconfig: SysConfig;
|
|
171
|
-
cluster: ContextClusterConfig;
|
|
57
|
+
export interface TestClientsByEndpoint {
|
|
58
|
+
[endpoint: string]: any;
|
|
172
59
|
}
|
|
173
|
-
export interface
|
|
174
|
-
worker: {
|
|
175
|
-
id: string;
|
|
176
|
-
};
|
|
60
|
+
export interface TestContextType extends Terafoundation.Context<Teraslice.SysConfig, TestContextApis> {
|
|
177
61
|
}
|
|
178
|
-
export type Assignment = 'assets_service' | 'cluster_master' | 'node_master' | 'execution_controller' | 'worker';
|
|
179
62
|
//# sourceMappingURL=context.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/interfaces/context.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"context.d.ts","sourceRoot":"","sources":["../../../src/interfaces/context.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE3D,MAAM,WAAW,eAAe;IAC5B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,gBAAgB,CAAC,EAAE,OAAO,CAAC;CAC9B;AAQD,MAAM,WAAW,WAAW;IACxB,SAAS,CAAC,MAAM,EAAE,eAAe,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC;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 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
3
|
-
export * from './
|
|
4
|
-
export * from './
|
|
5
|
-
export * from './misc';
|
|
1
|
+
export * from './operation-lifecycle.js';
|
|
2
|
+
export * from './operations.js';
|
|
3
|
+
export * from './misc.js';
|
|
4
|
+
export * from './context.js';
|
|
6
5
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
|
@@ -1,22 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
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
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./context"), exports);
|
|
18
|
-
__exportStar(require("./jobs"), exports);
|
|
19
|
-
__exportStar(require("./operation-lifecycle"), exports);
|
|
20
|
-
__exportStar(require("./operations"), exports);
|
|
21
|
-
__exportStar(require("./misc"), exports);
|
|
1
|
+
export * from './operation-lifecycle.js';
|
|
2
|
+
export * from './operations.js';
|
|
3
|
+
export * from './misc.js';
|
|
4
|
+
export * from './context.js';
|
|
22
5
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/interfaces/index.ts"],"names":[],"mappings":"AAAA,cAAc,0BAA0B,CAAC;AACzC,cAAc,iBAAiB,CAAC;AAChC,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC"}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
export type { OpConfig, ExecutionConfig, JobConfig, SliceRequest, APIConfig, Slice, SliceAnalyticsData, ValidatedJobConfig, JobConfigParams, SysConfig, DeadLetterAction, DeadLetterAPIFn, Assignment, LifeCycle, Config as TerasliceConfig, ClusterManagerType } from '@terascope/types';
|
|
2
|
+
export { RecoveryCleanupType } from '@terascope/types';
|
|
3
|
+
export type { CreateClientFactoryFn, ConnectionConfig, TerafoundationConfig } from '@terascope/types/dist/src/terafoundation.js';
|
|
1
4
|
export interface APIFactoryRegistry<T, C> {
|
|
2
5
|
get(name: string): T | undefined;
|
|
3
6
|
getConfig(name: string): C | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc.d.ts","sourceRoot":"","sources":["../../../src/interfaces/misc.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB,CAAC,CAAC,EAAE,CAAC;IACpC,GAAG,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,GAAC,SAAS,CAAC;IAC/B,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,CAAC,GAAC,SAAS,CAAC;IACrC,MAAM,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;IAC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B,CAAC,CAAC,CAAC,CAAC;IAC9B,IAAI,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACjC,IAAI,EAAE,MAAM,CAAC;CAChB"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
// this is an enum, cant export as type
|
|
2
|
+
export { RecoveryCleanupType } from '@terascope/types';
|
|
3
3
|
//# sourceMappingURL=misc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"misc.js","sourceRoot":"","sources":["../../../src/interfaces/misc.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"misc.js","sourceRoot":"","sources":["../../../src/interfaces/misc.ts"],"names":[],"mappings":"AAQA,uCAAuC;AACvC,OAAO,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { DataEntity } from '@terascope/utils';
|
|
2
|
-
import {
|
|
2
|
+
import { Teraslice } from '@terascope/types';
|
|
3
|
+
import { SlicerRecoveryData, SliceResult, ExecutionStats } from './operations.js';
|
|
3
4
|
export interface OperationLifeCycle {
|
|
4
5
|
/**
|
|
5
6
|
* Called during execution initialization,
|
|
@@ -82,12 +83,12 @@ export interface SlicerOperationLifeCycle extends OperationLifeCycle {
|
|
|
82
83
|
* A method called by the "Execution Controller" to give a "Slicer"
|
|
83
84
|
* the opportunity to track the slices enqueued by the execution controller
|
|
84
85
|
*/
|
|
85
|
-
onSliceEnqueued?(slice: Slice): void;
|
|
86
|
+
onSliceEnqueued?(slice: Teraslice.Slice): void;
|
|
86
87
|
/**
|
|
87
88
|
* A method called by the "Execution Controller" to give a "Slicer"
|
|
88
89
|
* the opportunity to track the slices disptached by the execution controller
|
|
89
90
|
*/
|
|
90
|
-
onSliceDispatch?(slice: Slice): void;
|
|
91
|
+
onSliceDispatch?(slice: Teraslice.Slice): void;
|
|
91
92
|
/**
|
|
92
93
|
* A method called by the "Execution Controller" to give a "Slicer"
|
|
93
94
|
* the opportunity to track the slices completed by the execution controller
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-lifecycle.d.ts","sourceRoot":"","sources":["../../../src/interfaces/operation-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,
|
|
1
|
+
{"version":3,"file":"operation-lifecycle.d.ts","sourceRoot":"","sources":["../../../src/interfaces/operation-lifecycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EACH,kBAAkB,EAAE,WAAW,EAAE,cAAc,EAClD,MAAM,iBAAiB,CAAC;AAEzB,MAAM,WAAW,kBAAkB;IAC/B;;;OAGG;IACH,UAAU,CAAC,UAAU,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE5C;;;OAGG;IACH,QAAQ,IAAI,OAAO,CAAC,IAAI,CAAC,CAAC;CAC7B;AAED,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAChE;;;OAGG;IACH,kBAAkB,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEpD;;OAEG;IACH,cAAc,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEhD;;OAEG;IACH,iBAAiB,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEnD;;OAEG;IACH,eAAe,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAEjD;;OAEG;IACH,aAAa,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/C;;;;;OAKG;IACH,YAAY,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9C;;;;;;OAMG;IACH,gBAAgB,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IAExD;;;;;;;OAOG;IACH,mBAAmB,CAAC,CAChB,OAAO,EAAE,MAAM,EACf,KAAK,EAAE,MAAM,EACb,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,UAAU,EAAE,GACtB,IAAI,CAAC;IAER;;;;OAIG;IACH,YAAY,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE9C;;;OAGG;IACH,UAAU,CAAC,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/C;AAED,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAChE;;;;;OAKG;IACH,UAAU,CAAC,YAAY,CAAC,EAAE,kBAAkB,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;IAE/D;;;OAGG;IACH,eAAe,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;IAE/C;;;OAGG;IACH,eAAe,CAAC,CAAC,KAAK,EAAE,SAAS,CAAC,KAAK,GAAG,IAAI,CAAC;IAE/C;;;OAGG;IACH,eAAe,CAAC,CAAC,MAAM,EAAE,WAAW,GAAG,IAAI,CAAC;IAE5C;;;OAGG;IACH,gBAAgB,CAAC,CAAC,KAAK,EAAE,cAAc,GAAG,IAAI,CAAC;CAClD"}
|
|
@@ -1,74 +1,21 @@
|
|
|
1
|
-
import { Schema } from 'convict';
|
|
2
1
|
import { Logger } from '@terascope/utils';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
export type
|
|
6
|
-
export type
|
|
7
|
-
export type
|
|
8
|
-
export interface LegacyOperation {
|
|
9
|
-
crossValidation?: CrossValidationFn;
|
|
10
|
-
selfValidation?: SelfValidationFn;
|
|
11
|
-
schema(context?: Context): Schema<any>;
|
|
12
|
-
}
|
|
13
|
-
export interface LegacyReader extends LegacyOperation {
|
|
14
|
-
slicerQueueLength?: SliceQueueLengthFn;
|
|
15
|
-
schema(context?: Context): Schema<any>;
|
|
16
|
-
newReader(context: Context, opConfig: OpConfig, exectutionConfig: ExecutionConfig): Promise<ReaderFn<any>>;
|
|
17
|
-
newSlicer(context: Context, executionContext: LegacyExecutionContext, recoveryData: SlicerRecoveryData[], logger: Logger): Promise<SlicerFns>;
|
|
18
|
-
}
|
|
19
|
-
export type ReaderFn<T> = (sliceRequest: SliceRequest, logger: Logger) => Promise<T> | T;
|
|
20
|
-
export interface LegacyProcessor extends LegacyOperation {
|
|
21
|
-
schema(context?: Context): Schema<any>;
|
|
22
|
-
newProcessor(context: Context, opConfig: OpConfig, executionConfig: ExecutionConfig): Promise<ProcessorFn<any>>;
|
|
23
|
-
}
|
|
24
|
-
export type ProcessorFn<T> = (data: T, logger: Logger, sliceRequest: SliceRequest) => Promise<T> | T;
|
|
25
|
-
/**
|
|
26
|
-
* The metadata created by the Slicer and ran through a job pipeline
|
|
27
|
-
*
|
|
28
|
-
* See [[Slice]]
|
|
29
|
-
*/
|
|
30
|
-
export interface SliceRequest {
|
|
31
|
-
/** A reserved key for sending work to a particular worker */
|
|
32
|
-
request_worker?: string;
|
|
33
|
-
/** The slice request can contain any metdata */
|
|
34
|
-
[prop: string]: any;
|
|
35
|
-
}
|
|
2
|
+
import { Teraslice } from '@terascope/types';
|
|
3
|
+
export type CrossValidationFn = (job: Teraslice.ValidatedJobConfig, sysconfig: Teraslice.SysConfig) => void;
|
|
4
|
+
export type SelfValidationFn = (config: Teraslice.OpConfig) => void;
|
|
5
|
+
export type ReaderFn<T> = (sliceRequest: Teraslice.SliceRequest, logger: Logger) => Promise<T> | T;
|
|
6
|
+
export type ProcessorFn<T> = (data: T, logger: Logger, sliceRequest: Teraslice.SliceRequest) => Promise<T> | T;
|
|
36
7
|
/**
|
|
37
|
-
* The metadata given to Slicer after
|
|
8
|
+
* The metadata given to Slicer after successfully recovering the execution
|
|
38
9
|
*/
|
|
39
10
|
export interface SlicerRecoveryData {
|
|
40
11
|
slicer_id: number;
|
|
41
|
-
lastSlice?: SliceRequest;
|
|
42
|
-
}
|
|
43
|
-
/**
|
|
44
|
-
* A trackable set of work to be preformed by a "Worker"
|
|
45
|
-
*/
|
|
46
|
-
export interface Slice {
|
|
47
|
-
/**
|
|
48
|
-
* A unique identifier for the slice
|
|
49
|
-
*/
|
|
50
|
-
slice_id: string;
|
|
51
|
-
/**
|
|
52
|
-
* A reference to the slicer that created the slice.
|
|
53
|
-
*/
|
|
54
|
-
slicer_id: number;
|
|
55
|
-
/**
|
|
56
|
-
* A reference to the slicer
|
|
57
|
-
*/
|
|
58
|
-
slicer_order: number;
|
|
59
|
-
request: SliceRequest;
|
|
60
|
-
_created: string;
|
|
61
|
-
}
|
|
62
|
-
export interface SliceAnalyticsData {
|
|
63
|
-
time: number[];
|
|
64
|
-
size: number[];
|
|
65
|
-
memory: number[];
|
|
12
|
+
lastSlice?: Teraslice.SliceRequest;
|
|
66
13
|
}
|
|
67
|
-
export declare const sliceAnalyticsMetrics: readonly (keyof SliceAnalyticsData)[];
|
|
68
|
-
export type SlicerResult = Slice | SliceRequest | SliceRequest[] | null;
|
|
14
|
+
export declare const sliceAnalyticsMetrics: readonly (keyof Teraslice.SliceAnalyticsData)[];
|
|
15
|
+
export type SlicerResult = Teraslice.Slice | Teraslice.SliceRequest | Teraslice.SliceRequest[] | null;
|
|
69
16
|
export interface SliceResult {
|
|
70
|
-
slice: Slice;
|
|
71
|
-
analytics: SliceAnalyticsData;
|
|
17
|
+
slice: Teraslice.Slice;
|
|
18
|
+
analytics: Teraslice.SliceAnalyticsData;
|
|
72
19
|
error?: string;
|
|
73
20
|
}
|
|
74
21
|
export interface SlicerFn {
|