teraslice-client-js 1.3.0 → 1.3.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/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.0",
4
+ "version": "1.3.2",
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.0",
36
+ "@terascope/utils": "^1.3.2",
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[result]) {
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[result]) {
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: string[] = [
145
+ const methodTestCases = [
146
146
  'stop',
147
147
  'pause',
148
148
  'resume'
149
- ];
150
- describe.each(methodTestCases)('->%s', (method: string) => {
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: string[] = [
177
+ const methodTestCases = [
178
178
  'start',
179
179
  'stop',
180
180
  'pause',
181
181
  'resume'
182
- ];
183
- describe.each(methodTestCases)('->%s', (method: string) => {
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}`)
package/tsconfig.json CHANGED
@@ -2,7 +2,8 @@
2
2
  "extends": "../../tsconfig",
3
3
  "compilerOptions": {
4
4
  "outDir": "dist",
5
- "rootDir": "."
5
+ "rootDir": ".",
6
+ "suppressImplicitAnyIndexErrors": false
6
7
  },
7
8
  "include": [
8
9
  "src",