useshortcut / shortcut-client-js

The official JavaScript client library for the Shortcut (formerly Clubhouse) REST API.
https://useshortcut.github.io/shortcut-client-js/
133 stars 31 forks source link

add getStoryHistory client method #108

Closed trescenzi closed 2 years ago

trescenzi commented 3 years ago

Hello! I was looking into getting some story history stats and I found that the wasn't a way to get them with the client. It seemed easy enough so I went ahead and added it. Let me know if you want me to add tests. There wasn't one for getStory so I figured it was simple enough of a method it wasn't necessary. But happy to follow the pattern and add them if you'd like.

Also just a note I wasn't able to get the flow types to build. Not sure way but I also couldn't build main so I think it's something about my environment not the code changes. If it's helpful this is the error:

$ scripts/generate-flow-types.sh && node scripts/convert-import-from-types
Parsing FetchRequestParser
Parsing types
Parsing TokenRequestFactory
/Users/thomas.crescenzi/work/lib2/node_modules/flowgen/lib/printers/node.js:173
      isExternalSymbol = decl.kind === ts.SyntaxKind.NamespaceImport || decl.kind === ts.SyntaxKind.NamedImports;
                              ^

TypeError: Cannot read property 'kind' of undefined
    at getTypeofFullyQualifiedName (/Users/thomas.crescenzi/work/lib2/node_modules/flowgen/lib/printers/node.js:173:31)
    at /Users/thomas.crescenzi/work/lib2/node_modules/flowgen/lib/printers/node.js:613:28
    at Object.fn (/Users/thomas.crescenzi/work/lib2/node_modules/flowgen/lib/env.js:10:12)
    at Object.propertyDeclaration (/Users/thomas.crescenzi/work/lib2/node_modules/flowgen/lib/printers/declarations.js:46:31)
    at /Users/thomas.crescenzi/work/lib2/node_modules/flowgen/lib/printers/node.js:519:36
    at Object.fn (/Users/thomas.crescenzi/work/lib2/node_modules/flowgen/lib/env.js:10:12)
    at /Users/thomas.crescenzi/work/lib2/node_modules/flowgen/lib/printers/declarations.js:74:35
    at Array.map (<anonymous>)
    at interfaceType (/Users/thomas.crescenzi/work/lib2/node_modules/flowgen/lib/printers/declarations.js:73:32)
    at Object.classDeclaration (/Users/thomas.crescenzi/work/lib2/node_modules/flowgen/lib/printers/declarations.js:275:144)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
charpeni commented 2 years ago

Closing this in favor of #126.

We are currently rewriting this library to be a generated TypeScript client from a Swagger/OpenAPI schema.