From abf28797a48dd35bf3defaff537fa10d938041a2 Mon Sep 17 00:00:00 2001 From: Alexander Fisher Date: Tue, 24 May 2016 16:35:44 -0400 Subject: [PATCH] Add node and corejs to ambient typings since they represent native types. Update client to not use finally since this doesn't exist on a node js Promise. --- samples/client/petstore/typescript-node/npm/client.ts | 2 +- samples/client/petstore/typescript-node/npm/package.json | 5 +++-- samples/client/petstore/typescript-node/npm/typings.json | 6 ++++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/samples/client/petstore/typescript-node/npm/client.ts b/samples/client/petstore/typescript-node/npm/client.ts index e7408dc1785..488057b9500 100644 --- a/samples/client/petstore/typescript-node/npm/client.ts +++ b/samples/client/petstore/typescript-node/npm/client.ts @@ -50,7 +50,7 @@ petApi.addPet(pet) console.error(err); exitCode = 1; }) - .finally(() => { + .then(() => { return petApi.deletePet(petId); }) .then((res) => { diff --git a/samples/client/petstore/typescript-node/npm/package.json b/samples/client/petstore/typescript-node/npm/package.json index e07e1bfbbf5..823a37ae4f0 100644 --- a/samples/client/petstore/typescript-node/npm/package.json +++ b/samples/client/petstore/typescript-node/npm/package.json @@ -5,9 +5,10 @@ "repository": "GIT_USER_ID/GIT_REPO_ID", "main": "api.js", "scripts": { + "postinstall": "typings install", "clean": "rm -Rf node_modules/ typings/ *.js", - "build": "typings install && tsc", - "test": "tsc && node client.js" + "build": "tsc", + "test": "npm run build && node client.js" }, "author": "Swagger Codegen Contributors", "license": "Apache-2.0", diff --git a/samples/client/petstore/typescript-node/npm/typings.json b/samples/client/petstore/typescript-node/npm/typings.json index 838d139e080..00749fcdc07 100644 --- a/samples/client/petstore/typescript-node/npm/typings.json +++ b/samples/client/petstore/typescript-node/npm/typings.json @@ -1,7 +1,9 @@ { - "dependencies": { + "ambientDependencies": { "core-js": "registry:dt/core-js#0.0.0+20160317120654", - "node": "registry:dt/node#4.0.0+20160423143914", + "node": "registry:dt/node#4.0.0+20160423143914" + }, + "dependencies": { "bluebird": "registry:npm/bluebird#3.3.4+20160515010139", "request": "registry:npm/request#2.69.0+20160304121250" }