mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-16 23:10:29 +00:00
Added definitions for chartmogul-node package
* Added definitions for chartmogul-node [ch3038] * Added arpa [ch3038] * Added error definitions [ch3038]
This commit is contained in:
@@ -0,0 +1,277 @@
|
||||
import * as ChartMogul from 'chartmogul-node';
|
||||
|
||||
const config = new ChartMogul.Config("token", "secret", "baseURL");
|
||||
config.retries = 10;
|
||||
config.getAccountToken(); // $ExpectType string
|
||||
config.getSecretKey(); // $ExpectType string
|
||||
config.VERSION; // $ExpectType string
|
||||
|
||||
ChartMogul.Ping.ping(config); // $ExpectType Promise<string>
|
||||
|
||||
// $ExpectType Promise<DataSource>
|
||||
ChartMogul.DataSource.create(config, {
|
||||
name: ""
|
||||
});
|
||||
|
||||
// $ExpectType Promise<DataSource>
|
||||
ChartMogul.DataSource.retrieve(config, "");
|
||||
|
||||
// $ExpectType Promise<{}>
|
||||
ChartMogul.DataSource.destroy(config, "");
|
||||
|
||||
// $ExpectType Promise<DataSources>
|
||||
ChartMogul.DataSource.all(config, {
|
||||
name: ""
|
||||
});
|
||||
|
||||
ChartMogul.DataSource.all(config).then(data => {
|
||||
data.data_sources[0]; // $ExpectType DataSource
|
||||
data.data_sources[0].name; // $ExpectType string
|
||||
});
|
||||
|
||||
// $ExpectType Promise<Customer>
|
||||
ChartMogul.Customer.create(config, {
|
||||
data_source_uuid: "",
|
||||
name: "",
|
||||
external_id: "",
|
||||
attributes: {
|
||||
tags: ["important", "Prio1"],
|
||||
custom: [
|
||||
{type: "String", key: "channel", value: "Facebook", source: "integration"},
|
||||
{type: "Integer", key: "age", value: 18}
|
||||
]
|
||||
}
|
||||
});
|
||||
|
||||
// $ExpectType Promise<Customer>
|
||||
ChartMogul.Customer.retrieve(config, "");
|
||||
|
||||
// $ExpectType Promise<Customer>
|
||||
ChartMogul.Customer.modify(config, "", {});
|
||||
|
||||
// $ExpectType Promise<{}>
|
||||
ChartMogul.Customer.destroy(config, "");
|
||||
|
||||
// $ExpectType Promise<Entries<Customer>>
|
||||
ChartMogul.Customer.all(config, {
|
||||
data_source_uuid: ""
|
||||
});
|
||||
|
||||
ChartMogul.Customer.all(config).then(data => {
|
||||
data.entries[0]; // $ExpectType Customer
|
||||
data.entries[0].attributes!.stripe!['something']; // $ExpectType any
|
||||
data.page!; // $ExpectType number
|
||||
});
|
||||
|
||||
// $ExpectType Promise<Entries<Customer>>
|
||||
ChartMogul.Customer.search(config, {
|
||||
email: ""
|
||||
});
|
||||
// $ExpectType Promise<{}>
|
||||
ChartMogul.Customer.merge(config, {
|
||||
from: {customer_uuid: ""},
|
||||
into: {customer_uuid: ""}
|
||||
});
|
||||
// $ExpectType Promise<Attributes>
|
||||
ChartMogul.Customer.attributes(config, "");
|
||||
|
||||
// $ExpectType Promise<Plan>
|
||||
ChartMogul.Plan.create(config, {
|
||||
data_source_uuid: "",
|
||||
name: "",
|
||||
interval_count: 1,
|
||||
interval_unit: "",
|
||||
external_id: ""
|
||||
});
|
||||
|
||||
// $ExpectType Promise<Plan>
|
||||
ChartMogul.Plan.retrieve(config, "");
|
||||
|
||||
// $ExpectType Promise<Plan>
|
||||
ChartMogul.Plan.modify(config, "", {
|
||||
name: ""
|
||||
});
|
||||
|
||||
// $ExpectType Promise<{}>
|
||||
ChartMogul.Plan.destroy(config, "");
|
||||
|
||||
ChartMogul.Plan.all(config, {
|
||||
page: 1
|
||||
}).then(data => {
|
||||
data.plans[0]; // $ExpectType Plan
|
||||
data.plans[0].name!; // $ExpectType string
|
||||
data.page!; // $ExpectType number
|
||||
});
|
||||
|
||||
// $ExpectType Promise<Invoice>
|
||||
ChartMogul.Invoice.retrieve(config, "");
|
||||
|
||||
// $ExpectType Promise<Invoice>
|
||||
ChartMogul.Invoice.create(config, "", {
|
||||
invoices: [
|
||||
{
|
||||
external_id: ""
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
// $ExpectType Promise<{}>
|
||||
ChartMogul.Invoice.destroy(config, "");
|
||||
ChartMogul.Invoice.all(config, {
|
||||
external_id: ""
|
||||
}).then(data => {
|
||||
data.invoices[0]; // $ExpectType Invoice
|
||||
data.invoices[0].uuid!; // $ExpectType string
|
||||
data.page!; // $ExpectType number
|
||||
});
|
||||
|
||||
ChartMogul.Invoice.all(config, "", {
|
||||
page: 1
|
||||
}).then(data => {
|
||||
data.customer_uuid!; // $ExpectType string
|
||||
data.invoices[0]; // $ExpectType Invoice
|
||||
data.invoices[0].uuid!; // $ExpectType string
|
||||
data.page!; // $ExpectType number
|
||||
});
|
||||
|
||||
// $ExpectType Promise<Transaction>
|
||||
ChartMogul.Transaction.create(config, "", {
|
||||
type: "",
|
||||
date: "",
|
||||
result: ""
|
||||
});
|
||||
|
||||
ChartMogul.Subscription.all(config, "", {
|
||||
page: 1
|
||||
}).then(data => {
|
||||
data.customer_uuid!; // $ExpectType string
|
||||
data.subscriptions[0]; // $ExpectType Subscription
|
||||
data.subscriptions[0].uuid; // $ExpectType string
|
||||
data.current_page!; // $ExpectType number
|
||||
});
|
||||
|
||||
ChartMogul.Subscription.cancel(config, "", {
|
||||
cancelled_at: ""
|
||||
}).then(data => {
|
||||
data.customer_uuid; // $ExpectType string
|
||||
});
|
||||
|
||||
// $ExpectType Promise<Entries<Customer>>
|
||||
ChartMogul.Tag.add(config, "", {
|
||||
email: "",
|
||||
tags: [""]
|
||||
});
|
||||
|
||||
// $ExpectType Promise<Tags>
|
||||
ChartMogul.Tag.add(config, "", {
|
||||
tags: [""]
|
||||
});
|
||||
|
||||
// $ExpectType Promise<Tags>
|
||||
ChartMogul.Tag.remove(config, "", {
|
||||
tags: [""]
|
||||
});
|
||||
|
||||
// $ExpectType Promise<CustomAttributes>
|
||||
ChartMogul.CustomAttribute.add(config, "", {
|
||||
custom: [
|
||||
{type: "", key: "", value: 0}
|
||||
]
|
||||
});
|
||||
// $ExpectType Promise<Entries<Customer>>
|
||||
ChartMogul.CustomAttribute.add(config, "", {
|
||||
email: "",
|
||||
custom: [
|
||||
{type: "", key: "", value: 0}
|
||||
]
|
||||
});
|
||||
|
||||
// $ExpectType Promise<CustomAttributes>
|
||||
ChartMogul.CustomAttribute.update(config, "", {
|
||||
custom: {
|
||||
pro: true,
|
||||
channel: ""
|
||||
}
|
||||
});
|
||||
|
||||
ChartMogul.CustomAttribute.remove(config, "", {
|
||||
custom: [""]
|
||||
}).then(data => {
|
||||
data.custom["key"]; // $ExpectType any
|
||||
});
|
||||
|
||||
// $ExpectType Promise<All>
|
||||
ChartMogul.Metrics.all(config, {
|
||||
'start-date': '2015-01-01',
|
||||
'end-date': '2015-11-24',
|
||||
interval: '',
|
||||
geo: '',
|
||||
plans: ''
|
||||
});
|
||||
|
||||
// $ExpectType Promise<EntriesSummary<MRR>>
|
||||
ChartMogul.Metrics.mrr(config, {
|
||||
'start-date': '2015-01-01',
|
||||
'end-date': '2015-11-01'
|
||||
});
|
||||
|
||||
// $ExpectType Promise<EntriesSummary<ARR>>
|
||||
ChartMogul.Metrics.arr(config, {
|
||||
'start-date': '2015-01-01',
|
||||
'end-date': '2015-11-01'
|
||||
});
|
||||
|
||||
// $ExpectType Promise<EntriesSummary<ARPA>>
|
||||
ChartMogul.Metrics.arpa(config, {
|
||||
'start-date': '2015-01-01',
|
||||
'end-date': '2015-11-01'
|
||||
});
|
||||
|
||||
// $ExpectType Promise<EntriesSummary<ASP>>
|
||||
ChartMogul.Metrics.asp(config, {
|
||||
'start-date': '2015-01-01',
|
||||
'end-date': '2015-11-01'
|
||||
});
|
||||
|
||||
// $ExpectType Promise<EntriesSummary<CustomerCount>>
|
||||
ChartMogul.Metrics.customerCount(config, {
|
||||
'start-date': '2015-01-01',
|
||||
'end-date': '2015-11-01'
|
||||
});
|
||||
|
||||
// $ExpectType Promise<EntriesSummary<CustomerChurnRate>>
|
||||
ChartMogul.Metrics.customerChurnRate(config, {
|
||||
'start-date': '2015-01-01',
|
||||
'end-date': '2015-11-01',
|
||||
geo: '',
|
||||
plans: ''
|
||||
});
|
||||
|
||||
// $ExpectType Promise<EntriesSummary<MRRChurnRate>>
|
||||
ChartMogul.Metrics.mrrChurnRate(config, {
|
||||
'start-date': '2015-01-01',
|
||||
'end-date': '2015-11-01'
|
||||
});
|
||||
|
||||
ChartMogul.Metrics.ltv(config, {
|
||||
'start-date': '2015-01-01',
|
||||
'end-date': '2015-11-01'
|
||||
}).then(data => {
|
||||
data.entries[0].ltv; // $ExpectType number
|
||||
data.summary; // $ExpectType Summary
|
||||
data.summary.current; // $ExpectType number
|
||||
});
|
||||
|
||||
// $ExpectType Promise<Entries<MetricsSubscription>>
|
||||
ChartMogul.Metrics.Customer.subscriptions(config, "", {
|
||||
page: 1
|
||||
});
|
||||
|
||||
ChartMogul.Metrics.Customer.activities(config, "", {
|
||||
page: 1
|
||||
}).then(data => {
|
||||
data.entries; // $ExpectType MetricsActivity[]
|
||||
data.entries[0]; // $ExpectType MetricsActivity
|
||||
data.entries[0]['activity-mrr']; // $ExpectType number
|
||||
data.page!; // $ExpectType number
|
||||
});
|
||||
Vendored
+28
@@ -0,0 +1,28 @@
|
||||
export interface Map {
|
||||
[key: string]: any
|
||||
}
|
||||
export interface CursorParams {
|
||||
page?: number;
|
||||
per_page?: number;
|
||||
}
|
||||
export type Strings = string[];
|
||||
|
||||
export interface Cursor {
|
||||
page?: number;
|
||||
per_page?: number;
|
||||
has_more?: boolean;
|
||||
current_page?: number;
|
||||
total_pages?: number;
|
||||
}
|
||||
export interface Entries<T> extends Cursor {
|
||||
entries: T[]
|
||||
}
|
||||
interface Summary {
|
||||
current: number;
|
||||
previous: number;
|
||||
['percentage-change']: number;
|
||||
}
|
||||
export interface EntriesSummary<T> {
|
||||
entries: T[];
|
||||
summary: Summary;
|
||||
}
|
||||
Vendored
+410
@@ -0,0 +1,410 @@
|
||||
// Type definitions for chartmogul-node 1.0
|
||||
// Project: https://github.com/chartmogul/chartmogul-node
|
||||
// Definitions by: ChartMogul <https://github.com/chartmogul>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Map, Cursor, CursorParams, Strings, Entries, EntriesSummary } from './common';
|
||||
|
||||
export class Config {
|
||||
VERSION: string;
|
||||
API_BASE: string;
|
||||
retries: number;
|
||||
|
||||
constructor(token: string, secret: string, base?: string);
|
||||
getAccountToken(): string;
|
||||
getSecretKey(): string;
|
||||
}
|
||||
|
||||
export namespace Ping {
|
||||
function ping(config: Config): Promise<string>;
|
||||
}
|
||||
|
||||
export namespace DataSource {
|
||||
interface DataSource {
|
||||
uuid?: string;
|
||||
name: string;
|
||||
created_at?: string;
|
||||
status?: string;
|
||||
system?: string;
|
||||
}
|
||||
interface DataSources {
|
||||
data_sources: DataSource[];
|
||||
}
|
||||
interface ListDataSourcesParams {
|
||||
name?: string;
|
||||
system?: string;
|
||||
}
|
||||
|
||||
function create(config: Config, data: DataSource): Promise<DataSource>;
|
||||
function retrieve(config: Config, uuid: string): Promise<DataSource>;
|
||||
function destroy(config: Config, uuid: string): Promise<{}>;
|
||||
function all(config: Config, params?: ListDataSourcesParams): Promise<DataSources>;
|
||||
}
|
||||
|
||||
export namespace Customer {
|
||||
interface Customer {
|
||||
id?: number;
|
||||
data_source_uuid?: string;
|
||||
data_source_uuids?: Strings;
|
||||
uuid?: string;
|
||||
external_id?: string;
|
||||
external_ids?: Strings;
|
||||
name?: string;
|
||||
email?: string;
|
||||
status?: string;
|
||||
['customer-since']?: string;
|
||||
attributes?: Attributes;
|
||||
address?: {
|
||||
address_zip?: string;
|
||||
city?: string;
|
||||
state?: string;
|
||||
country?: string;
|
||||
};
|
||||
mrr?: number;
|
||||
arr?: number;
|
||||
['billing-system-url']?: string;
|
||||
['chartmogul-url']?: string;
|
||||
['billing-system-type']?: string;
|
||||
currency?: string;
|
||||
['currency-sign']?: string;
|
||||
company?: string;
|
||||
country?: string;
|
||||
state?: string;
|
||||
city?: string;
|
||||
zip?: string;
|
||||
lead_created_at?: string;
|
||||
free_trial_started_at?: string;
|
||||
}
|
||||
interface NewCustomer {
|
||||
data_source_uuid: string;
|
||||
external_id: string;
|
||||
name: string;
|
||||
email?: string;
|
||||
company?: string;
|
||||
country?: string;
|
||||
state?: string;
|
||||
city?: string;
|
||||
zip?: string;
|
||||
lead_created_at?: string;
|
||||
free_trial_started_at?: string;
|
||||
attributes?: NewAttributes;
|
||||
}
|
||||
interface UpdateCustomer {
|
||||
name?: string;
|
||||
email?: string;
|
||||
company?: string;
|
||||
country?: string;
|
||||
state?: string;
|
||||
city?: string;
|
||||
zip?: string;
|
||||
lead_created_at?: string;
|
||||
free_trial_started_at?: string;
|
||||
attributes?: NewAttributes;
|
||||
}
|
||||
interface NewAttributes {
|
||||
tags?: Strings;
|
||||
custom?: NewCustomAttributes[];
|
||||
}
|
||||
interface NewCustomAttributes {
|
||||
type?: string;
|
||||
key: string;
|
||||
value: any;
|
||||
source?: string;
|
||||
}
|
||||
interface Attributes {
|
||||
tags?: Strings;
|
||||
stripe?: Map;
|
||||
clearbit?: Map;
|
||||
custom?: Map;
|
||||
}
|
||||
interface ListCustomersParams extends CursorParams {
|
||||
data_source_uuid?: string;
|
||||
status?: string;
|
||||
system?: string;
|
||||
external_id?: string;
|
||||
}
|
||||
interface SearchCustomersParams extends CursorParams {
|
||||
email: string;
|
||||
}
|
||||
interface MergeID {
|
||||
customer_uuid?: string;
|
||||
external_id?: string;
|
||||
}
|
||||
interface MergeCustomersParams {
|
||||
from: MergeID;
|
||||
into: MergeID;
|
||||
}
|
||||
|
||||
function create(config: Config, data: NewCustomer): Promise<Customer>;
|
||||
function retrieve(config: Config, uuid: string): Promise<Customer>;
|
||||
function modify(config: Config, uuid: string, data: UpdateCustomer): Promise<Customer>;
|
||||
function destroy(config: Config, uuid: string): Promise<{}>;
|
||||
function all(config: Config, params?: ListCustomersParams): Promise<Entries<Customer>>;
|
||||
function search(config: Config, params?: SearchCustomersParams): Promise<Entries<Customer>>;
|
||||
function merge(config: Config, params?: MergeCustomersParams): Promise<{}>;
|
||||
function attributes(config: Config, uuid: string): Promise<Attributes>;
|
||||
}
|
||||
|
||||
export namespace Plan {
|
||||
interface Plan {
|
||||
uuid?: string;
|
||||
data_source_uuid?: string;
|
||||
external_id?: string;
|
||||
name?: string;
|
||||
interval_count?: number;
|
||||
interval_unit?: string;
|
||||
}
|
||||
interface ListPlansParams extends CursorParams {
|
||||
data_source_uuid?: string;
|
||||
system?: string;
|
||||
external_id?: string;
|
||||
}
|
||||
interface Plans extends Cursor {
|
||||
plans: Plan[];
|
||||
}
|
||||
|
||||
function create(config: Config, data: Plan): Promise<Plan>;
|
||||
function retrieve(config: Config, uuid: string): Promise<Plan>;
|
||||
function modify(config: Config, uuid: string, data: Plan): Promise<Plan>;
|
||||
function destroy(config: Config, uuid: string): Promise<{}>;
|
||||
function all(config: Config, params?: ListPlansParams): Promise<Plans>;
|
||||
}
|
||||
|
||||
export namespace Invoice {
|
||||
interface Invoice {
|
||||
uuid?: string;
|
||||
customer_uuid?: string;
|
||||
currency?: string;
|
||||
data_source_uuid?: string;
|
||||
date?: string;
|
||||
due_date?: string;
|
||||
external_id?: string;
|
||||
line_items?: LineItem[];
|
||||
transactions?: Transaction[];
|
||||
}
|
||||
interface LineItem {
|
||||
uuid?: string;
|
||||
account_code?: string;
|
||||
amount_in_cents?: number;
|
||||
cancelled_at?: string;
|
||||
description?: string;
|
||||
discount_amount_in_cents?: number;
|
||||
discount_code?: string;
|
||||
external_id?: string;
|
||||
plan_uuid?: string;
|
||||
prorated?: boolean;
|
||||
quantity?: number;
|
||||
service_period_end?: string;
|
||||
service_period_start?: string;
|
||||
subscription_external_id?: string;
|
||||
subscription_uuid?: string;
|
||||
tax_amount_in_cents?: number;
|
||||
transaction_fees_in_cents?: number;
|
||||
type?: string;
|
||||
}
|
||||
interface Transaction {
|
||||
uuid?: string;
|
||||
date?: string;
|
||||
external_id?: string;
|
||||
result?: string;
|
||||
type?: string;
|
||||
}
|
||||
interface ListInvoicesParams extends CursorParams {
|
||||
data_source_uuid?: string;
|
||||
customer_uuid?: string;
|
||||
external_id?: string;
|
||||
}
|
||||
interface Invoices extends Cursor {
|
||||
customer_uuid?: string;
|
||||
invoices: Invoice[];
|
||||
}
|
||||
|
||||
function create(config: Config, uuid: string, data: {
|
||||
invoices: Invoice[]
|
||||
}): Promise<Invoice>;
|
||||
function retrieve(config: Config, uuid: string): Promise<Invoice>;
|
||||
function destroy(config: Config, uuid: string): Promise<{}>;
|
||||
function all(config: Config, uuid: string, params?: ListInvoicesParams): Promise<Invoices>;
|
||||
function all(config: Config, params?: ListInvoicesParams): Promise<Invoices>;
|
||||
}
|
||||
|
||||
export namespace Transaction {
|
||||
interface Transaction {
|
||||
uuid?: string;
|
||||
date: string;
|
||||
external_id?: string;
|
||||
result: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
function create(config: Config, uuid: string, data: Transaction): Promise<Transaction>;
|
||||
}
|
||||
|
||||
export namespace Subscription {
|
||||
interface Subscription {
|
||||
uuid: string;
|
||||
external_id: string;
|
||||
customer_uuid: string;
|
||||
plan_uuid: string;
|
||||
cancellation_dates: Strings;
|
||||
data_source_uuid: string;
|
||||
}
|
||||
interface CancelSubscriptionParams {
|
||||
cancelled_at?: string;
|
||||
cancellation_dates?: Strings;
|
||||
}
|
||||
interface Subscriptions extends Cursor {
|
||||
customer_uuid?: string;
|
||||
subscriptions: Subscription[];
|
||||
}
|
||||
|
||||
function all(config: Config, uuid: string, data: CursorParams): Promise<Subscriptions>;
|
||||
function cancel(config: Config, uuid: string, data: CancelSubscriptionParams): Promise<Subscription>;
|
||||
}
|
||||
|
||||
export namespace Tag {
|
||||
interface Tags {
|
||||
tags: Strings;
|
||||
}
|
||||
interface TagsWithEmail {
|
||||
email: string;
|
||||
tags: Strings;
|
||||
}
|
||||
function add(config: Config, uuid: string, data: TagsWithEmail): Promise<Entries<Customer.Customer>>;
|
||||
function add(config: Config, uuid: string, data: Tags): Promise<Tags>;
|
||||
function remove(config: Config, uuid: string, data: Tags): Promise<Tags>;
|
||||
}
|
||||
|
||||
export namespace CustomAttribute {
|
||||
import NewCustomAttributes = Customer.NewCustomAttributes;
|
||||
|
||||
interface CustomAttributes {
|
||||
custom: Map;
|
||||
}
|
||||
function add(config: Config, uuid: string, data: {
|
||||
email: string;
|
||||
custom: NewCustomAttributes[];
|
||||
}): Promise<Entries<Customer.Customer>>;
|
||||
function add(config: Config, uuid: string, data: {
|
||||
custom: NewCustomAttributes[];
|
||||
}): Promise<CustomAttributes>;
|
||||
function update(config: Config, uuid: string, data: CustomAttributes): Promise<CustomAttributes>;
|
||||
function remove(config: Config, uuid: string, data: {
|
||||
custom: Strings;
|
||||
}): Promise<CustomAttributes>;
|
||||
}
|
||||
|
||||
export namespace Metrics {
|
||||
interface Params extends ParamsNoInterval {
|
||||
interval?: string;
|
||||
}
|
||||
interface ParamsNoInterval {
|
||||
['start-date']: string;
|
||||
['end-date']: string;
|
||||
geo?: string;
|
||||
plans?: string;
|
||||
}
|
||||
interface All {
|
||||
entries: {
|
||||
date: string;
|
||||
['customer-churn-rate']: number;
|
||||
['mrr-churn-rate']: number;
|
||||
ltv: number;
|
||||
customers: number;
|
||||
asp: number;
|
||||
arpa: number;
|
||||
arr: number;
|
||||
mrr: number;
|
||||
};
|
||||
}
|
||||
|
||||
interface MRR {
|
||||
date: string;
|
||||
mrr: number;
|
||||
['mrr-new-business']: number;
|
||||
['mrr-expansion']: number;
|
||||
['mrr-contraction']: number;
|
||||
['mrr-churn']: number;
|
||||
['mrr-reactivation']: number;
|
||||
}
|
||||
interface ARR {
|
||||
date: string;
|
||||
arr: number;
|
||||
}
|
||||
interface ARPA {
|
||||
date: string;
|
||||
arpa: number;
|
||||
}
|
||||
interface ASP {
|
||||
date: string;
|
||||
asp: number;
|
||||
}
|
||||
interface CustomerCount {
|
||||
date: string;
|
||||
customers: number;
|
||||
}
|
||||
interface CustomerChurnRate {
|
||||
date: string;
|
||||
['customer-churn-rate']: number;
|
||||
}
|
||||
interface MRRChurnRate {
|
||||
date: string;
|
||||
['mrr-churn-rate']: number;
|
||||
}
|
||||
interface LTV {
|
||||
date: string;
|
||||
ltv: number;
|
||||
}
|
||||
|
||||
function all(config: Config, params: Params): Promise<All>;
|
||||
function mrr(config: Config, params: Params): Promise<EntriesSummary<MRR>>;
|
||||
function arr(config: Config, params: Params): Promise<EntriesSummary<ARR>>;
|
||||
function asp(config: Config, params: Params): Promise<EntriesSummary<ASP>>;
|
||||
function arpa(config: Config, params: Params): Promise<EntriesSummary<ARPA>>;
|
||||
function customerCount(config: Config, params: Params): Promise<EntriesSummary<CustomerCount>>;
|
||||
function customerChurnRate(config: Config, params: ParamsNoInterval): Promise<EntriesSummary<CustomerChurnRate>>;
|
||||
function mrrChurnRate(config: Config, params: ParamsNoInterval): Promise<EntriesSummary<MRRChurnRate>>;
|
||||
function ltv(config: Config, params: ParamsNoInterval): Promise<EntriesSummary<LTV>>;
|
||||
|
||||
namespace Customer {
|
||||
interface MetricsSubscription {
|
||||
id: number;
|
||||
external_id: string;
|
||||
plan: string;
|
||||
quantity: number;
|
||||
mrr: number;
|
||||
arr: number;
|
||||
status: string;
|
||||
['billing-cycle']: string;
|
||||
['billing-cycle-count']: number;
|
||||
['start-date']: string;
|
||||
['end-date']: string;
|
||||
currency: string;
|
||||
['currency-sign']: string;
|
||||
}
|
||||
interface MetricsActivity {
|
||||
id: number;
|
||||
date: string;
|
||||
['activity-arr']: number;
|
||||
['activity-mrr']: number;
|
||||
['activity-mrr-movement']: number;
|
||||
currency: string;
|
||||
['currency-sign']: string;
|
||||
description: string;
|
||||
type: string;
|
||||
}
|
||||
|
||||
function subscriptions(config: Config, uuid: string, params?: CursorParams): Promise<Entries<MetricsSubscription>>;
|
||||
function activities(config: Config, uuid: string, params?: CursorParams): Promise<Entries<MetricsActivity>>;
|
||||
}
|
||||
}
|
||||
|
||||
export class ChartMogulError extends Error {
|
||||
response: any;
|
||||
httpStatus: number;
|
||||
}
|
||||
export class ConfigurationError extends ChartMogulError {}
|
||||
export class ForbiddenError extends ChartMogulError {}
|
||||
export class NotFoundError extends ChartMogulError {}
|
||||
export class ResourceInvalidError extends ChartMogulError {}
|
||||
export class SchemaInvalidError extends ChartMogulError {}
|
||||
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "commonjs",
|
||||
"lib": [
|
||||
"es6"
|
||||
],
|
||||
"noImplicitAny": true,
|
||||
"noImplicitThis": true,
|
||||
"strictNullChecks": true,
|
||||
"strictFunctionTypes": true,
|
||||
"baseUrl": "../",
|
||||
"typeRoots": [
|
||||
"../"
|
||||
],
|
||||
"types": [],
|
||||
"noEmit": true,
|
||||
"forceConsistentCasingInFileNames": true
|
||||
},
|
||||
"files": [
|
||||
"index.d.ts",
|
||||
"chartmogul-node-tests.ts"
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1 @@
|
||||
{ "extends": "dtslint/dt.json" }
|
||||
Reference in New Issue
Block a user