mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-12-03 03:31:47 +00:00
Merge remote-tracking branch 'refs/remotes/DefinitelyTyped/master' into express-validator-2.20.4
This commit is contained in:
+13
-1
@@ -107,6 +107,10 @@ namespace ShallowWrapperTest {
|
||||
shallowWrapper = shallowWrapper.shallow();
|
||||
}
|
||||
|
||||
function test_unmount() {
|
||||
shallowWrapper = shallowWrapper.unmount();
|
||||
}
|
||||
|
||||
function test_render() {
|
||||
var cheerioWrapper: CheerioWrapper<MyComponentProps, MyComponentState> = shallowWrapper.render();
|
||||
}
|
||||
@@ -238,6 +242,14 @@ namespace ReactWrapperTest {
|
||||
stringVal: String,
|
||||
elementWrapper: ReactWrapper<HTMLAttributes, {}>
|
||||
|
||||
function test_unmount() {
|
||||
reactWrapper = reactWrapper.unmount();
|
||||
}
|
||||
|
||||
function test_mount() {
|
||||
reactWrapper = reactWrapper.mount();
|
||||
}
|
||||
|
||||
function test_find() {
|
||||
elementWrapper = reactWrapper.find('.selector');
|
||||
reactWrapper = reactWrapper.find(MyComponent);
|
||||
@@ -418,7 +430,7 @@ namespace CheerioWrapperTest {
|
||||
objectVal: Object,
|
||||
boolVal: Boolean,
|
||||
stringVal: String,
|
||||
elementWrapper: ReactWrapper<HTMLAttributes, {}>
|
||||
elementWrapper: CheerioWrapper<HTMLAttributes, {}>
|
||||
|
||||
function test_find() {
|
||||
elementWrapper = cheerioWrapper.find('.selector');
|
||||
|
||||
Vendored
+62
@@ -313,6 +313,7 @@ declare module "enzyme" {
|
||||
export interface ShallowWrapper<P, S> extends CommonWrapper<P, S> {
|
||||
shallow(): ShallowWrapper<P, S>;
|
||||
render(): CheerioWrapper<P, S>;
|
||||
unmount(): ShallowWrapper<any, any>;
|
||||
|
||||
/**
|
||||
* Find every node in the render tree that matches the provided selector.
|
||||
@@ -376,7 +377,68 @@ declare module "enzyme" {
|
||||
}
|
||||
|
||||
export interface ReactWrapper<P, S> extends CommonWrapper<P, S> {
|
||||
unmount(): ReactWrapper<any, any>;
|
||||
mount(): ReactWrapper<any, any>;
|
||||
|
||||
/**
|
||||
* Find every node in the render tree that matches the provided selector.
|
||||
* @param selector The selector to match.
|
||||
*/
|
||||
find<P2>(component: ComponentClass<P2>): ReactWrapper<P2, any>;
|
||||
find<P2>(statelessComponent: (props: P2) => JSX.Element): ReactWrapper<P2, {}>;
|
||||
find(selector: string): ReactWrapper<HTMLAttributes, any>;
|
||||
|
||||
/**
|
||||
* Finds every node in the render tree that returns true for the provided predicate function.
|
||||
* @param predicate
|
||||
*/
|
||||
findWhere(predicate: (wrapper: CommonWrapper<any, any>) => Boolean): ReactWrapper<any, any>;
|
||||
|
||||
/**
|
||||
* Removes nodes in the current wrapper that do not match the provided selector.
|
||||
* @param selector The selector to match.
|
||||
*/
|
||||
filter<P2>(component: ComponentClass<P2>): ReactWrapper<P2, any>;
|
||||
filter<P2>(statelessComponent: StatelessComponent<P2>): ReactWrapper<P2, {}>;
|
||||
filter(selector: string): ReactWrapper<HTMLAttributes, any>;
|
||||
|
||||
/**
|
||||
* Returns a new wrapper with all of the children of the node(s) in the current wrapper. Optionally, a selector
|
||||
* can be provided and it will filter the children by this selector.
|
||||
* @param [selector]
|
||||
*/
|
||||
children<P2>(component: ComponentClass<P2>): ReactWrapper<P2, any>;
|
||||
children<P2>(statelessComponent: StatelessComponent<P2>): ReactWrapper<P2, {}>;
|
||||
children(selector: string): ReactWrapper<HTMLAttributes, any>;
|
||||
children(): ReactWrapper<any, any>;
|
||||
|
||||
/**
|
||||
* Returns a wrapper around all of the parents/ancestors of the wrapper. Does not include the node in the
|
||||
* current wrapper. Optionally, a selector can be provided and it will filter the parents by this selector.
|
||||
*
|
||||
* Note: can only be called on a wrapper of a single node.
|
||||
* @param [selector]
|
||||
*/
|
||||
parents<P2>(component: ComponentClass<P2>): ReactWrapper<P2, any>;
|
||||
parents<P2>(statelessComponent: StatelessComponent<P2>): ReactWrapper<P2, {}>;
|
||||
parents(selector: string): ReactWrapper<HTMLAttributes, any>;
|
||||
parents(): ReactWrapper<any, any>;
|
||||
|
||||
/**
|
||||
* Returns a wrapper of the first element that matches the selector by traversing up through the current node's
|
||||
* ancestors in the tree, starting with itself.
|
||||
*
|
||||
* Note: can only be called on a wrapper of a single node.
|
||||
* @param selector
|
||||
*/
|
||||
closest<P2>(component: ComponentClass<P2>): ReactWrapper<P2, any>;
|
||||
closest<P2>(statelessComponent: StatelessComponent<P2>): ReactWrapper<P2, {}>;
|
||||
closest(selector: string): ReactWrapper<HTMLAttributes, any>;
|
||||
|
||||
/**
|
||||
* Returns a wrapper with the direct parent of the node in the current wrapper.
|
||||
*/
|
||||
parent(): ReactWrapper<any, any>;
|
||||
}
|
||||
|
||||
export interface CheerioWrapper<P, S> extends CommonWrapper<P, S> {
|
||||
|
||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
||||
// Type definitions for helmet
|
||||
// Project: https://github.com/helmetjs/helmet
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>
|
||||
// Definitions by: Cyril Schumacher <https://github.com/cyrilschumacher>, Evan Hahn <https://github.com/EvanHahn>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path="../express/express.d.ts" />
|
||||
|
||||
Vendored
+1
-1
@@ -219,7 +219,7 @@ declare module "mongodb" {
|
||||
indexInformation(name: string, options?: { full?: boolean, readPreference?: ReadPreference | string }): Promise<any>;
|
||||
indexInformation(name: string, options: { full?: boolean, readPreference?: ReadPreference | string }, callback: MongoCallback<any>): void;
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#listCollections
|
||||
listCollections(filter: { name?: string }, options?: { batchSize?: number, readPreference?: ReadPreference | string }): CommandCursor;
|
||||
listCollections(filter: Object, options?: { batchSize?: number, readPreference?: ReadPreference | string }): CommandCursor;
|
||||
//http://mongodb.github.io/node-mongodb-native/2.1/api/Db.html#logout
|
||||
logout(callback: MongoCallback<any>): void;
|
||||
logout(options?: { dbName?: string }): Promise<any>;
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
import nfc = require('nfc');
|
||||
import ndef = require('ndef');
|
||||
import NdefRecord = PhoneGapNfc.NdefRecord;
|
||||
import NdefTag = PhoneGapNfc.NdefTag;
|
||||
import NdefTagEvent = PhoneGapNfc.NdefTagEvent;
|
||||
|
||||
nfc.addTagDiscoveredListener(() => {});
|
||||
nfc.addTagDiscoveredListener(() => {},() => {}, () => {});
|
||||
@@ -39,7 +41,7 @@ nfc.erase();
|
||||
nfc.erase(() => {}, () => {});
|
||||
|
||||
nfc.enabled();
|
||||
nfc.enabled(() => {}, () => {});
|
||||
nfc.enabled((status: String) => {}, (status: String) => {});
|
||||
|
||||
nfc.removeTagDiscoveredListener(() => {});
|
||||
nfc.removeTagDiscoveredListener(() => {},() => {},() => {});
|
||||
@@ -78,3 +80,45 @@ let obj:any = ndef.decodeTnf(bytes[0]);
|
||||
let tnfByte:number = ndef.encodeTnf(bytes[0],bytes[1],bytes[2],bytes[3],bytes[4],bytes[5]);
|
||||
|
||||
let tnfString:string = ndef.tnfToString(tnfByte);
|
||||
|
||||
let ndefTag: NdefTag = {
|
||||
id: [4, 12, 109, 98, 8, 41, -127],
|
||||
techTypes: ["android.nfc.tech.MifareUltralight", "android.nfc.tech.NfcA", "android.nfc.tech.Ndef"],
|
||||
type: "NFC Forum Type 2",
|
||||
date: "1394448136236",
|
||||
|
||||
canMakeReadOnly: true,
|
||||
isWritable: true,
|
||||
maxSize: 137,
|
||||
ndefMessage: records
|
||||
};
|
||||
|
||||
let eventTarget: EventTarget = {
|
||||
addEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean) { return; },
|
||||
dispatchEvent(evt: Event) { return true; },
|
||||
removeEventListener(type: string, listener: EventListenerOrEventListenerObject, useCapture?: boolean) { return; }
|
||||
}
|
||||
|
||||
let ndefTagEvent: NdefTagEvent = {
|
||||
bubbles: false,
|
||||
cancelBubble: false,
|
||||
cancelable: false,
|
||||
currentTarget: eventTarget,
|
||||
defaultPrevented: false,
|
||||
eventPhase: 2,
|
||||
isTrusted: true,
|
||||
returnValue: true,
|
||||
srcElement: new Element(),
|
||||
target: eventTarget,
|
||||
timeStamp: 1394448136236,
|
||||
type: "ndef",
|
||||
initEvent(eventTypeArg: string, canBubbleArg: boolean, cancelableArg: boolean) { return; },
|
||||
preventDefault() { return; },
|
||||
stopImmediatePropagation() { return; },
|
||||
stopPropagation() { return; },
|
||||
AT_TARGET: 0,
|
||||
BUBBLING_PHASE: 0,
|
||||
CAPTURING_PHASE: 0,
|
||||
|
||||
tag: ndefTag
|
||||
};
|
||||
|
||||
Vendored
+2
-2
@@ -49,7 +49,7 @@ declare namespace PhoneGapNfc {
|
||||
canMakeReadOnly:boolean;
|
||||
isWritable:boolean;
|
||||
maxSize:number;
|
||||
records:Array<NdefRecord>;
|
||||
ndefMessage:Array<NdefRecord>;
|
||||
}
|
||||
|
||||
interface TagEvent extends Event {
|
||||
@@ -406,7 +406,7 @@ declare namespace PhoneGapNfc {
|
||||
* @param win The callback that is called when NFC is enabled.
|
||||
* @param fail The callback that is called when NFC is disabled or missing.
|
||||
*/
|
||||
enabled(win?:() => void, fail?:() => void):void;
|
||||
enabled(win?:(status:String) => void, fail?:(status:String) => void):void;
|
||||
|
||||
/**
|
||||
* Removes the previously registered event listener added via nfc.addTagDiscoveredListener
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
|
||||
import * as soap from 'soap';
|
||||
import * as events from 'events';
|
||||
import * as fs from "fs";
|
||||
import * as http from "http";
|
||||
|
||||
const url = 'http://example.com/wsdl?wsdl';
|
||||
const wsdlOptions = { name: 'value' };
|
||||
@@ -21,3 +23,45 @@ soap.createClient(url, wsdlOptions, function(err: any, client: soap.Client) {
|
||||
});
|
||||
});
|
||||
|
||||
var myService = {
|
||||
MyService: {
|
||||
MyPort: {
|
||||
MyFunction: function(args: any) {
|
||||
return {
|
||||
name: args.name
|
||||
};
|
||||
},
|
||||
|
||||
// This is how to define an asynchronous function.
|
||||
MyAsyncFunction: function(args: any, callback: any) {
|
||||
// do some work
|
||||
callback({
|
||||
name: args.name
|
||||
});
|
||||
},
|
||||
|
||||
// This is how to receive incoming headers
|
||||
HeadersAwareFunction: function(args: any, cb: any, headers: any) {
|
||||
return {
|
||||
name: headers.Token
|
||||
};
|
||||
},
|
||||
|
||||
// You can also inspect the original `req`
|
||||
reallyDeatailedFunction: function(args: any, cb: any, headers: any, req: any) {
|
||||
console.log('SOAP `reallyDeatailedFunction` request from ' + req.connection.remoteAddress);
|
||||
return {
|
||||
name: headers.Token
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var xml = fs.readFileSync('myservice.wsdl', 'utf8'),
|
||||
server = http.createServer(function(request,response) {
|
||||
response.end("404: Not Found: " + request.url);
|
||||
});
|
||||
|
||||
server.listen(8000);
|
||||
soap.listen(server, '/wsdl', myService, xml);
|
||||
|
||||
Vendored
+11
-3
@@ -1,9 +1,9 @@
|
||||
// Type definitions for soap
|
||||
// Project: https://www.npmjs.com/package/soap
|
||||
// Definitions by: Nicole Wang <https://github.com/nicoleWjie>
|
||||
// Definitions by: Nicole Wang <https://github.com/nicoleWjie>, Cage Fox <https://github.com/cagefox>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
/// <reference path='../node/node.d.ts' />
|
||||
/// <reference path="../node/node.d.ts" />
|
||||
|
||||
declare module 'soap' {
|
||||
import * as events from 'events';
|
||||
@@ -18,4 +18,12 @@ declare module 'soap' {
|
||||
}
|
||||
function createClient(wsdlPath: string, options: any, fn: (err: any, client: Client) => void): void;
|
||||
|
||||
}
|
||||
export interface Server extends events.EventEmitter {
|
||||
addSoapHeader(soapHeader: any, name:any, namespace: any, xmlns: any): any;
|
||||
changeSoapHeader(index: any, soapHeader: any, name: any, namespace: any, xmlns: any): any;
|
||||
getSoapHeaders(): any;
|
||||
clearSoapHeaders(): any;
|
||||
log(type: any, data: any): any;
|
||||
}
|
||||
export function listen(server: any, path: string, service:any, wsdl: string): Server;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,28 @@
|
||||
/// <reference path="./sqs-consumer.d.ts"/>
|
||||
|
||||
import * as Consumer from "sqs-consumer";
|
||||
|
||||
var app = Consumer.create({
|
||||
queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name',
|
||||
handleMessage: function (message, done) {
|
||||
// do some work with `message`
|
||||
done();
|
||||
}
|
||||
});
|
||||
|
||||
var app2 = Consumer.create({
|
||||
queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name',
|
||||
handleMessage: function(message, done){
|
||||
done();
|
||||
},
|
||||
region: "us-west-1",
|
||||
batchSize: 15,
|
||||
visibilityTimeout: 50,
|
||||
waitTimeSeconds: 50
|
||||
});
|
||||
|
||||
app.on('error', function (err: any) {
|
||||
console.log(err.message);
|
||||
});
|
||||
|
||||
app.start();
|
||||
Vendored
+43
@@ -0,0 +1,43 @@
|
||||
// Type definitions for sqs-consumer
|
||||
// Project: https://github.com/BBC/sqs-consumer
|
||||
// Definitions by: Daniel Chao <http://dchao.co/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference path="../aws-sdk/aws-sdk.d.ts"/>
|
||||
|
||||
declare module "sqs-consumer" {
|
||||
|
||||
import { SQS } from "aws-sdk";
|
||||
|
||||
module SQSConsumer {
|
||||
|
||||
interface MessageHandler {
|
||||
(message: SQS.Message, done: Function): any;
|
||||
}
|
||||
|
||||
interface ConsumerOpts {
|
||||
queueUrl: string;
|
||||
handleMessage: MessageHandler;
|
||||
region?: string;
|
||||
attributeNames?: string[];
|
||||
messageAttributeNames?: string[];
|
||||
batchSize?: number;
|
||||
visibilityTimeout?: number;
|
||||
waitTimeSeconds?: number;
|
||||
authenticationErrorTimeout?: number;
|
||||
sqs?: SQS;
|
||||
}
|
||||
|
||||
interface Consumer extends NodeJS.EventEmitter {
|
||||
start (): void;
|
||||
stop (): void;
|
||||
}
|
||||
|
||||
interface ConsumerFactory {
|
||||
create(opts: ConsumerOpts): Consumer;
|
||||
}
|
||||
}
|
||||
const Consumer: SQSConsumer.ConsumerFactory;
|
||||
export = Consumer;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
// Taken straight from sqs-producer's README.md
|
||||
|
||||
/// <reference path="./sqs-producer.d.ts"/>
|
||||
|
||||
|
||||
import * as Producer from "sqs-producer";
|
||||
|
||||
var producer = Producer.create({
|
||||
queueUrl: 'https://sqs.eu-west-1.amazonaws.com/account-id/queue-name',
|
||||
region: 'eu-west-1'
|
||||
});
|
||||
|
||||
// send messages to the queue
|
||||
producer.send(['msg1', 'msg2'], function(err) {
|
||||
if (err) console.log(err);
|
||||
});
|
||||
|
||||
// get the current size of the queue
|
||||
producer.queueSize(function (err, size) {
|
||||
if (err) console.log(err);
|
||||
|
||||
console.log('There are', size, 'messages on the queue.');
|
||||
});
|
||||
|
||||
// send a message to the queue with a specific ID (by default the body is used as the ID)
|
||||
producer.send([{
|
||||
id: 'id1',
|
||||
body: 'Hello world'
|
||||
}], function(err) {
|
||||
if (err) console.log(err);
|
||||
});
|
||||
|
||||
// send a message to the queue with
|
||||
// - delaySeconds (must be an number contained within 0 and 900)
|
||||
// - messageAttributes
|
||||
producer.send([
|
||||
{
|
||||
id: 'id1',
|
||||
body: 'Hello world with two string attributes: attr1 and attr2',
|
||||
messageAttributes: {
|
||||
attr1: { DataType: 'String', StringValue: 'stringValue' },
|
||||
attr2: { DataType: 'Binary', BinaryValue: new Buffer('binaryValue') }
|
||||
}
|
||||
},
|
||||
{
|
||||
id: 'id2',
|
||||
body: 'Hello world delayed by 5 seconds',
|
||||
delaySeconds: 5
|
||||
}
|
||||
], function(err) {
|
||||
if (err) console.log(err);
|
||||
});
|
||||
Vendored
+51
@@ -0,0 +1,51 @@
|
||||
// Type definitions for sqs-producer
|
||||
// Project: https://github.com/BBC/sqs-producer
|
||||
// Definitions by: Daniel Chao <http://dchao.co/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
///<reference path="../aws-sdk/aws-sdk.d.ts"/>
|
||||
|
||||
declare module "sqs-producer" {
|
||||
|
||||
import { SQS } from "aws-sdk";
|
||||
|
||||
module SQSProducer {
|
||||
|
||||
interface ProducerOpts {
|
||||
queueUrl: string;
|
||||
region?: string;
|
||||
batchSize?: number;
|
||||
sqs?: SQS;
|
||||
}
|
||||
|
||||
interface ProducerCallback<T> {
|
||||
(err?: Error, data?: T): any;
|
||||
}
|
||||
|
||||
interface ProducerMessageAttribute {
|
||||
DataType: "String"|"Binary";
|
||||
StringValue?: string;
|
||||
BinaryValue?: Buffer;
|
||||
}
|
||||
|
||||
interface ProducerMessage {
|
||||
id: string;
|
||||
body: string;
|
||||
messageAttributes?: { [key: string]: ProducerMessageAttribute }
|
||||
delaySeconds?: number;
|
||||
}
|
||||
|
||||
interface ProducerFactory {
|
||||
create(opts: ProducerOpts): Producer;
|
||||
}
|
||||
|
||||
interface Producer {
|
||||
send(messages: string[], cb: ProducerCallback<void>): void;
|
||||
send(messages: ProducerMessage[], cb: ProducerCallback<void>): void;
|
||||
queueSize(cb: ProducerCallback<number>): void;
|
||||
}
|
||||
}
|
||||
|
||||
const Producer: SQSProducer.ProducerFactory;
|
||||
export = Producer;
|
||||
}
|
||||
@@ -941,6 +941,39 @@ stripe.plans.list().then(function (plans) {
|
||||
//#region Subscriptions tests
|
||||
// ##################################################################################
|
||||
|
||||
stripe.subscriptions.create({ plan: "platypi-dev", customer: "cus_5rfJKDJkuxzh5Q" }, function(err, subscription) {
|
||||
// asynchronously called
|
||||
});
|
||||
stripe.subscriptions.create({ plan: "platypi-dev", customer: "cus_5rfJKDJkuxzh5Q" }).then(function(subscription) {
|
||||
// asynchronously called
|
||||
});
|
||||
|
||||
stripe.subscriptions.retrieve("sub_8QwCiwZ9tmMSpt", function(err, subscription) {
|
||||
// asynchronously called
|
||||
});
|
||||
stripe.subscriptions.retrieve("sub_8QwCiwZ9tmMSpt").then(function(subscription) {
|
||||
// asynchronously called
|
||||
});
|
||||
|
||||
stripe.subscriptions.update("sub_8QwCiwZ9tmMSpt", { plan: "platypi" }, function(err, subscription) {
|
||||
// asynchronously called
|
||||
});
|
||||
stripe.subscriptions.update("sub_8QwCiwZ9tmMSpt", { plan: "platypi" }).then(function(subscription) {
|
||||
// asynchronously called
|
||||
});
|
||||
|
||||
stripe.subscriptions.del("sub_8QwCiwZ9tmMSpt", function(err, subscription) {
|
||||
// asynchronously called
|
||||
});
|
||||
stripe.subscriptions.del("sub_8QwCiwZ9tmMSpt").then(function(subscription) {
|
||||
// asynchronously called
|
||||
});
|
||||
|
||||
stripe.subscriptions.list({ customer: "cus_5rfJKDJkuxzh5Q", plan: "platypi-dev" }, function(err, subscriptions) {
|
||||
// asynchronously called
|
||||
});
|
||||
stripe.subscriptions.list({ customer: "cus_5rfJKDJkuxzh5Q", plan: "platypi-dev" }).then(function(subscriptions) {
|
||||
// asynchronously called
|
||||
});
|
||||
|
||||
//#endregion
|
||||
|
||||
Vendored
+77
-42
@@ -1,4 +1,4 @@
|
||||
// Type definitions for stripe-node 4.5.0
|
||||
// Type definitions for stripe-node 4.6.0
|
||||
// Project: https://github.com/stripe/stripe-node/
|
||||
// Definitions by: William Johnston <https://github.com/wjohnsto>, Peter Harris <https://github.com/codeanimal/>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
@@ -61,6 +61,7 @@ declare namespace StripeNode {
|
||||
* @deprecated
|
||||
*/
|
||||
recipients: resources.Recipients;
|
||||
subscriptions: resources.Subscriptions;
|
||||
tokens: resources.Tokens;
|
||||
transfers: resources.Transfers;
|
||||
applicationFees: resources.ApplicationFees;
|
||||
@@ -1250,7 +1251,7 @@ declare namespace StripeNode {
|
||||
subscriptions: ICustomerSubscriptions;
|
||||
}
|
||||
|
||||
interface ICustomerSubscriptions extends IList<customerSubscriptions.ISubscription>, resources.CustomerSubscriptions {}
|
||||
interface ICustomerSubscriptions extends IList<subscriptions.ISubscription>, resources.CustomerSubscriptions {}
|
||||
|
||||
interface ICustomerCreationOptions extends IDataOptionsWithMetadata {
|
||||
/**
|
||||
@@ -3999,7 +4000,7 @@ declare namespace StripeNode {
|
||||
}
|
||||
}
|
||||
|
||||
namespace customerSubscriptions {
|
||||
namespace subscriptions {
|
||||
/**
|
||||
* Subscriptions allow you to charge a customer's card on a recurring basis. A subscription ties a customer to
|
||||
* a particular plan you've created: https://stripe.com/docs/api#create_plan
|
||||
@@ -4098,7 +4099,7 @@ declare namespace StripeNode {
|
||||
trial_start: number;
|
||||
}
|
||||
|
||||
interface ISubscriptionCreationOptions extends IDataOptionsWithMetadata {
|
||||
interface ISubscriptionCustCreationOptions extends IDataOptionsWithMetadata {
|
||||
/**
|
||||
* The identifier of the plan to subscribe the customer to.
|
||||
*/
|
||||
@@ -4143,6 +4144,13 @@ declare namespace StripeNode {
|
||||
trial_end?: number;
|
||||
}
|
||||
|
||||
interface ISubscriptionCreationOptions extends ISubscriptionCustCreationOptions {
|
||||
/***
|
||||
* The identifier of the customer to subscribe.
|
||||
*/
|
||||
customer: string;
|
||||
}
|
||||
|
||||
interface ISubscriptionUpdateOptions extends IDataOptionsWithMetadata {
|
||||
/**
|
||||
* A positive decimal (with at most two decimal places) between 1 and 100. This represents the percentage of the subscription invoice
|
||||
@@ -4206,6 +4214,18 @@ declare namespace StripeNode {
|
||||
*/
|
||||
at_period_end?: boolean;
|
||||
}
|
||||
|
||||
interface ISubscriptionListOptions extends IListOptionsCreated {
|
||||
/**
|
||||
* The ID of the customer whose subscriptions will be retrieved
|
||||
*/
|
||||
customer?: string;
|
||||
|
||||
/**
|
||||
* The ID of the plan whose subscriptions will be retrieved
|
||||
*/
|
||||
plan?: string;
|
||||
}
|
||||
}
|
||||
|
||||
namespace refunds {
|
||||
@@ -5303,8 +5323,8 @@ declare namespace StripeNode {
|
||||
* @param customerId The customer to which the add the subscription.
|
||||
* @param options The options for the new subscription
|
||||
*/
|
||||
createSubscription(customerId: string, data: customerSubscriptions.ISubscriptionCreationOptions, options: HeaderOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
createSubscription(customerId: string, data: customerSubscriptions.ISubscriptionCreationOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
createSubscription(customerId: string, data: subscriptions.ISubscriptionCustCreationOptions, options: HeaderOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
createSubscription(customerId: string, data: subscriptions.ISubscriptionCustCreationOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
|
||||
/**
|
||||
* By default, you can see the 10 most recent active subscriptions stored on a customer directly on the customer
|
||||
@@ -5315,8 +5335,8 @@ declare namespace StripeNode {
|
||||
* @param customerId The customer ID for the subscription
|
||||
* @param subscriptionId The ID of the subscription to retrieve
|
||||
*/
|
||||
retrieveSubscription(customerId: string, subscriptionId: string, options: HeaderOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
retrieveSubscription(customerId: string, subscriptionId: string, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
retrieveSubscription(customerId: string, subscriptionId: string, options: HeaderOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
retrieveSubscription(customerId: string, subscriptionId: string, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
|
||||
/**
|
||||
* Updates an existing subscription on a customer to match the specified parameters. When changing plans or quantities,
|
||||
@@ -5343,8 +5363,8 @@ declare namespace StripeNode {
|
||||
* @param subscriptionId The ID of the subscription to update.
|
||||
* @param data The fields to update
|
||||
*/
|
||||
updateSubscription(customerId: string, subscriptionId: string, data: customerSubscriptions.ISubscriptionUpdateOptions, options: HeaderOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
updateSubscription(customerId: string, subscriptionId: string, data: customerSubscriptions.ISubscriptionUpdateOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
updateSubscription(customerId: string, subscriptionId: string, data: subscriptions.ISubscriptionUpdateOptions, options: HeaderOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
updateSubscription(customerId: string, subscriptionId: string, data: subscriptions.ISubscriptionUpdateOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
|
||||
/**
|
||||
* Cancels a customer's subscription. If you set the at_period_end parameter to true, the subscription will remain active until
|
||||
@@ -5365,9 +5385,9 @@ declare namespace StripeNode {
|
||||
* @param subscriptionId The ID of the subscription to cancel.
|
||||
* @param data Specify when to cancel the subscription
|
||||
*/
|
||||
cancelSubscription(customerId: string, subscriptionId: string, data: customerSubscriptions.ISubscriptionCancellationOptions, options: HeaderOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
cancelSubscription(customerId: string, subscriptionId: string, data: customerSubscriptions.ISubscriptionCancellationOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
cancelSubscription(customerId: string, subscriptionId: string, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
cancelSubscription(customerId: string, subscriptionId: string, data: subscriptions.ISubscriptionCancellationOptions, options: HeaderOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
cancelSubscription(customerId: string, subscriptionId: string, data: subscriptions.ISubscriptionCancellationOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
cancelSubscription(customerId: string, subscriptionId: string, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
|
||||
/**
|
||||
* You can see a list of the customer's active subscriptions. Note that the 10 most recent active subscriptions are always available
|
||||
@@ -5380,10 +5400,10 @@ declare namespace StripeNode {
|
||||
* @param customerId The ID of the customer whose subscriptions will be retrieved
|
||||
* @param data Filtering options
|
||||
*/
|
||||
listSubscriptions(customerId: string, data: IListOptions, options: HeaderOptions, response?: IResponseFn<IList<customerSubscriptions.ISubscription>>): Promise<IList<customerSubscriptions.ISubscription>>;
|
||||
listSubscriptions(customerId: string, data: IListOptions, response?: IResponseFn<IList<customerSubscriptions.ISubscription>>): Promise<IList<customerSubscriptions.ISubscription>>;
|
||||
listSubscriptions(customerId: string, options: HeaderOptions, response?: IResponseFn<IList<customerSubscriptions.ISubscription>>): Promise<IList<customerSubscriptions.ISubscription>>;
|
||||
listSubscriptions(customerId: string, response?: IResponseFn<IList<customerSubscriptions.ISubscription>>): Promise<IList<customerSubscriptions.ISubscription>>;
|
||||
listSubscriptions(customerId: string, data: IListOptions, options: HeaderOptions, response?: IResponseFn<IList<subscriptions.ISubscription>>): Promise<IList<subscriptions.ISubscription>>;
|
||||
listSubscriptions(customerId: string, data: IListOptions, response?: IResponseFn<IList<subscriptions.ISubscription>>): Promise<IList<subscriptions.ISubscription>>;
|
||||
listSubscriptions(customerId: string, options: HeaderOptions, response?: IResponseFn<IList<subscriptions.ISubscription>>): Promise<IList<subscriptions.ISubscription>>;
|
||||
listSubscriptions(customerId: string, response?: IResponseFn<IList<subscriptions.ISubscription>>): Promise<IList<subscriptions.ISubscription>>;
|
||||
|
||||
|
||||
/**
|
||||
@@ -5410,19 +5430,7 @@ declare namespace StripeNode {
|
||||
deleteSubscriptionDiscount(customerId: string, subscriptionId: string, response?: IResponseFn<IDeleteConfirmation>): Promise<IDeleteConfirmation>;;
|
||||
}
|
||||
|
||||
class CustomerSubscriptions extends StripeResource {
|
||||
/**
|
||||
* Creates a new subscription on an existing customer.
|
||||
*
|
||||
* @returns The newly created subscription object if the call succeeded. If the customer has no card or the
|
||||
* attempted charge fails, this call throws an error (unless the specified plan is free or has a trial
|
||||
* period).
|
||||
*
|
||||
* @param options The options for the new subscription
|
||||
*/
|
||||
create(data: customerSubscriptions.ISubscriptionCreationOptions, options: HeaderOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
create(data: customerSubscriptions.ISubscriptionCreationOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
|
||||
class SubscriptionsBase extends StripeResource {
|
||||
/**
|
||||
* By default, you can see the 10 most recent active subscriptions stored on a customer directly on the customer
|
||||
* object, but you can also retrieve details about a specific active subscription for a customer.
|
||||
@@ -5431,8 +5439,8 @@ declare namespace StripeNode {
|
||||
*
|
||||
* @param subscriptionId The ID of the subscription to retrieve
|
||||
*/
|
||||
retrieve(subscriptionId: string, options: HeaderOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
retrieve(subscriptionId: string, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
retrieve(subscriptionId: string, options: HeaderOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
retrieve(subscriptionId: string, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
|
||||
/**
|
||||
* Updates an existing subscription on a customer to match the specified parameters. When changing plans or quantities,
|
||||
@@ -5458,8 +5466,8 @@ declare namespace StripeNode {
|
||||
* @param subscriptionId The ID of the subscription to update.
|
||||
* @param data The fields to update
|
||||
*/
|
||||
update(subscriptionId: string, data: customerSubscriptions.ISubscriptionUpdateOptions, options: HeaderOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
update(subscriptionId: string, data: customerSubscriptions.ISubscriptionUpdateOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
update(subscriptionId: string, data: subscriptions.ISubscriptionUpdateOptions, options: HeaderOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
update(subscriptionId: string, data: subscriptions.ISubscriptionUpdateOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
|
||||
/**
|
||||
* Cancels a customer's subscription. If you set the at_period_end parameter to true, the subscription will remain active until
|
||||
@@ -5479,10 +5487,10 @@ declare namespace StripeNode {
|
||||
* @param subscriptionId The ID of the subscription to cancel.
|
||||
* @param data Specify when to cancel the subscription
|
||||
*/
|
||||
del(subscriptionId: string, data: customerSubscriptions.ISubscriptionCancellationOptions, options: HeaderOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
del(subscriptionId: string, data: customerSubscriptions.ISubscriptionCancellationOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
del(subscriptionId: string, options: HeaderOptions, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
del(subscriptionId: string, response?: IResponseFn<customerSubscriptions.ISubscription>): Promise<customerSubscriptions.ISubscription>;
|
||||
del(subscriptionId: string, data: subscriptions.ISubscriptionCancellationOptions, options: HeaderOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
del(subscriptionId: string, data: subscriptions.ISubscriptionCancellationOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
del(subscriptionId: string, options: HeaderOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
del(subscriptionId: string, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
|
||||
/**
|
||||
* You can see a list of the customer's active subscriptions. Note that the 10 most recent active subscriptions are always available
|
||||
@@ -5494,10 +5502,10 @@ declare namespace StripeNode {
|
||||
*
|
||||
* @param data Filtering options
|
||||
*/
|
||||
list(data: IListOptions, options: HeaderOptions, response?: IResponseFn<IList<customerSubscriptions.ISubscription>>): Promise<IList<customerSubscriptions.ISubscription>>;
|
||||
list(data: IListOptions, response?: IResponseFn<IList<customerSubscriptions.ISubscription>>): Promise<IList<customerSubscriptions.ISubscription>>;
|
||||
list(options: HeaderOptions, response?: IResponseFn<IList<customerSubscriptions.ISubscription>>): Promise<IList<customerSubscriptions.ISubscription>>;
|
||||
list(response?: IResponseFn<IList<customerSubscriptions.ISubscription>>): Promise<IList<customerSubscriptions.ISubscription>>;
|
||||
list(data: subscriptions.ISubscriptionListOptions, options: HeaderOptions, response?: IResponseFn<IList<subscriptions.ISubscription>>): Promise<IList<subscriptions.ISubscription>>;
|
||||
list(data: subscriptions.ISubscriptionListOptions, response?: IResponseFn<IList<subscriptions.ISubscription>>): Promise<IList<subscriptions.ISubscription>>;
|
||||
list(options: HeaderOptions, response?: IResponseFn<IList<subscriptions.ISubscription>>): Promise<IList<subscriptions.ISubscription>>;
|
||||
list(response?: IResponseFn<IList<subscriptions.ISubscription>>): Promise<IList<subscriptions.ISubscription>>;
|
||||
|
||||
/**
|
||||
* Removes the currently applied discount on a subscription.
|
||||
@@ -5511,6 +5519,33 @@ declare namespace StripeNode {
|
||||
deleteDiscount(subscriptionId: string, response?: IResponseFn<IDeleteConfirmation>): Promise<IDeleteConfirmation>;;
|
||||
}
|
||||
|
||||
class Subscriptions extends SubscriptionsBase {
|
||||
/**
|
||||
* Creates a new subscription on an existing customer.
|
||||
*
|
||||
* @returns The newly created subscription object if the call succeeded. If the customer has no card or the
|
||||
* attempted charge fails, this call throws an error (unless the specified plan is free or has a trial
|
||||
* period).
|
||||
*
|
||||
* @param options The options for the new subscription
|
||||
*/
|
||||
create(data: subscriptions.ISubscriptionCreationOptions, options: HeaderOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
create(data: subscriptions.ISubscriptionCreationOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
}
|
||||
class CustomerSubscriptions extends SubscriptionsBase {
|
||||
/**
|
||||
* Creates a new subscription on an existing customer.
|
||||
*
|
||||
* @returns The newly created subscription object if the call succeeded. If the customer has no card or the
|
||||
* attempted charge fails, this call throws an error (unless the specified plan is free or has a trial
|
||||
* period).
|
||||
*
|
||||
* @param options The options for the new subscription
|
||||
*/
|
||||
create(data: subscriptions.ISubscriptionCustCreationOptions, options: HeaderOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
create(data: subscriptions.ISubscriptionCustCreationOptions, response?: IResponseFn<subscriptions.ISubscription>): Promise<subscriptions.ISubscription>;
|
||||
}
|
||||
|
||||
class Disputes extends StripeResource {
|
||||
/**
|
||||
* Retrieves the dispute with the given ID.
|
||||
|
||||
Reference in New Issue
Block a user