Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stripe-node v8.0.0 #742

Merged
merged 10 commits into from
Jan 10, 2020
Merged

stripe-node v8.0.0 #742

merged 10 commits into from
Jan 10, 2020

Conversation

rattrayalex-stripe
Copy link
Contributor

@rattrayalex-stripe rattrayalex-stripe commented Dec 24, 2019

In stripe-node version 8.0.0, we are releasing first-class TypeScript support, ending support for Node 6 (thus requiring Node 8, 10, or higher), and removing a few deprecated API resources and library methods (mostly internal constants and obscure uses of Errors).

Note that stripe.usageRecords.create() is now stripe.subcscriptionItems.createUsageRecord(), and stripe.usageRecordSummaries.list() is now stripe.subscriptionItems.listUsageRecordSummaries().

The stripeVersion request option is now apiVersion (a console warning will be emitted if you use the former).

Migration guide: https://github.com/stripe/stripe-node/wiki/Migration-guide-for-v8

Full list:

⚠️ = breaking changes

cc @stripe/api-libraries

* First pass

* wip

* More changes

* Split resources by file

* Move to api version folder

* Remove tsconfig, add prettierignore

* Properly generate nested and no-method resources

* Document new TypeScript usage in README

* Add a basic test for typescript correctness

* Better formatting for export of Stripe

* Break out subtypes

* Separate out Address

* Pull empty strings out of enums

* Use all named subresources from openapi

* Rough draft of using shared subresources

* Revert "Rough draft of using shared subresources"

This reverts commit eb9a4d8.

* Fix some bugs I think

* Okay actually go back to normal

* Actually use all shared subresources from openapi

* Revert "Actually use all shared subresources from openapi"

This reverts commit 52136ae.

* Add webhooks.d.ts

* Add and test ApiListPromise for async iteration of lists

* Add better types for ApiList and HeaderOptions

* Rename HeaderOptions to RequestOptions

* Add docs and tests for expanding objects

* Add in reference to webhooks.d.ts

* Update snapshots to reflect reordering

* Add multiple dispatch for optional params

* Add TS tests for multiple dispatch, config, etc

* Move types for setAppInfo

* Add errors

* Fix some formatting

* Remove (Customer) Source and ExternalAccount

* Move metadata back up, add deleted?: void, add eg DeletedCustomer to the union for expandable deletable objects

* Reorder nested methods, rename nested & delete param types, move nested model & param types into their own files

* Remove docstrings from param types since they exist on method definitions

* Reorder required params to be first

* Minor method reorder

* Describe why you have to explicitly reference the types

* Move from vYYYY-MM-DD to YYYY-MM-DD, upgrade api version to 2019-12-03

* Update future version

* Fix param type name and mention esModuleInterop in docs

* Add docstring and test for ApiList

* Add docstrings for errors

* Fix accidentally optional fields

* Add missing values to RawErrorType

* Fix many non-optional fields

* Remove whitespace typo

* Add signature for retrieving a specific account

* Add types for OAuth

* Openapi updates

* Rename Webhooks in git

* Use export default instead of export = so that users dont need to do esModuleInterop

* Add a default export to the runtime

* Also export Stripe as a named export, and as a static property on itself

* Collapse types for setHost

* Require the user to specify the latest API version, use types by default.

* Fix a type error

* Reorganize test, use strictNullChecks etc

* Fix readme

* Unexport error classes to avoid instanceof confusion

* Clarify how to use old api versions with TS

* Fix typo params -> param

* Updates from openapi

* Mark the args to several setters as required

* More accurate handling of deleted resources and required/optional fields

* Erroneous handling of deleted

* Revert "Erroneous handling of deleted"

This reverts commit ad64e33.

* Add comment about deprecated total_count.

* Add shared types for Addresses and Metadata, and update openapi

* Use null intead of empty string

* Fix invoice upcoming lines

* Update openapi

* More empty-string to null translation

* Stop polluting the global namespace by scoping everything under module stripe

* Run eslint & prettier on TS files

* Continue to have poor types for HttpAgent, but with more claity as to why

* Clean up explicit any lint warnings

* Remove constants intended for internal use only

* Extract CustomerSource to a standalone type

* Remove unnecessary export

* Better types for account debit sources

* Use shared RangeQueryParam and PaginationParam

* Add expand param to SubscriptionDeleteParams

* Bring business_type back

* Add docstrings to config options

* Add mandatory `typescript: true` config prop

* Use await in TS readme

* Wrap await in async function

* Many readme updates

* Remove docs on non-public fields/params (we should revert this if it comes up a lot)

* Clarify async/await a bit

* TypeScriptify docstrings for Webhooks

* Add @types/node as a dependency, use it for typing Buffer and http.Agent

* Remove a TODO

Co-authored-by: jlomas-stripe <jlomas-stripe@users.noreply.github.com>
* Correct "eg;" to "e.g.,"

* Fix typo
* Remove stripe.usageRecords and stripe.usageRecordSummaries, add stripe.subscriptionItems.listUsageRecordSummaries

* Update openapi

* Remove Recipients

* Remove BitcoinReceivers

* Remove ThreeDSecure
It was incorrectly pointing back to SubscriptionSchedules.Plan instead of Stripe.Plan
* Deprecate snake_case options like stripe_account with warning messages

* Remove deprecated Error base export, extend method, and populate method

* Privatize several constants

* Add protocol to config object for local proxies etc

* Add `appInfo` config option

* Mark all setter methods as deprecated, emit warnings.

* Mark methods prefixed with an underscore as private

* Mark a few getter methods which are not prefixed with underscores as private

* Rename the request option stripeVersion to apiVersion to be consistent with the config option and our overall terminology

* Throw an error if a deprecated and non-deprecated version of the same request option is passed
…ooks.constructEvent (#753)

* Stop importing errors as a single Error object, which shadowed the real Error object

* Accept an array of strings (or buffers) as the header in webhooks

* Actually just throw an error if an array is actually passed
@rattrayalex-stripe
Copy link
Contributor Author

Okay, I think this is ready to go!

r? @ob-stripe

@ob-stripe ob-stripe self-assigned this Jan 9, 2020
Copy link
Contributor

@ob-stripe ob-stripe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! 🚢

@ob-stripe
Copy link
Contributor

Actually hold on a sec.

@ob-stripe
Copy link
Contributor

Alright I think we're good :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants