Skip to content

Commit

Permalink
feat!: move to typescript code generation (#264)
Browse files Browse the repository at this point in the history
* update from synthtool

* move to typescript

* update synth script and run it

* convert system-test to ts

* try this

* lint

* regenerate to pick up change for path template

* update client

* gts fix

* update copyright

* 2020 copyright

* try this

* fix unit test

* re-generate

* make sample test work

* remove sample test for IAM policy

* liny

* remove doc, revert sample-test

* add iam client to kmsClient

* update sample-test

* lint

* makes samples test work

* lint

* update

* convert system-tets to ts

* rerun synthtool

* sample test

* fix

* mix-in

* update synthtool

* run synthtool & test

* test

* manual add IamClient and pass unit tests

* clean up

* npm run lint

* test samples

* manual iam_service_config

* ts client interface overload

* test

* test

* return value

* return list

* clean up

* remove console warn

* sample-test work!

* require module correctly

* synthtool change

* include all files in tarball, system-test passes

* synthtool, all tests green

* merge

* fix for system-test

* feedback

* update dependencies

* license aligned for helper.ts

* remove helper.ts, tslint from synth.py

* move script around

* add comments to iamclient & synth.py

* rename helperMethods.tmpl

* rerun ynthtool

* give auth the type

* re set up scripts in package.json

* add meaningful comment

* add comments in helperMethods.tmpl

* test

* import * as packagejson from ../package.json;

* remove any

* run synthtool
  • Loading branch information
xiaozhenliu-gg5 authored Mar 5, 2020
1 parent f0b95d5 commit 689a78f
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions kms/addMemberToCryptoKeyPolicy.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ async function addMemberToCryptoKeyPolicy(
keyRingId,
cryptoKeyId
);

// Gets the IAM policy of a crypto key
const [result] = await client.getIamPolicy({resource});
let policy = Object.assign({bindings: []}, result);
const index = policy.bindings.findIndex(binding => binding.role === role);

// Add the role/member combo to the policy
const members = [];
const binding = Object.assign({role, members}, policy.bindings[index]);
Expand Down
2 changes: 1 addition & 1 deletion kms/system-test/kms.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ describe('kms sample tests', () => {
});

describe('asymmetric keys', () => {
const kms = require('../../src');
const kms = require('@google-cloud/kms');
const client = new kms.KeyManagementServiceClient();

const locationId = `global`;
Expand Down

0 comments on commit 689a78f

Please sign in to comment.