IBM / keyprotect-nodejs-client

Nodejs SDK for interacting with the IBMCloud KeyProtect service.
Apache License 2.0
0 stars 10 forks source link

Typing for `body` in `createKey` does not match example #7

Open CarstenLeue opened 3 years ago

CarstenLeue commented 3 years ago

In the example https://www.npmjs.com/package/@ibm-cloud/ibm-key-protect the type of body is an object:

const body = {
    metadata: {
      collectionType: 'application/vnd.ibm.kms.key+json',
      collectionTotal: 1,
    },
    resources: [
      {
        type: 'application/vnd.ibm.kms.key+json',
        name: 'nodejsKey',
        extractable: false,
      },
    ],
  };

But the TS type for the payload (https://github.com/IBM/keyprotect-nodejs-client/blob/master/ibm-key-protect-api/v2.ts#L2447) says:

NodeJS.ReadableStream|Buffer

This does not match and it makes it hard to use the API in TS.

thu2thu2 commented 2 years ago

Thanks for pointing out the issue, we will provide a fix in the future release.