teraslice-client-js 1.3.0 → 1.3.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/ex.js +1 -1
- package/dist/src/ex.js.map +1 -1
- package/dist/src/job.js +1 -1
- package/dist/src/job.js.map +1 -1
- package/dist/test/ex-spec.js.map +1 -1
- package/dist/test/job-spec.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/ex.ts +1 -1
- package/src/job.ts +2 -2
- package/test/ex-spec.ts +3 -3
- package/test/job-spec.ts +3 -3
- package/tsconfig.json +2 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "teraslice-client-js",
|
|
3
3
|
"displayName": "Teraslice Client (JavaScript)",
|
|
4
|
-
"version": "1.3.
|
|
4
|
+
"version": "1.3.1",
|
|
5
5
|
"description": "A Node.js client for teraslice jobs, assets, and cluster references.",
|
|
6
6
|
"keywords": [
|
|
7
7
|
"elasticsearch",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@terascope/types": "^1.2.0",
|
|
36
|
-
"@terascope/utils": "^1.3.
|
|
36
|
+
"@terascope/utils": "^1.3.1",
|
|
37
37
|
"auto-bind": "^5.0.1",
|
|
38
38
|
"got": "^13.0.0"
|
|
39
39
|
},
|
package/src/ex.ts
CHANGED
|
@@ -165,7 +165,7 @@ export default class Ex extends Client {
|
|
|
165
165
|
// These are terminal states for a job so if we're not explicitly
|
|
166
166
|
// watching for these then we need to stop waiting as the job
|
|
167
167
|
// status won't change further.
|
|
168
|
-
if (terminal
|
|
168
|
+
if (result in terminal) {
|
|
169
169
|
throw new TSError(
|
|
170
170
|
`Execution cannot reach the target status, "${target}", because it is in the terminal state, "${result}"`,
|
|
171
171
|
{ context: { lastStatus: result } }
|
package/src/job.ts
CHANGED
|
@@ -143,7 +143,7 @@ export default class Job extends Client {
|
|
|
143
143
|
const checkStatus = async (): Promise<Teraslice.ExecutionStatus> => {
|
|
144
144
|
let result;
|
|
145
145
|
try {
|
|
146
|
-
const ex = await this.get(`/jobs/${this._jobId}/ex`, options);
|
|
146
|
+
const ex = await this.get<Teraslice.ExecutionConfig>(`/jobs/${this._jobId}/ex`, options);
|
|
147
147
|
if (exId && ex.ex_id !== exId) {
|
|
148
148
|
console.warn(`[WARNING] the execution ${ex.ex_id} has changed from ${exId}`);
|
|
149
149
|
}
|
|
@@ -164,7 +164,7 @@ export default class Job extends Client {
|
|
|
164
164
|
// These are terminal states for a job so if we're not explicitly
|
|
165
165
|
// watching for these then we need to stop waiting as the job
|
|
166
166
|
// status won't change further.
|
|
167
|
-
if (terminal
|
|
167
|
+
if (result in terminal) {
|
|
168
168
|
throw new TSError(
|
|
169
169
|
`Job cannot reach the target status, "${target}", because it is in the terminal state, "${result}"`,
|
|
170
170
|
{ context: { lastStatus: result } }
|
package/test/ex-spec.ts
CHANGED
|
@@ -142,12 +142,12 @@ describe('Teraslice Ex', () => {
|
|
|
142
142
|
});
|
|
143
143
|
});
|
|
144
144
|
|
|
145
|
-
const methodTestCases
|
|
145
|
+
const methodTestCases = [
|
|
146
146
|
'stop',
|
|
147
147
|
'pause',
|
|
148
148
|
'resume'
|
|
149
|
-
];
|
|
150
|
-
describe.each(methodTestCases)('->%s', (method
|
|
149
|
+
] as const;
|
|
150
|
+
describe.each(methodTestCases)('->%s', (method) => {
|
|
151
151
|
describe('when called with nothing', () => {
|
|
152
152
|
beforeEach(() => {
|
|
153
153
|
scope.post(`/ex/some-ex-id/_${method}`)
|
package/test/job-spec.ts
CHANGED
|
@@ -174,13 +174,13 @@ describe('Teraslice Job', () => {
|
|
|
174
174
|
});
|
|
175
175
|
});
|
|
176
176
|
|
|
177
|
-
const methodTestCases
|
|
177
|
+
const methodTestCases = [
|
|
178
178
|
'start',
|
|
179
179
|
'stop',
|
|
180
180
|
'pause',
|
|
181
181
|
'resume'
|
|
182
|
-
];
|
|
183
|
-
describe.each(methodTestCases)('->%s', (method
|
|
182
|
+
] as const;
|
|
183
|
+
describe.each(methodTestCases)('->%s', (method) => {
|
|
184
184
|
describe('when called with nothing', () => {
|
|
185
185
|
beforeEach(() => {
|
|
186
186
|
scope.post(`/jobs/some-job-id/_${method}`)
|