Skip to content

Commit a723954

Browse files
Merge pull request watson-developer-cloud#652 from watson-developer-cloud/next
fix(Prettier,tslint): Regeneration of services and tslint support (watson-developer-cloud#638)
2 parents e836f30 + aa1e10a commit a723954

File tree

85 files changed

+5926
-5687
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+5926
-5687
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,5 @@ index.js
3333
**/*.d.ts
3434
!*/blob.d.ts
3535
**/*.js.map
36-
coverage.lcov
36+
coverage.lcov
37+
.swagger-codegen-ignore

.jshintrc

Lines changed: 0 additions & 45 deletions
This file was deleted.

.prettierrc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"useTabs": false,
3+
"printWidth": 100,
4+
"tabWidth": 2,
5+
"singleQuote": true,
6+
"trailingComma": "es5",
7+
"parser": "babylon"
8+
}

.travis.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,13 @@ node_js:
55
- 6
66
- stable
77
before_install:
8+
- openssl aes-256-cbc -K $encrypted_e4ebf4573484_key -iv $encrypted_e4ebf4573484_iv
9+
-in auth.js.enc -out test/resources/auth.js -d
810
- '[ "${TRAVIS_PULL_REQUEST}" = "false" ] && openssl aes-256-cbc -K $encrypted_e4ebf4573484_key
9-
-iv $encrypted_e4ebf4573484 -in auth.js.enc -out test/resources/auth.js -d ||
10-
true'
11+
-iv $encrypted_e4ebf4573484 -in auth.js.enc -out test/resources/auth.js -d || true'
1112
- npm install -g typescript
1213
script:
13-
- tsc # use the tsconfig.json to transpile specified service-files
14+
- tsc
1415
- npm test
1516
- sh scripts/typedoc/generate_typedoc.sh
1617
after_success:

auth.js.enc

160 Bytes
Binary file not shown.

authorization/v1.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
* limitations under the License.
1515
*/
1616

17-
import { createRequest } from '../lib/requestwrapper';
18-
import { BaseService } from '../lib/base_service';
1917
import url = require('url');
18+
import { BaseService } from '../lib/base_service';
19+
import { createRequest } from '../lib/requestwrapper';
2020

2121
class AuthorizationV1 extends BaseService {
22+
static URL: string = 'https://stream.watsonplatform.net/authorization/api';
2223
name;
2324
serviceVersion;
24-
static URL: string = 'https://stream.watsonplatform.net/authorization/api';
2525

2626
/**
2727
* Authorization Service

conversation/v1-generated.ts

Lines changed: 1155 additions & 1186 deletions
Large diffs are not rendered by default.

conversation/v1.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@
1414
* limitations under the License.
1515
*/
1616

17-
import GeneratedConversationV1 = require('./v1-generated');
1817
import extend = require('extend');
1918
import { getMissingParams } from '../lib/helper';
2019
import { createRequest } from '../lib/requestwrapper';
20+
import GeneratedConversationV1 = require('./v1-generated');
2121

2222
class ConversationV1 extends GeneratedConversationV1 {
2323
static VERSION_DATE_2017_05_26: string = '2017-05-26';
@@ -30,17 +30,17 @@ class ConversationV1 extends GeneratedConversationV1 {
3030

3131
static VERSION_DATE_2016_07_11: string = '2016-07-11';
3232

33+
private static removedError: Error = new Error(
34+
'This endpoint has been deprecated.'
35+
);
36+
3337
constructor(options) {
3438
// For backward compatibility, allow version to be passed in version_date.
3539
const _options = extend({}, options);
3640
_options.version = _options.version_date || _options.version;
3741
super(_options);
3842
}
3943

40-
private static removedError: Error = new Error(
41-
'This endpoint has been deprecated.'
42-
);
43-
4444
workspaceStatus(params, callback) {
4545
console.warn(ConversationV1.removedError);
4646
}
@@ -62,7 +62,7 @@ class ConversationV1 extends GeneratedConversationV1 {
6262

6363
const requiredParams = ['workspace_id', 'old_intent', 'intent'];
6464
const missingParams = getMissingParams(params, requiredParams);
65-
if (missingParams) return callback(missingParams);
65+
if (missingParams) { return callback(missingParams); }
6666

6767
const _params: GeneratedConversationV1.UpdateIntentParams = {
6868
workspace_id: params.workspace_id,
@@ -86,7 +86,7 @@ class ConversationV1 extends GeneratedConversationV1 {
8686

8787
const requiredParams = ['workspace_id', 'intent', 'old_text', 'text'];
8888
const missingParams = getMissingParams(params, requiredParams);
89-
if (missingParams) return callback(missingParams);
89+
if (missingParams) { return callback(missingParams); }
9090

9191
const _params: GeneratedConversationV1.UpdateExampleParams = {
9292
workspace_id: params.workspace_id,
@@ -121,7 +121,7 @@ class ConversationV1 extends GeneratedConversationV1 {
121121

122122
const requiredParams = ['workspace_id', 'old_text', 'text'];
123123
const missingParams = getMissingParams(params, requiredParams);
124-
if (missingParams) return callback(missingParams);
124+
if (missingParams) { return callback(missingParams); }
125125

126126
const _params: GeneratedConversationV1.UpdateCounterexampleParams = {
127127
workspace_id: params.workspace_id,
@@ -151,7 +151,7 @@ class ConversationV1 extends GeneratedConversationV1 {
151151

152152
const requiredParams = ['workspace_id', 'old_entity', 'entity'];
153153
const missingParams = getMissingParams(params, requiredParams);
154-
if (missingParams) return callback(missingParams);
154+
if (missingParams) { return callback(missingParams); }
155155

156156
const _params: GeneratedConversationV1.UpdateEntityParams = {
157157
workspace_id: params.workspace_id,
@@ -185,7 +185,7 @@ class ConversationV1 extends GeneratedConversationV1 {
185185

186186
const requiredParams = ['workspace_id', 'entity', 'old_value', 'value'];
187187
const missingParams = getMissingParams(params, requiredParams);
188-
if (missingParams) return callback(missingParams);
188+
if (missingParams) { return callback(missingParams); }
189189

190190
const _params: GeneratedConversationV1.UpdateValueParams = {
191191
workspace_id: params.workspace_id,
@@ -218,7 +218,7 @@ class ConversationV1 extends GeneratedConversationV1 {
218218
'synonym'
219219
];
220220
const missingParams = getMissingParams(params, requiredParams);
221-
if (missingParams) return callback(missingParams);
221+
if (missingParams) { return callback(missingParams); }
222222

223223
const _params: GeneratedConversationV1.UpdateSynonymParams = {
224224
workspace_id: params.workspace_id,
@@ -236,7 +236,7 @@ class ConversationV1 extends GeneratedConversationV1 {
236236
}
237237

238238
createDialogNode(params, callback) {
239-
let _params = extend({}, params);
239+
const _params = extend({}, params);
240240
if (params && params.type && !_params.node_type) {
241241
_params.node_type = params.type;
242242
}
@@ -271,7 +271,7 @@ class ConversationV1 extends GeneratedConversationV1 {
271271

272272
const requiredParams = ['workspace_id', 'old_dialog_node', 'dialog_node'];
273273
const missingParams = getMissingParams(params, requiredParams);
274-
if (missingParams) return callback(missingParams);
274+
if (missingParams) { return callback(missingParams); }
275275

276276
const _params: GeneratedConversationV1.UpdateDialogNodeParams = {
277277
workspace_id: params.workspace_id,

dialog/v1.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@
1515
*/
1616

1717
import extend = require('extend');
18-
import pick = require('object.pick');
19-
import omit = require('object.omit');
2018
import isStream = require('isstream');
19+
import omit = require('object.omit');
20+
import pick = require('object.pick');
2121
import { RequestResponse } from 'request';
22-
import { createRequest } from '../lib/requestwrapper';
2322
import { BaseService } from '../lib/base_service';
2423
import { FileObject } from '../lib/helper';
24+
import { createRequest } from '../lib/requestwrapper';
2525

2626
class DialogV1 extends BaseService {
2727
static URL: string = 'https://gateway.watsonplatform.net/dialog/api';
@@ -301,7 +301,7 @@ DialogV1.prototype.name = 'dialog';
301301
DialogV1.prototype.serviceVersion = 'v1';
302302

303303
namespace DialogV1 {
304-
/** Options for the `DialogV1` constructor. **/
304+
/** Options for the `DialogV1` constructor. */
305305
export type Options = {
306306
url?: string;
307307
username?: string;
@@ -310,82 +310,82 @@ namespace DialogV1 {
310310
headers?: object;
311311
};
312312

313-
/** The callback for a service request. **/
313+
/** The callback for a service request. */
314314
export type Callback = (
315315
error: any,
316316
body?: any,
317317
response?: RequestResponse
318318
) => void;
319319

320320
export interface UpdateDialogParams {
321-
/** The dialog template identifier. **/
321+
/** The dialog template identifier. */
322322
dialog_id: string;
323-
/** The dialog template file. Valid file extensions are .mct for encrypeed dialog files, .json and .xml. **/
323+
/** The dialog template file. Valid file extensions are .mct for encrypeed dialog files, .json and .xml. */
324324
file: FileObject;
325325
}
326326

327327
export interface UpdateContentParams {
328-
/** The dialog template identifier. **/
328+
/** The dialog template identifier. */
329329
dialog_id: string;
330330
[key: string]: any;
331331
}
332332

333333
export interface GetContentParams {
334-
/** The dialog template identifier. **/
334+
/** The dialog template identifier. */
335335
dialog_id: string;
336336
[key: string]: any;
337337
}
338338

339339
export interface GetDialogsParams {}
340340

341341
export interface CreateDialogParams {
342-
/** The dialog template name. **/
342+
/** The dialog template name. */
343343
name: string;
344-
/** The dialog template file. Valid file extensions are .mct for encrypeed dialog files, .json and .xml. **/
344+
/** The dialog template file. Valid file extensions are .mct for encrypeed dialog files, .json and .xml. */
345345
file: FileObject;
346346
}
347347

348348
export interface DeleteDialogParams {
349-
/** The dialog identifier. **/
349+
/** The dialog identifier. */
350350
id: string;
351351
}
352352

353353
export interface ConversationParams {
354-
/** The dialog template indentifier. **/
354+
/** The dialog template indentifier. */
355355
dialog_id: string;
356-
/** A generated conversation identifier number. If it is not specified, a new conversation is started. **/
356+
/** A generated conversation identifier number. If it is not specified, a new conversation is started. */
357357
conversation_id: string;
358-
/** A generated client identifier number. If it is not specified, a new client identifier is issued. **/
358+
/** A generated client identifier number. If it is not specified, a new client identifier is issued. */
359359
client_id: string;
360-
/** The user input to be processed. If the conversation_id parameter is blank, this parameter is optional. **/
360+
/** The user input to be processed. If the conversation_id parameter is blank, this parameter is optional. */
361361
input: string;
362362
}
363363

364364
export interface GetConversationParams {
365-
/** The dialog template identifier. **/
365+
/** The dialog template identifier. */
366366
dialog_id: string;
367-
/** The start of the range in YYYY-MM-DD HH:MM:SS format. **/
367+
/** The start of the range in YYYY-MM-DD HH:MM:SS format. */
368368
date_from: string;
369-
/** The end of the range in YYYY-MM-DD HH:MM:SS format. **/
369+
/** The end of the range in YYYY-MM-DD HH:MM:SS format. */
370370
date_to: string;
371-
/** The offset starting point in the conversation result list. The default value is 0. **/
371+
/** The offset starting point in the conversation result list. The default value is 0. */
372372
offset: number;
373-
/** The maximum number of conversations to retrieve. The default value is 10000. **/
373+
/** The maximum number of conversations to retrieve. The default value is 10000. */
374374
limit: number;
375375
}
376376

377377
export interface GetProfileParams {
378-
/** The dialog template identifier. **/
378+
/** The dialog template identifier. */
379379
dialog_id: string;
380-
/** A client ID obtained from /dialog. **/
380+
/** A client ID obtained from /dialog. */
381381
client_id: string;
382-
name: string | Array<string>;
382+
name: string | string[];
383383
}
384384

385385
export interface UpdateProfileParams {
386-
/** The dialog template identifier. **/
386+
/** The dialog template identifier. */
387387
dialog_id: string;
388-
/** A client ID obtained from /dialog. **/
388+
/** A client ID obtained from /dialog. */
389389
client_id: string;
390390
name_values: string;
391391
}

0 commit comments

Comments
 (0)