Skip to content

Commit

Permalink
Remove includeBasic.
Browse files Browse the repository at this point in the history
  • Loading branch information
dcr-stripe committed Jul 26, 2021
1 parent d3a1687 commit 245c0e1
Show file tree
Hide file tree
Showing 4 changed files with 1 addition and 64 deletions.
30 changes: 0 additions & 30 deletions lib/StripeMethod.basic.js

This file was deleted.

7 changes: 0 additions & 7 deletions lib/StripeResource.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ StripeResource.extend = utils.protoExtend;

// Expose method-creator & prepared (basic) methods
StripeResource.method = require('./StripeMethod');
StripeResource.BASIC_METHODS = require('./StripeMethod.basic');

StripeResource.MAX_BUFFERED_REQUEST_METRICS = 100;
const MAX_RETRY_AFTER_WAIT = 60;
Expand All @@ -44,12 +43,6 @@ function StripeResource(stripe, deprecatedUrlData) {
this.resourcePath = this.path;
this.path = utils.makeURLInterpolator(this.path);

if (this.includeBasic) {
this.includeBasic.forEach(function(methodName) {
this[methodName] = StripeResource.BASIC_METHODS[methodName];
}, this);
}

this.initialize(...arguments);
}

Expand Down
27 changes: 1 addition & 26 deletions types/lib.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,38 +8,13 @@ declare module 'stripe' {
export class StripeResource {
static extend<
// eslint-disable-next-line @typescript-eslint/no-explicit-any
T extends {[prop: string]: any} & {
includeBasic?: Array<
'create' | 'retrieve' | 'update' | 'list' | 'del'
>;
}
T extends {[prop: string]: any}
>(spec: T): StripeResource & T;
static method(spec: {
method: string;
path: string;
methodType?: 'list';
}): (...args: any[]) => object; //eslint-disable-line @typescript-eslint/no-explicit-any
static BASIC_METHODS: {
create<T>(
params: CouponCreateParams,
options?: RequestOptions
): Promise<T>;
retrieve<T>(
id: string,
params?: CouponRetrieveParams,
options?: RequestOptions
): Promise<T>;
update<T>(
id: string,
params?: CouponUpdateParams,
options?: RequestOptions
): Promise<T>;
list<T>(
params?: CouponListParams,
options?: RequestOptions
): ApiListPromise<T>;
del<T>(id: string, options?: RequestOptions): Promise<T>;
};
static MAX_BUFFERED_REQUEST_METRICS: number;
}
export type LatestApiVersion = '2020-08-27';
Expand Down
1 change: 0 additions & 1 deletion types/test/typescriptTest.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ const stripeCardError: Stripe.StripeCardError = Stripe.errors.generate({
});

Stripe.StripeResource.extend({
includeBasic: ['retrieve'],
foo: Stripe.StripeResource.method({
method: 'create',
path: 'foo',
Expand Down

0 comments on commit 245c0e1

Please sign in to comment.