@types/chartmogul-node 3.9.0 → 3.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
chartmogul-node/README.md CHANGED
@@ -8,7 +8,7 @@ This package contains type definitions for chartmogul-node (https://github.com/c
8
8
  Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chartmogul-node.
9
9
 
10
10
  ### Additional Details
11
- * Last updated: Wed, 07 Jan 2026 11:02:02 GMT
11
+ * Last updated: Wed, 14 Jan 2026 13:15:13 GMT
12
12
  * Dependencies: none
13
13
 
14
14
  # Credits
@@ -2,17 +2,19 @@ export interface Map {
2
2
  [key: string]: any;
3
3
  }
4
4
  export interface CursorParams {
5
- page?: number | undefined;
6
- per_page?: number | undefined;
5
+ page?: number;
6
+ per_page?: number;
7
+ cursor?: string;
7
8
  }
8
9
  export type Strings = string[];
9
10
 
10
11
  export interface Cursor {
11
- page?: number | undefined;
12
- per_page?: number | undefined;
13
- has_more?: boolean | undefined;
14
- current_page?: number | undefined;
15
- total_pages?: number | undefined;
12
+ page?: number;
13
+ per_page?: number;
14
+ cursor?: string;
15
+ has_more?: boolean;
16
+ current_page?: number;
17
+ total_pages?: number;
16
18
  }
17
19
  export interface Entries<T> extends Cursor {
18
20
  entries: T[];
@@ -1,5 +1,9 @@
1
1
  import { Cursor, CursorParams, Entries, EntriesSummary, Map, Strings } from "./common";
2
2
 
3
+ export interface ResourceDestroyed {
4
+ message: string;
5
+ }
6
+
3
7
  export class Config {
4
8
  VERSION: string;
5
9
  API_BASE: string;
@@ -13,14 +17,60 @@ export namespace Ping {
13
17
  function ping(config: Config): Promise<string>;
14
18
  }
15
19
 
20
+ export namespace Account {
21
+ type WeekStartOn = "monday" | "sunday";
22
+ type ChurnRecognition =
23
+ | "churn_at_time_of_cancelation"
24
+ | "churn_at_period_end"
25
+ | "churn_at_click";
26
+ type RefundHandling = "refund_ignore" | "refund_full_only";
27
+ type ProximateMovementReclassification =
28
+ | "reclassification_off"
29
+ | "one_minute_reclassification"
30
+ | "ten_minutes_reclassification"
31
+ | "one_hour_reclassification"
32
+ | "one_day_reclassification"
33
+ | "one_week_reclassification"
34
+ | "thirty_days_reclassification"
35
+ | "sixty_days_reclassification"
36
+ | "ninety_days_reclassification";
37
+
38
+ interface ExtraAccountParams {
39
+ /**
40
+ * Comma-separated list of fields to include. Allowed values:
41
+ * - churn_recognition,
42
+ * - churn_when_zero_mrr,
43
+ * - auto_churn_subscription,
44
+ * - refund_handling,
45
+ * - proximate_movement_reclassification
46
+ * Example: auto_churn_subscription,churn_when_zero_mrr
47
+ */
48
+ include?: string;
49
+ }
50
+
51
+ interface Account {
52
+ id: string;
53
+ name: string;
54
+ currency: string;
55
+ time_zone: string;
56
+ week_start_on: WeekStartOn;
57
+ churn_recognition?: ChurnRecognition;
58
+ churn_when_zero_mrr?: boolean;
59
+ auto_churn_subscription?: boolean;
60
+ refund_handling?: RefundHandling;
61
+ proximate_movement_reclassification?: ProximateMovementReclassification;
62
+ }
63
+
64
+ function retrieve(config: Config, params?: ExtraAccountParams): Promise<Account>;
65
+ }
66
+
16
67
  export namespace DataSource {
17
68
  type DataSourceStatus =
18
69
  | "never_imported"
19
70
  | "import_complete"
20
71
  | "import_in_progress"
21
72
  | "import_failed"
22
- | string
23
- | undefined;
73
+ | string;
24
74
 
25
75
  interface ProcessingStatus {
26
76
  processed?: number;
@@ -50,109 +100,140 @@ export namespace DataSource {
50
100
  auto_churn_subscription_setting?: AutoChurnSubscriptionSetting;
51
101
  invoice_handling_setting?: Record<string, any>;
52
102
  }
103
+ interface NewDataSource {
104
+ name: string;
105
+ }
53
106
  interface DataSources {
54
107
  data_sources: DataSource[];
55
108
  }
56
109
 
57
- function create(config: Config, data: DataSource): Promise<DataSource>;
110
+ function create(config: Config, data: NewDataSource): Promise<DataSource>;
58
111
  function retrieve(config: Config, uuid: string, params?: ExtraDataSourceParams): Promise<DataSource>;
59
- function destroy(config: Config, uuid: string): Promise<{}>;
112
+ function destroy(config: Config, uuid: string): Promise<ResourceDestroyed>;
60
113
  function all(config: Config, params?: ListDataSourcesParams): Promise<DataSources>;
61
114
  }
62
115
 
63
116
  export namespace Customer {
64
117
  interface Customer {
65
- id?: number | undefined;
66
- data_source_uuid?: string | undefined;
67
- data_source_uuids?: Strings | undefined;
68
- uuid?: string | undefined;
69
- external_id?: string | undefined;
70
- external_ids?: Strings | undefined;
71
- name?: string | undefined;
72
- email?: string | undefined;
73
- status?: string | undefined;
74
- ["customer-since"]?: string | undefined;
75
- attributes?: Attributes | undefined;
118
+ id?: number;
119
+ data_source_uuid?: string;
120
+ data_source_uuids?: Strings;
121
+ uuid?: string;
122
+ external_id?: string;
123
+ external_ids?: Strings;
124
+ name?: string;
125
+ email?: string;
126
+ status?: string;
127
+ ["customer-since"]?: string;
128
+ attributes?: Attributes;
76
129
  address?: {
77
- address_zip?: string | undefined;
78
- city?: string | undefined;
79
- state?: string | undefined;
80
- country?: string | undefined;
81
- } | undefined;
82
- mrr?: number | undefined;
83
- arr?: number | undefined;
84
- ["billing-system-url"]?: string | undefined;
85
- ["chartmogul-url"]?: string | undefined;
86
- ["billing-system-type"]?: string | undefined;
87
- currency?: string | undefined;
88
- ["currency-sign"]?: string | undefined;
89
- company?: string | undefined;
90
- country?: string | undefined;
91
- state?: string | undefined;
92
- city?: string | undefined;
93
- zip?: string | undefined;
94
- lead_created_at?: string | undefined;
95
- free_trial_started_at?: string | undefined;
130
+ address_zip?: string;
131
+ city?: string;
132
+ state?: string;
133
+ country?: string;
134
+ };
135
+ mrr?: number;
136
+ arr?: number;
137
+ ["billing-system-url"]?: string;
138
+ ["chartmogul-url"]?: string;
139
+ ["billing-system-type"]?: string;
140
+ currency?: string;
141
+ ["currency-sign"]?: string;
142
+ company?: string;
143
+ country?: string;
144
+ state?: string;
145
+ city?: string;
146
+ zip?: string;
147
+ lead_created_at?: string;
148
+ free_trial_started_at?: string;
149
+ owner?: string;
150
+ website_url?: string;
151
+ }
152
+ interface PrimaryContact {
153
+ first_name?: string;
154
+ last_name?: string;
155
+ email?: string;
156
+ title?: string;
157
+ phone?: string;
158
+ linked_in?: string;
159
+ twitter?: string;
160
+ notes?: string;
96
161
  }
97
162
  interface NewCustomer {
98
163
  data_source_uuid: string;
99
164
  external_id: string;
100
- name: string;
101
- email?: string | undefined;
102
- company?: string | undefined;
103
- country?: string | undefined;
104
- state?: string | undefined;
105
- city?: string | undefined;
106
- zip?: string | undefined;
107
- lead_created_at?: string | undefined;
108
- free_trial_started_at?: string | undefined;
109
- attributes?: NewAttributes | undefined;
165
+ name?: string;
166
+ email?: string;
167
+ company?: string;
168
+ country?: string;
169
+ state?: string;
170
+ city?: string;
171
+ zip?: string;
172
+ lead_created_at?: string;
173
+ free_trial_started_at?: string;
174
+ attributes?: NewAttributes;
175
+ owner?: string;
176
+ primary_contact?: PrimaryContact;
177
+ website_url?: string;
110
178
  }
111
179
  interface UpdateCustomer {
112
- name?: string | undefined;
113
- email?: string | undefined;
114
- company?: string | undefined;
115
- country?: string | undefined;
116
- state?: string | undefined;
117
- city?: string | undefined;
118
- zip?: string | undefined;
119
- lead_created_at?: string | undefined;
120
- free_trial_started_at?: string | undefined;
121
- attributes?: NewAttributes | undefined;
180
+ name?: string;
181
+ email?: string;
182
+ company?: string;
183
+ country?: string;
184
+ state?: string;
185
+ city?: string;
186
+ zip?: string;
187
+ lead_created_at?: string;
188
+ free_trial_started_at?: string;
189
+ attributes?: UpdateAttributes;
190
+ owner?: string;
191
+ primary_contact?: PrimaryContact;
192
+ website_url?: string;
193
+ status?: string;
122
194
  }
123
- interface NewAttributes {
124
- tags?: Strings | undefined;
125
- custom?: NewCustomAttributes[] | undefined;
195
+ interface UpdateAttributes {
196
+ tags?: Strings;
197
+ custom?: Map;
126
198
  }
127
- interface NewCustomAttributes {
128
- type?: string | undefined;
129
- key: string;
130
- value: any;
131
- source?: string | undefined;
199
+ interface NewAttributes {
200
+ tags?: Strings;
201
+ custom?: CustomAttribute.NewCustomAttribute[];
132
202
  }
133
203
  interface Attributes {
134
- tags?: Strings | undefined;
135
- stripe?: Map | undefined;
136
- clearbit?: Map | undefined;
137
- custom?: Map | undefined;
204
+ tags?: Strings;
205
+ stripe?: Map;
206
+ clearbit?: Map;
207
+ custom?: Map;
138
208
  }
139
209
  interface ListCustomersParams extends CursorParams {
140
- data_source_uuid?: string | undefined;
141
- status?: string | undefined;
142
- system?: string | undefined;
143
- external_id?: string | undefined;
210
+ data_source_uuid?: string;
211
+ status?: string;
212
+ system?: string;
213
+ external_id?: string;
144
214
  }
145
215
  interface SearchCustomersParams extends CursorParams {
146
- email: string;
147
- }
148
- interface MergeID {
149
- customer_uuid?: string | undefined;
150
- external_id?: string | undefined;
216
+ email?: string;
151
217
  }
218
+ type MergeID =
219
+ | {
220
+ customer_uuid: string;
221
+ data_source_uuid?: never;
222
+ external_id?: never;
223
+ }
224
+ | {
225
+ customer_uuid?: never;
226
+ data_source_uuid: string;
227
+ external_id: string;
228
+ };
152
229
  interface MergeCustomersParams {
153
230
  from: MergeID;
154
231
  into: MergeID;
155
232
  }
233
+ type MoveToNewCustomerField = "tasks" | "opportunities" | "notes";
234
+ type UnmergeCustomersParams = MergeID & {
235
+ move_to_new_customer?: MoveToNewCustomerField[];
236
+ };
156
237
 
157
238
  interface SubscriptionData {
158
239
  subscriptions: Array<{ uuid: string; data_source_uuid?: string }>;
@@ -161,10 +242,11 @@ export namespace Customer {
161
242
  function create(config: Config, data: NewCustomer): Promise<Customer>;
162
243
  function retrieve(config: Config, uuid: string): Promise<Customer>;
163
244
  function modify(config: Config, uuid: string, data: UpdateCustomer): Promise<Customer>;
164
- function destroy(config: Config, uuid: string): Promise<{}>;
245
+ function destroy(config: Config, uuid: string): Promise<ResourceDestroyed>;
165
246
  function all(config: Config, params?: ListCustomersParams): Promise<Entries<Customer>>;
166
247
  function search(config: Config, params?: SearchCustomersParams): Promise<Entries<Customer>>;
167
248
  function merge(config: Config, params?: MergeCustomersParams): Promise<{}>;
249
+ function unmerge(config: Config, params: UnmergeCustomersParams): Promise<{}>;
168
250
  function attributes(config: Config, uuid: string): Promise<Attributes>;
169
251
  /**
170
252
  * @deprecated Use Metrics.Customer.connectSubscriptions instead
@@ -174,101 +256,484 @@ export namespace Customer {
174
256
  * @deprecated Use Metrics.Customer.disconnectSubscriptions instead
175
257
  */
176
258
  function disconnectSubscriptions(config: Config, customerUuid: string, data: SubscriptionData): Promise<{}>;
259
+
260
+ function contacts(
261
+ config: Config,
262
+ customerId: string,
263
+ params?: Contact.ListContactsParams,
264
+ ): Promise<Entries<Contact.Contact>>;
265
+ function createContact(
266
+ config: Config,
267
+ customerId: string,
268
+ data: Contact.NewCustomerContact,
269
+ ): Promise<Contact.Contact>;
270
+
271
+ function notes(
272
+ config: Config,
273
+ customerId: string,
274
+ params?: CustomerNote.ListCustomerNotesParams,
275
+ ): Promise<Entries<CustomerNote.CustomerNote>>;
276
+ function createNote(
277
+ config: Config,
278
+ customerId: string,
279
+ data: CustomerNote.NewCustomerNote,
280
+ ): Promise<CustomerNote.CustomerNote>;
281
+
282
+ function opportunities(
283
+ config: Config,
284
+ customerId: string,
285
+ params?: Opportunity.ListOpportunitiesParams,
286
+ ): Promise<Entries<Opportunity.Opportunity>>;
287
+ function createOpportunity(
288
+ config: Config,
289
+ customerId: string,
290
+ data: Opportunity.NewOpportunity,
291
+ ): Promise<Opportunity.Opportunity>;
292
+
293
+ function tasks(
294
+ config: Config,
295
+ customerId: string,
296
+ params?: Task.ListTasksParams,
297
+ ): Promise<Entries<Task.Task>>;
298
+ function createTask(config: Config, customerId: string, data: Task.NewTask): Promise<Task.Task>;
299
+ }
300
+
301
+ export namespace Opportunity {
302
+ type OpportunityType = "one-time" | "recurring";
303
+ type ForecastCategory = "pipeline" | "best_case" | "committed" | "omitted";
304
+ type OpportunityPipeline = "New Business" | "Renewals";
305
+ type OpportunityPipelineStage =
306
+ | "Discovery"
307
+ | "Evaluation"
308
+ | "Negotiation"
309
+ | "Verbal Commit"
310
+ | "Closed Won"
311
+ | "Closed Lost";
312
+ interface Opportunity {
313
+ uuid?: string;
314
+ customer_uuid?: string;
315
+ owner?: string;
316
+ pipeline?: OpportunityPipeline | (string & {});
317
+ pipeline_stage?: OpportunityPipelineStage | (string & {});
318
+ estimated_close_date?: string;
319
+ currency?: string;
320
+ amount_in_cents?: number;
321
+ type?: OpportunityType;
322
+ forecast_category?: ForecastCategory;
323
+ win_likelihood?: number;
324
+ custom?: Map;
325
+ created_at?: string;
326
+ updated_at?: string;
327
+ }
328
+ interface ListOpportunitiesParams extends CursorParams {
329
+ customer_uuid?: string;
330
+ owner?: string;
331
+ pipeline?: OpportunityPipeline | (string & {});
332
+ pipeline_stage?: OpportunityPipelineStage | (string & {});
333
+ estimated_close_date_on_or_after?: string;
334
+ estimated_close_date_on_or_before?: string;
335
+ }
336
+ interface NewOpportunity {
337
+ customer_uuid: string;
338
+ owner: string;
339
+ pipeline: OpportunityPipeline | (string & {});
340
+ pipeline_stage: OpportunityPipelineStage | (string & {});
341
+ estimated_close_date: string;
342
+ amount_in_cents: number;
343
+ currency: string;
344
+ type?: OpportunityType;
345
+ forecast_category?: ForecastCategory;
346
+ win_likelihood?: number;
347
+ custom?: Array<{ key: string; value: any }>;
348
+ }
349
+ interface UpdateOpportunity {
350
+ owner?: string;
351
+ pipeline?: OpportunityPipeline | (string & {});
352
+ pipeline_stage?: OpportunityPipelineStage | (string & {});
353
+ estimated_close_date?: string;
354
+ amount_in_cents?: number;
355
+ currency?: string;
356
+ type?: OpportunityType;
357
+ forecast_category?: ForecastCategory;
358
+ win_likelihood?: number;
359
+ custom?: Array<{ key: string; value: any }>;
360
+ }
361
+
362
+ function create(config: Config, data: NewOpportunity): Promise<Opportunity>;
363
+ function retrieve(config: Config, uuid: string): Promise<Opportunity>;
364
+ function modify(config: Config, uuid: string, data: UpdateOpportunity): Promise<Opportunity>;
365
+ function destroy(config: Config, uuid: string): Promise<ResourceDestroyed>;
366
+ function all(config: Config, params?: ListOpportunitiesParams): Promise<Entries<Opportunity>>;
367
+ }
368
+
369
+ export namespace Task {
370
+ interface Task {
371
+ task_uuid?: string;
372
+ customer_uuid?: string;
373
+ task_details?: string;
374
+ assignee?: string;
375
+ due_date?: string;
376
+ completed_at?: string;
377
+ created_at?: string;
378
+ updated_at?: string;
379
+ }
380
+ interface ListTasksParams extends CursorParams {
381
+ customer_uuid?: string;
382
+ assignee?: string;
383
+ due_date_on_or_after?: string;
384
+ due_date_on_or_before?: string;
385
+ completed?: boolean;
386
+ }
387
+ interface NewTask {
388
+ customer_uuid: string;
389
+ task_details: string;
390
+ assignee: string;
391
+ due_date: string;
392
+ completed_at?: string;
393
+ }
394
+ interface UpdateTask {
395
+ task_details?: string;
396
+ assignee?: string;
397
+ due_date?: string;
398
+ completed_at?: string;
399
+ }
400
+
401
+ function create(config: Config, data: NewTask): Promise<Task>;
402
+ function retrieve(config: Config, taskUuid: string): Promise<Task>;
403
+ function modify(config: Config, taskUuid: string, data: UpdateTask): Promise<Task>;
404
+ function destroy(config: Config, taskUuid: string): Promise<ResourceDestroyed>;
405
+ function all(config: Config, params?: ListTasksParams): Promise<Entries<Task>>;
406
+ }
407
+
408
+ export namespace CustomerNote {
409
+ type CustomerNoteType = "note" | "call";
410
+ interface CustomerNote {
411
+ uuid?: string;
412
+ customer_uuid?: string;
413
+ type?: CustomerNoteType;
414
+ text?: string;
415
+ author?: string;
416
+ call_duration?: number;
417
+ created_at?: string;
418
+ updated_at?: string;
419
+ }
420
+ interface ListCustomerNotesParams extends CursorParams {
421
+ customer_uuid?: string;
422
+ type?: CustomerNoteType;
423
+ author_email?: string;
424
+ }
425
+ interface NewCustomerNote {
426
+ customer_uuid: string;
427
+ type: CustomerNoteType;
428
+ author_email?: string;
429
+ text?: string;
430
+ call_duration?: number;
431
+ created_at?: string;
432
+ }
433
+ interface UpdateCustomerNote {
434
+ author_email?: string;
435
+ text?: string;
436
+ call_duration?: number;
437
+ created_at?: string;
438
+ updated_at?: string;
439
+ }
440
+
441
+ function create(config: Config, data: NewCustomerNote): Promise<CustomerNote>;
442
+ function retrieve(config: Config, uuid: string): Promise<CustomerNote>;
443
+ function modify(config: Config, uuid: string, data: UpdateCustomerNote): Promise<CustomerNote>;
444
+ function destroy(config: Config, uuid: string): Promise<ResourceDestroyed>;
445
+ function all(config: Config, params?: ListCustomerNotesParams): Promise<Entries<CustomerNote>>;
446
+ }
447
+
448
+ export namespace Contact {
449
+ interface Contact {
450
+ uuid?: string;
451
+ customer_uuid?: string;
452
+ customer_external_id?: string;
453
+ data_source_uuid?: string;
454
+ position?: number;
455
+ first_name?: string;
456
+ last_name?: string;
457
+ title?: string;
458
+ email?: string;
459
+ phone?: string;
460
+ linked_in?: string;
461
+ twitter?: string;
462
+ notes?: string;
463
+ custom?: Map;
464
+ }
465
+ interface ListContactsParams extends CursorParams {
466
+ customer_uuid?: string;
467
+ data_source_uuid?: string;
468
+ email?: string;
469
+ customer_external_id?: string;
470
+ }
471
+ interface NewContact {
472
+ customer_uuid: string;
473
+ data_source_uuid: string;
474
+ position?: number;
475
+ first_name?: string;
476
+ last_name?: string;
477
+ title?: string;
478
+ email?: string;
479
+ phone?: string;
480
+ linked_in?: string;
481
+ twitter?: string;
482
+ notes?: string;
483
+ custom?: CustomAttribute.NewCustomAttribute[];
484
+ }
485
+ type NewCustomerContact = Omit<NewContact, "customer_uuid">;
486
+ interface UpdateContact {
487
+ position?: number;
488
+ first_name?: string;
489
+ last_name?: string;
490
+ title?: string;
491
+ email?: string;
492
+ phone?: string;
493
+ linked_in?: string;
494
+ twitter?: string;
495
+ notes?: string;
496
+ custom?: CustomAttribute.NewCustomAttribute[];
497
+ }
498
+
499
+ function create(config: Config, data: NewContact): Promise<Contact>;
500
+ function retrieve(config: Config, uuid: string): Promise<Contact>;
501
+ function modify(config: Config, uuid: string, data: UpdateContact): Promise<Contact>;
502
+ function destroy(config: Config, uuid: string): Promise<ResourceDestroyed>;
503
+ function merge(config: Config, intoContactUuid: string, fromContactUuid: string): Promise<Contact>;
504
+ function all(config: Config, params?: ListContactsParams): Promise<Entries<Contact>>;
177
505
  }
178
506
 
179
507
  export namespace Plan {
180
508
  interface Plan {
181
- uuid?: string | undefined;
182
- data_source_uuid?: string | undefined;
183
- external_id?: string | undefined;
184
- name?: string | undefined;
185
- interval_count?: number | undefined;
186
- interval_unit?: string | undefined;
509
+ uuid?: string;
510
+ data_source_uuid?: string;
511
+ external_id?: string;
512
+ name?: string;
513
+ interval_count?: number;
514
+ interval_unit?: string;
187
515
  }
188
516
  interface ListPlansParams extends CursorParams {
189
- data_source_uuid?: string | undefined;
190
- system?: string | undefined;
191
- external_id?: string | undefined;
517
+ data_source_uuid?: string;
518
+ system?: string;
519
+ external_id?: string;
192
520
  }
193
521
  interface Plans extends Cursor {
194
522
  plans: Plan[];
195
523
  }
524
+ interface NewPlan {
525
+ data_source_uuid: string;
526
+ name: string;
527
+ interval_count: number;
528
+ interval_unit: string;
529
+ external_id?: string;
530
+ }
531
+ interface UpdatePlan {
532
+ name?: string;
533
+ interval_count?: number;
534
+ interval_unit?: string;
535
+ }
196
536
 
197
- function create(config: Config, data: Plan): Promise<Plan>;
537
+ function create(config: Config, data: NewPlan): Promise<Plan>;
198
538
  function retrieve(config: Config, uuid: string): Promise<Plan>;
199
- function modify(config: Config, uuid: string, data: Plan): Promise<Plan>;
200
- function destroy(config: Config, uuid: string): Promise<{}>;
539
+ function modify(config: Config, uuid: string, data: UpdatePlan): Promise<Plan>;
540
+ function destroy(config: Config, uuid: string): Promise<ResourceDestroyed>;
201
541
  function all(config: Config, params?: ListPlansParams): Promise<Plans>;
202
542
  }
203
543
 
544
+ export namespace PlanGroup {
545
+ interface PlanGroup {
546
+ uuid?: string;
547
+ name?: string;
548
+ plans_count?: number;
549
+ }
550
+ interface PlanGroups extends Cursor {
551
+ plan_groups: PlanGroup[];
552
+ }
553
+ interface NewPlanGroup {
554
+ name: string;
555
+ plans: string[];
556
+ }
557
+ interface UpdatePlanGroup {
558
+ name?: string;
559
+ plans?: string[];
560
+ }
561
+
562
+ function create(config: Config, data: NewPlanGroup): Promise<PlanGroup>;
563
+ function retrieve(config: Config, uuid: string): Promise<PlanGroup>;
564
+ function modify(config: Config, uuid: string, data: UpdatePlanGroup): Promise<PlanGroup>;
565
+ function destroy(config: Config, uuid: string): Promise<ResourceDestroyed>;
566
+ function all(config: Config, planGroupUuid: string, params?: CursorParams): Promise<Plan.Plans>;
567
+ function all(config: Config, params?: CursorParams): Promise<PlanGroups>;
568
+ }
569
+
204
570
  export namespace Invoice {
205
571
  interface Invoice {
206
- uuid?: string | undefined;
207
- customer_uuid?: string | undefined;
208
- currency?: string | undefined;
209
- data_source_uuid?: string | undefined;
210
- date?: string | undefined;
211
- due_date?: string | undefined;
212
- external_id?: string | undefined;
213
- line_items?: LineItem[] | undefined;
214
- transactions?: Transaction[] | undefined;
572
+ uuid?: string;
573
+ customer_uuid?: string;
574
+ currency?: string;
575
+ data_source_uuid?: string;
576
+ date?: string;
577
+ due_date?: string;
578
+ external_id?: string;
579
+ line_items?: LineItem[];
580
+ transactions?: Transaction[];
215
581
  }
216
582
  interface LineItem {
217
- uuid?: string | undefined;
218
- account_code?: string | undefined;
219
- amount_in_cents?: number | undefined;
220
- cancelled_at?: string | undefined;
221
- description?: string | undefined;
222
- discount_amount_in_cents?: number | undefined;
223
- discount_code?: string | undefined;
224
- external_id?: string | undefined;
225
- plan_uuid?: string | undefined;
226
- prorated?: boolean | undefined;
227
- quantity?: number | undefined;
228
- service_period_end?: string | undefined;
229
- service_period_start?: string | undefined;
230
- subscription_external_id?: string | undefined;
231
- subscription_uuid?: string | undefined;
232
- tax_amount_in_cents?: number | undefined;
233
- transaction_fees_in_cents?: number | undefined;
234
- type?: string | undefined;
583
+ uuid?: string;
584
+ account_code?: string;
585
+ amount_in_cents?: number;
586
+ cancelled_at?: string;
587
+ description?: string;
588
+ discount_amount_in_cents?: number;
589
+ discount_code?: string;
590
+ external_id?: string;
591
+ plan_uuid?: string;
592
+ prorated?: boolean;
593
+ quantity?: number;
594
+ service_period_end?: string;
595
+ service_period_start?: string;
596
+ subscription_external_id?: string;
597
+ subscription_uuid?: string;
598
+ tax_amount_in_cents?: number;
599
+ transaction_fees_in_cents?: number;
600
+ type?: string;
235
601
  }
236
602
  interface Transaction {
237
- uuid?: string | undefined;
238
- date?: string | undefined;
239
- external_id?: string | undefined;
240
- result?: string | undefined;
241
- type?: string | undefined;
603
+ uuid?: string;
604
+ date?: string;
605
+ external_id?: string;
606
+ result?: string;
607
+ type?: string;
608
+ }
609
+
610
+ interface NewLineItemBase {
611
+ amount_in_cents: number;
612
+ quantity?: number;
613
+ discount_amount_in_cents?: number;
614
+ discount_code?: string;
615
+ tax_amount_in_cents?: number;
616
+ transaction_fees_in_cents?: number;
617
+ external_id?: string;
618
+ account_code?: string;
619
+ transaction_fees_currency?: string;
620
+ discount_description?: string;
621
+ event_order?: number;
622
+ }
623
+
624
+ interface NewSubscriptionLineItem extends NewLineItemBase {
625
+ type: "subscription";
626
+ subscription_external_id: string;
627
+ subscription_set_external_id?: string;
628
+ plan_uuid: string;
629
+ service_period_start: string;
630
+ service_period_end?: string;
631
+ cancelled_at?: string;
632
+ prorated?: boolean;
633
+ proration_type?: "differential" | "full" | "differential_mrr";
634
+ }
635
+
636
+ interface NewOneTimeLineItem extends NewLineItemBase {
637
+ type: "one_time";
638
+ description?: string;
242
639
  }
640
+
641
+ interface NewTrialLineItem extends NewLineItemBase {
642
+ type: "trial";
643
+ subscription_external_id: string;
644
+ subscription_set_external_id?: string;
645
+ plan_uuid: string;
646
+ service_period_start: string;
647
+ service_period_end: string;
648
+ cancelled_at?: string;
649
+ prorated?: boolean;
650
+ proration_type?: "differential" | "full" | "differential_mrr";
651
+ }
652
+
653
+ type NewLineItem = NewSubscriptionLineItem | NewOneTimeLineItem | NewTrialLineItem;
654
+
655
+ interface NewTransaction {
656
+ date: string;
657
+ type: "payment" | "refund";
658
+ result: "successful" | "failed";
659
+ amount_in_cents?: number;
660
+ external_id?: string;
661
+ }
662
+
663
+ interface NewInvoice {
664
+ external_id: string;
665
+ date: string;
666
+ currency: string;
667
+ line_items: NewLineItem[];
668
+ customer_external_id?: string;
669
+ data_source_uuid?: string;
670
+ transactions?: NewTransaction[];
671
+ due_date?: string;
672
+ collection_method?: "automatic" | "manual";
673
+ }
674
+
243
675
  interface ListInvoicesParams extends CursorParams {
244
- data_source_uuid?: string | undefined;
245
- customer_uuid?: string | undefined;
246
- external_id?: string | undefined;
676
+ data_source_uuid?: string;
677
+ customer_uuid?: string;
678
+ external_id?: string;
679
+ }
680
+ interface RetrieveInvoiceParams {
681
+ validation_type?: "valid" | "invalid" | "all";
682
+ include_edit_histories?: boolean;
683
+ with_disabled?: boolean;
684
+ }
685
+ interface UpdateInvoice {
686
+ date?: string;
687
+ due_date?: string;
688
+ currency?: string;
689
+ collection_method?: "automatic" | "manual";
247
690
  }
248
691
  interface Invoices extends Cursor {
249
- customer_uuid?: string | undefined;
692
+ customer_uuid?: string;
250
693
  invoices: Invoice[];
251
694
  }
252
695
 
253
- function create(config: Config, uuid: string, data: {
254
- invoices: Invoice[];
255
- }): Promise<Invoice>;
256
- function retrieve(config: Config, uuid: string): Promise<Invoice>;
257
- function destroy(config: Config, uuid: string): Promise<{}>;
696
+ function create(
697
+ config: Config,
698
+ uuid: string,
699
+ data: {
700
+ invoices: NewInvoice[];
701
+ },
702
+ ): Promise<{ invoices: Invoice[] }>;
703
+ function retrieve(config: Config, uuid: string, params?: RetrieveInvoiceParams): Promise<Invoice>;
704
+ function modify(config: Config, uuid: string, data: UpdateInvoice): Promise<Invoice>;
705
+ function destroy(config: Config, uuid: string): Promise<ResourceDestroyed>;
258
706
  function all(config: Config, uuid: string, params?: ListInvoicesParams): Promise<Invoices>;
259
707
  function all(config: Config, params?: ListInvoicesParams): Promise<Invoices>;
260
708
  }
261
709
 
262
710
  export namespace Transaction {
263
711
  interface Transaction {
264
- uuid?: string | undefined;
712
+ uuid?: string;
713
+ external_id?: string;
714
+ type?: string;
715
+ date?: string;
716
+ result?: string;
717
+ amount_in_cents?: number | null;
718
+ transaction_fees_in_cents?: number | null;
719
+ transaction_fees_currency?: string | null;
720
+ disabled?: boolean;
721
+ disabled_at?: string | null;
722
+ disabled_by?: string | null;
723
+ user_created?: boolean;
724
+ }
725
+
726
+ interface NewTransaction {
727
+ type: "payment" | "refund";
265
728
  date: string;
266
- external_id?: string | undefined;
267
- result: string;
268
- type: string;
729
+ result: "successful" | "failed";
730
+ external_id?: string;
731
+ amount_in_cents?: number;
732
+ transaction_fees_in_cents?: number;
733
+ transaction_fees_currency?: string;
269
734
  }
270
735
 
271
- function create(config: Config, uuid: string, data: Transaction): Promise<Transaction>;
736
+ function create(config: Config, invoiceUuid: string, data: NewTransaction): Promise<Transaction>;
272
737
  }
273
738
 
274
739
  export namespace Subscription {
@@ -281,11 +746,11 @@ export namespace Subscription {
281
746
  data_source_uuid: string;
282
747
  }
283
748
  interface CancelSubscriptionParams {
284
- cancelled_at?: string | undefined;
285
- cancellation_dates?: Strings | undefined;
749
+ cancelled_at?: string;
750
+ cancellation_dates?: Strings;
286
751
  }
287
752
  interface Subscriptions extends Cursor {
288
- customer_uuid?: string | undefined;
753
+ customer_uuid?: string;
289
754
  subscriptions: Subscription[];
290
755
  }
291
756
 
@@ -293,6 +758,118 @@ export namespace Subscription {
293
758
  function cancel(config: Config, uuid: string, data: CancelSubscriptionParams): Promise<Subscription>;
294
759
  }
295
760
 
761
+ export namespace SubscriptionEvent {
762
+ type SubscriptionEventType =
763
+ | "subscription_start"
764
+ | "subscription_start_scheduled"
765
+ | "scheduled_subscription_start_retracted"
766
+ | "subscription_cancelled"
767
+ | "subscription_cancellation_scheduled"
768
+ | "scheduled_subscription_cancellation_retracted"
769
+ | "subscription_updated"
770
+ | "subscription_update_scheduled"
771
+ | "scheduled_subscription_update_retracted"
772
+ | "subscription_event_retracted";
773
+
774
+ interface SubscriptionEvent {
775
+ id?: number;
776
+ data_source_uuid?: string;
777
+ customer_external_id?: string;
778
+ subscription_set_external_id?: string | null;
779
+ subscription_external_id?: string;
780
+ plan_external_id?: string;
781
+ event_date?: string;
782
+ effective_date?: string;
783
+ event_type?: SubscriptionEventType;
784
+ external_id?: string;
785
+ errors?: Record<string, any>;
786
+ created_at?: string;
787
+ updated_at?: string;
788
+ quantity?: number;
789
+ currency?: string;
790
+ amount_in_cents?: number | string;
791
+ tax_amount_in_cents?: number;
792
+ event_order?: number | null;
793
+ retracted_event_id?: string | null;
794
+ }
795
+
796
+ interface NewSubscriptionEvent {
797
+ data_source_uuid: string;
798
+ customer_external_id: string;
799
+ event_type: SubscriptionEventType;
800
+ event_date: string;
801
+ effective_date: string;
802
+ subscription_external_id: string;
803
+ plan_external_id?: string;
804
+ currency?: string;
805
+ amount_in_cents?: number;
806
+ quantity?: number;
807
+ subscription_set_external_id?: string;
808
+ tax_amount_in_cents?: number;
809
+ retracted_event_id?: string;
810
+ external_id?: string;
811
+ event_order?: number;
812
+ }
813
+
814
+ interface ListSubscriptionEventsParams extends CursorParams {
815
+ external_id?: string;
816
+ customer_external_id?: string;
817
+ data_source_uuid?: string;
818
+ subscription_external_id?: string;
819
+ event_type?: SubscriptionEventType;
820
+ event_date?: string;
821
+ effective_date?: string;
822
+ plan_external_id?: string;
823
+ include_edit_histories?: boolean;
824
+ with_disabled?: boolean;
825
+ }
826
+
827
+ interface SubscriptionEvents extends Cursor {
828
+ subscription_events: SubscriptionEvent[];
829
+ }
830
+
831
+ interface UpdateSubscriptionEvent {
832
+ external_id?: string;
833
+ data_source_uuid?: string;
834
+ id?: number;
835
+ customer_external_id?: string;
836
+ event_type?: SubscriptionEventType;
837
+ event_date?: string;
838
+ effective_date?: string;
839
+ subscription_external_id?: string;
840
+ plan_external_id?: string;
841
+ currency?: string;
842
+ amount_in_cents?: number;
843
+ quantity?: number;
844
+ subscription_set_external_id?: string;
845
+ tax_amount_in_cents?: number;
846
+ retracted_event_id?: string;
847
+ event_order?: number;
848
+ }
849
+
850
+ interface DestroySubscriptionEvent {
851
+ external_id?: string;
852
+ data_source_uuid?: string;
853
+ id?: number;
854
+ }
855
+
856
+ function create(config: Config, data: { subscription_event: NewSubscriptionEvent }): Promise<SubscriptionEvent>;
857
+ function all(config: Config, params?: ListSubscriptionEventsParams): Promise<SubscriptionEvents>;
858
+ function modify(config: Config, data: { subscription_event: UpdateSubscriptionEvent }): Promise<SubscriptionEvent>;
859
+ function updateWithParams(
860
+ config: Config,
861
+ data: { subscription_event: UpdateSubscriptionEvent },
862
+ ): Promise<SubscriptionEvent>;
863
+ function destroy(
864
+ config: Config,
865
+ data: { subscription_event: DestroySubscriptionEvent },
866
+ ): Promise<ResourceDestroyed>;
867
+ function deleteWithParams(
868
+ config: Config,
869
+ data: { subscription_event: DestroySubscriptionEvent },
870
+ ): Promise<ResourceDestroyed>;
871
+ }
872
+
296
873
  export namespace Tag {
297
874
  interface Tags {
298
875
  tags: Strings;
@@ -307,17 +884,22 @@ export namespace Tag {
307
884
  }
308
885
 
309
886
  export namespace CustomAttribute {
310
- import NewCustomAttributes = Customer.NewCustomAttributes;
887
+ interface NewCustomAttribute {
888
+ type?: string;
889
+ key: string;
890
+ value: any;
891
+ source?: string;
892
+ }
311
893
 
312
894
  interface CustomAttributes {
313
895
  custom: Map;
314
896
  }
315
897
  function add(config: Config, uuid: string, data: {
316
898
  email: string;
317
- custom: NewCustomAttributes[];
899
+ custom: NewCustomAttribute[];
318
900
  }): Promise<Entries<Customer.Customer>>;
319
901
  function add(config: Config, uuid: string, data: {
320
- custom: NewCustomAttributes[];
902
+ custom: NewCustomAttribute[];
321
903
  }): Promise<CustomAttributes>;
322
904
  function update(config: Config, uuid: string, data: CustomAttributes): Promise<CustomAttributes>;
323
905
  function remove(config: Config, uuid: string, data: {
@@ -327,25 +909,60 @@ export namespace CustomAttribute {
327
909
 
328
910
  export namespace Metrics {
329
911
  interface Params extends ParamsNoInterval {
330
- interval?: string | undefined;
912
+ interval?: string;
331
913
  }
332
914
  interface ParamsNoInterval {
333
915
  ["start-date"]: string;
334
916
  ["end-date"]: string;
335
- geo?: string | undefined;
336
- plans?: string | undefined;
917
+ geo?: string;
918
+ plans?: string;
919
+ filters?: string;
337
920
  }
338
921
  interface All {
339
922
  entries: {
340
923
  date: string;
924
+ mrr: number;
925
+ ["mrr-percentage-change"]: number;
926
+ arr: number;
927
+ ["arr-percentage-change"]: number;
341
928
  ["customer-churn-rate"]: number;
929
+ ["customer-churn-rate-percentage-change"]: number;
342
930
  ["mrr-churn-rate"]: number;
931
+ ["mrr-churn-rate-percentage-change"]: number;
343
932
  ltv: number;
933
+ ["ltv-percentage-change"]: number;
344
934
  customers: number;
935
+ ["customers-percentage-change"]: number;
345
936
  asp: number;
937
+ ["asp-percentage-change"]: number;
346
938
  arpa: number;
347
- arr: number;
348
- mrr: number;
939
+ ["arpa-percentage-change"]: number;
940
+ };
941
+ summary: {
942
+ ["current-mrr"]: number;
943
+ ["previous-mrr"]: number;
944
+ ["mrr-percentage-change"]: number;
945
+ ["current-arr"]: number;
946
+ ["previous-arr"]: number;
947
+ ["arr-percentage-change"]: number;
948
+ ["current-customer-churn-rate"]: number;
949
+ ["previous-customer-churn-rate"]: number;
950
+ ["customer-churn-rate-percentage-change"]: number;
951
+ ["current-mrr-churn-rate"]: number;
952
+ ["previous-mrr-churn-rate"]: number;
953
+ ["mrr-churn-rate-percentage-change"]: number;
954
+ ["current-ltv"]: number;
955
+ ["previous-ltv"]: number;
956
+ ["ltv-percentage-change"]: number;
957
+ ["current-customers"]: number;
958
+ ["previous-customers"]: number;
959
+ ["customers-percentage-change"]: number;
960
+ ["current-asp"]: number;
961
+ ["previous-asp"]: number;
962
+ ["asp-percentage-change"]: number;
963
+ ["current-arpa"]: number;
964
+ ["previous-arpa"]: number;
965
+ ["arpa-percentage-change"]: number;
349
966
  };
350
967
  }
351
968
 
@@ -403,6 +1020,7 @@ export namespace Metrics {
403
1020
  external_id: string;
404
1021
  plan: string;
405
1022
  quantity: number;
1023
+ uuid: string;
406
1024
  mrr: number;
407
1025
  arr: number;
408
1026
  status: string;
@@ -425,10 +1043,6 @@ export namespace Metrics {
425
1043
  type: string;
426
1044
  }
427
1045
 
428
- interface SubscriptionConnectionData {
429
- subscriptions: Array<{ uuid: string; data_source_uuid: string }>;
430
- }
431
-
432
1046
  function subscriptions(
433
1047
  config: Config,
434
1048
  uuid: string,
@@ -439,15 +1053,83 @@ export namespace Metrics {
439
1053
  config: Config,
440
1054
  dataSourceUuid: string,
441
1055
  customerUuid: string,
442
- data: SubscriptionConnectionData,
1056
+ data: Array<{ uuid: string }>,
443
1057
  ): Promise<{}>;
444
1058
  function disconnectSubscriptions(
445
1059
  config: Config,
446
1060
  dataSourceUuid: string,
447
1061
  customerUuid: string,
448
- data: SubscriptionConnectionData,
1062
+ data: Array<{ uuid: string }>,
449
1063
  ): Promise<{}>;
450
1064
  }
1065
+
1066
+ namespace Activity {
1067
+ type ActivityType = "new_biz" | "reactivation" | "expansion" | "contraction" | "churn";
1068
+
1069
+ interface Activity {
1070
+ description?: string;
1071
+ ["activity-mrr-movement"]?: number;
1072
+ ["activity-mrr"]?: number;
1073
+ ["activity-arr"]?: number;
1074
+ date?: string;
1075
+ type?: ActivityType;
1076
+ currency?: string;
1077
+ ["subscription-external-id"]?: string;
1078
+ ["plan-external-id"]?: string;
1079
+ subscription_set_external_id?: string | null;
1080
+ ["customer-name"]?: string;
1081
+ ["customer-uuid"]?: string;
1082
+ ["customer-external-id"]?: string;
1083
+ ["billing-connector-uuid"]?: string;
1084
+ uuid?: string;
1085
+ }
1086
+
1087
+ interface ListActivitiesParams {
1088
+ cursor?: string;
1089
+ ["per-page"]?: number;
1090
+ ["start-date"]?: string;
1091
+ ["end-date"]?: string;
1092
+ type?: ActivityType;
1093
+ order?: "date" | "-date";
1094
+ ["start-after"]?: string;
1095
+ }
1096
+
1097
+ interface Activities extends Cursor {
1098
+ entries: Activity[];
1099
+ }
1100
+
1101
+ function all(config: Config, params?: ListActivitiesParams): Promise<Activities>;
1102
+ }
1103
+
1104
+ namespace ActivitiesExport {
1105
+ type ActivityType = "new_biz" | "reactivation" | "expansion" | "contraction" | "churn";
1106
+ type ExportStatus = "pending" | "processing" | "failed" | "successful";
1107
+
1108
+ interface ActivitiesExport {
1109
+ id?: string;
1110
+ status?: ExportStatus;
1111
+ file_url?: string | null;
1112
+ params?: {
1113
+ kind?: string;
1114
+ params?: {
1115
+ activity_type?: ActivityType;
1116
+ start_date?: string;
1117
+ end_date?: string;
1118
+ };
1119
+ };
1120
+ expires_at?: string | null;
1121
+ created_at?: string;
1122
+ }
1123
+
1124
+ interface NewActivitiesExport {
1125
+ ["start-date"]?: string;
1126
+ ["end-date"]?: string;
1127
+ type?: ActivityType;
1128
+ }
1129
+
1130
+ function create(config: Config, data?: NewActivitiesExport): Promise<ActivitiesExport>;
1131
+ function retrieve(config: Config, id: string): Promise<ActivitiesExport>;
1132
+ }
451
1133
  }
452
1134
 
453
1135
  export class ChartMogulError extends Error {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@types/chartmogul-node",
3
- "version": "3.9.0",
3
+ "version": "3.9.1",
4
4
  "description": "TypeScript definitions for chartmogul-node",
5
5
  "homepage": "https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/chartmogul-node",
6
6
  "license": "MIT",
@@ -21,6 +21,6 @@
21
21
  "scripts": {},
22
22
  "dependencies": {},
23
23
  "peerDependencies": {},
24
- "typesPublisherContentHash": "0e60b2c701c2de3c16c73d58080555800e06ac72e709db5da801749ee7a008c5",
24
+ "typesPublisherContentHash": "942d74ef377b48c68e689711ba8e125de4eb25685de4215d61340d752d03d7df",
25
25
  "typeScriptVersion": "5.2"
26
26
  }