chargebee 2.40.0 → 3.0.0-beta.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.
Files changed (118) hide show
  1. package/CHANGELOG.md +10 -1
  2. package/LICENSE +1 -1
  3. package/README.md +90 -172
  4. package/cjs/RequestWrapper.js +81 -0
  5. package/cjs/asyncApiSupport.js +39 -0
  6. package/cjs/chargebee.cjs.js +13 -0
  7. package/cjs/chargebee.cjs.worker.js +9 -0
  8. package/cjs/chargebeeError.js +17 -0
  9. package/cjs/coreCommon.js +72 -0
  10. package/cjs/createChargebee.js +92 -0
  11. package/cjs/environment.js +18 -0
  12. package/cjs/filter.js +1 -0
  13. package/cjs/net/ClientInterface.js +40 -0
  14. package/cjs/net/FetchClient.js +86 -0
  15. package/cjs/net/NodeClient.js +61 -0
  16. package/cjs/package.json +1 -0
  17. package/cjs/resources/api_endpoints.js +1086 -0
  18. package/cjs/util.js +218 -0
  19. package/esm/RequestWrapper.js +77 -0
  20. package/esm/asyncApiSupport.js +35 -0
  21. package/esm/chargebee.esm.js +9 -0
  22. package/esm/chargebee.esm.worker.js +5 -0
  23. package/esm/chargebeeError.js +13 -0
  24. package/esm/coreCommon.js +67 -0
  25. package/esm/createChargebee.js +88 -0
  26. package/esm/environment.js +15 -0
  27. package/esm/filter.js +1 -0
  28. package/esm/net/ClientInterface.js +35 -0
  29. package/esm/net/FetchClient.js +81 -0
  30. package/esm/net/NodeClient.js +56 -0
  31. package/esm/package.json +1 -0
  32. package/esm/resources/api_endpoints.js +1083 -0
  33. package/esm/util.js +202 -0
  34. package/package.json +69 -38
  35. package/types/core.d.ts +558 -89
  36. package/types/index.d.ts +91 -54
  37. package/types/resources/Address.d.ts +57 -272
  38. package/types/resources/AdvanceInvoiceSchedule.d.ts +21 -94
  39. package/types/resources/AttachedItem.d.ts +91 -329
  40. package/types/resources/Attribute.d.ts +5 -5
  41. package/types/resources/BusinessEntity.d.ts +49 -69
  42. package/types/resources/BusinessEntityTransfer.d.ts +11 -17
  43. package/types/resources/Card.d.ts +146 -424
  44. package/types/resources/Comment.d.ts +72 -189
  45. package/types/resources/Contact.d.ts +12 -64
  46. package/types/resources/ContractTerm.d.ts +15 -96
  47. package/types/resources/Coupon.d.ts +282 -758
  48. package/types/resources/CouponCode.d.ts +56 -52
  49. package/types/resources/CouponSet.d.ts +92 -234
  50. package/types/resources/CreditNote.d.ts +588 -1758
  51. package/types/resources/CreditNoteEstimate.d.ts +131 -157
  52. package/types/resources/Currency.d.ts +75 -62
  53. package/types/resources/Customer.d.ts +892 -835
  54. package/types/resources/CustomerEntitlement.d.ts +36 -0
  55. package/types/resources/DifferentialPrice.d.ts +116 -314
  56. package/types/resources/Discount.d.ts +20 -125
  57. package/types/resources/Download.d.ts +6 -22
  58. package/types/resources/Entitlement.d.ts +51 -160
  59. package/types/resources/EntitlementOverride.d.ts +58 -139
  60. package/types/resources/Estimate.d.ts +1178 -527
  61. package/types/resources/Event.d.ts +67 -178
  62. package/types/resources/Export.d.ts +563 -723
  63. package/types/resources/Feature.d.ts +117 -433
  64. package/types/resources/GatewayErrorDetail.d.ts +16 -72
  65. package/types/resources/Gift.d.ts +265 -432
  66. package/types/resources/Hierarchy.d.ts +8 -36
  67. package/types/resources/HostedPage.d.ts +1017 -1153
  68. package/types/resources/ImpactedItem.d.ts +13 -50
  69. package/types/resources/ImpactedItemPrice.d.ts +13 -15
  70. package/types/resources/ImpactedSubscription.d.ts +13 -45
  71. package/types/resources/InAppSubscription.d.ts +93 -389
  72. package/types/resources/Installment.d.ts +35 -110
  73. package/types/resources/InstallmentConfig.d.ts +54 -155
  74. package/types/resources/InstallmentDetail.d.ts +19 -27
  75. package/types/resources/Invoice.d.ts +1574 -3157
  76. package/types/resources/InvoiceEstimate.d.ts +131 -161
  77. package/types/resources/Item.d.ts +133 -611
  78. package/types/resources/ItemEntitlement.d.ts +78 -215
  79. package/types/resources/ItemFamily.d.ts +69 -178
  80. package/types/resources/ItemPrice.d.ts +291 -1203
  81. package/types/resources/Metadata.d.ts +3 -5
  82. package/types/resources/Order.d.ts +538 -1471
  83. package/types/resources/PaymentIntent.d.ts +163 -347
  84. package/types/resources/PaymentReferenceNumber.d.ts +7 -29
  85. package/types/resources/PaymentSource.d.ts +476 -1272
  86. package/types/resources/PaymentVoucher.d.ts +87 -306
  87. package/types/resources/PortalSession.d.ts +71 -207
  88. package/types/resources/PriceVariant.d.ts +91 -279
  89. package/types/resources/PricingPageSession.d.ts +92 -41
  90. package/types/resources/PromotionalCredit.d.ts +90 -346
  91. package/types/resources/Purchase.d.ts +185 -315
  92. package/types/resources/Quote.d.ts +1406 -887
  93. package/types/resources/QuoteLineGroup.d.ts +125 -452
  94. package/types/resources/QuotedCharge.d.ts +45 -274
  95. package/types/resources/QuotedSubscription.d.ts +100 -488
  96. package/types/resources/Ramp.d.ts +233 -724
  97. package/types/resources/ResourceMigration.d.ts +25 -80
  98. package/types/resources/SiteMigrationDetail.d.ts +34 -112
  99. package/types/resources/Subscription.d.ts +2390 -4335
  100. package/types/resources/SubscriptionEntitlement.d.ts +59 -160
  101. package/types/resources/SubscriptionEstimate.d.ts +51 -75
  102. package/types/resources/TaxWithheld.d.ts +15 -40
  103. package/types/resources/ThirdPartyPaymentMethod.d.ts +7 -29
  104. package/types/resources/TimeMachine.d.ts +43 -97
  105. package/types/resources/Token.d.ts +15 -85
  106. package/types/resources/Transaction.d.ts +278 -900
  107. package/types/resources/UnbilledCharge.d.ts +189 -164
  108. package/types/resources/Usage.d.ts +89 -279
  109. package/types/resources/VirtualBankAccount.d.ts +103 -255
  110. package/types/resources/filter.d.ts +52 -0
  111. package/.github/ISSUE_TEMPLATE/bug_report.yml +0 -81
  112. package/.github/ISSUE_TEMPLATE/config.yml +0 -6
  113. package/.github/ISSUE_TEMPLATE/feature_request.yml +0 -34
  114. package/.github/PULL_REQUEST_TEMPLATE.md +0 -8
  115. package/lib/chargebee.js +0 -512
  116. package/lib/resources/api_endpoints.js +0 -2912
  117. package/types/resources/NonSubscription.d.ts +0 -30
  118. package/types/resources/Session.d.ts +0 -41
@@ -1,240 +1,103 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
2
4
  declare module 'chargebee' {
3
5
  export interface ItemEntitlement {
4
-
5
- /**
6
- * @description A unique identifier for the &#x60;item_entitlement&#x60;. This is auto-generated.
7
-
8
- */
9
-
10
- id:string;
11
-
12
- /**
13
- * @description The &#x60;id&#x60; of the &#x60;item&#x60; to which this entitlement belongs.
14
-
15
- */
16
-
17
- item_id?:string;
18
-
19
- /**
20
- * @description The &#x60;type&#x60; of the &#x60;item&#x60; to which this entitlement belongs. \* charge - Charge \* item - Item \* subscription - Subscription \* addon - Addon \* plan - Plan
21
-
22
- */
23
-
24
- item_type?:'item' | 'charge' | 'addon' | 'subscription' | 'plan';
25
-
26
- /**
27
- * @description The &#x60;id&#x60; of the feature towards which this entitlement has been granted.
28
-
29
- */
30
-
31
- feature_id?:string;
32
-
33
- /**
34
- * @description The &#x60;name&#x60; of the &#x60;feature&#x60; towards which this entitlement has been granted.
35
-
36
- */
37
-
38
- feature_name?:string;
39
-
40
- /**
41
- * @description The level of entitlement that the item has towards the feature. The possible values depend on the value of &#x60;feature.type&#x60;:
42
-
43
- * When &#x60;feature.type&#x60; is &#x60;quantity&#x60; and:
44
- * If &#x60;feature.levels[is_unlimited]&#x60; is not &#x60;true&#x60; for any one of &#x60;feature.levels[]&#x60;, then the value can be any one of &#x60;feature.levels[value][]&#x60;.
45
- * If &#x60;feature.levels[is_unlimited]&#x60; is &#x60;true&#x60; for one of the &#x60;feature.levels[]&#x60;, then the value can also be:
46
- * any one of &#x60;feature.levels[value][]&#x60;
47
- * or it can be &#x60;unlimited&#x60; (case-insensitive), indicating unlimited entitlement.
48
- * When &#x60;type&#x60; is &#x60;range&#x60; and:
49
- * If &#x60;feature.levels[is_unlimited]&#x60; is not &#x60;true&#x60; for any one of &#x60;feature.levels[]&#x60;, then the value can be any whole number between &#x60;levels[value][0]&#x60; and &#x60;levels[value][1]&#x60; (inclusive).
50
- * If &#x60;feature.levels[is_unlimited]&#x60; is &#x60;true&#x60; for one of the &#x60;feature.levels[]&#x60;, then the value can be:
51
- * any whole number equal to or greater than &#x60;levels[value][0]&#x60;
52
- * or it can be &#x60;unlimited&#x60; (case-insensitive), indicating unlimited entitlement.
53
- * When &#x60;type&#x60; is &#x60;custom&#x60;, then the value can be any one of &#x60;feature.levels[value][]&#x60;.
54
- * When &#x60;type&#x60; is &#x60;switch&#x60;, then the value is set as &#x60;available&#x60; or &#x60;true&#x60;.
55
-
56
- */
57
-
58
- value?:string;
59
-
60
- /**
61
- * @description The display name for the entitlement level. The default values are auto-generated based on &#x60;feature.type&#x60; as follows:
62
-
63
- * When &#x60;feature.type&#x60; is &#x60;quantity&#x60; or &#x60;range&#x60;, then &#x60;name&#x60; is the space-separated concatenation of &#x60;value&#x60; and the pluralized version of &#x60;feature.unit&#x60;. For example, if &#x60;value&#x60; is &#x60;20&#x60; and &#x60;feature.unit&#x60; is &#x60;user&#x60;, then &#x60;name&#x60; becomes &#x60;20 users&#x60;.
64
- * When &#x60;feature.type&#x60; is &#x60;custom&#x60;, then &#x60;name&#x60; is the same as &#x60;value&#x60;.a
65
-
66
- */
67
-
68
- name?:string;
6
+ id: string;
7
+ item_id?: string;
8
+ item_type?: 'plan' | 'addon' | 'charge' | 'subscription' | 'item';
9
+ feature_id?: string;
10
+ feature_name?: string;
11
+ value?: string;
12
+ name?: string;
69
13
  }
70
- export namespace ItemEntitlement {
71
- export class ItemEntitlementResource {
72
- /**
73
- * @description **Deprecated**
74
14
 
75
- This endpoint remains operational, but we recommend transitioning to its successor: [List entitlements](entitlements?prod_cat_ver&#x3D;2#list_all_entitlements).
76
- Retrieves a list of all the &#x60;item_entitlements&#x60; for the &#x60;item&#x60; specified.
77
-
78
- */
79
-
80
- item_entitlements_for_item(item_id:string, input?:ItemEntitlementsForItemInputParam):ChargebeeRequest<ItemEntitlementsForItemResponse>;
81
-
82
- /**
83
- * @description **Deprecated**
84
-
85
- This endpoint remains operational, but we recommend transitioning to its successor: [List entitlements](entitlements?prod_cat_ver&#x3D;2#list_all_entitlements).
86
- Retrieves a list of all the &#x60;item_entitlement&#x60;s for the &#x60;feature&#x60; specified.
87
-
88
- */
89
-
90
- item_entitlements_for_feature(feature_id:string, input?:ItemEntitlementsForFeatureInputParam):ChargebeeRequest<ItemEntitlementsForFeatureResponse>;
91
-
92
- /**
93
- * @description **Deprecated**
94
-
95
- This endpoint remains operational, but we recommend transitioning to its successor: [Manage entitlements](entitlements?prod_cat_ver&#x3D;2#upsert_or_remove_entitlements_for_a_feature).
96
-
97
- Upserts or removes a set of &#x60;item_entitlement&#x60;s for an &#x60;feature&#x60; depending on the &#x60;action&#x60; specified. The API returns the upserted or deleted &#x60;item_entitlements&#x60; after successfully completing the operation. The operation returns an error when the first &#x60;item_entitlement&#x60; fails to be processed. Either all the &#x60;item_entitlement&#x60;s provided in the request are processed or none.
98
-
99
- */
100
-
101
- add_item_entitlements(feature_id:string, input:AddItemEntitlementsInputParam):ChargebeeRequest<AddItemEntitlementsResponse>;
102
-
103
- /**
104
- * @description **Deprecated**
105
-
106
- This endpoint remains operational, but we recommend transitioning to its successor: [Manage entitlements](entitlements?prod_cat_ver&#x3D;2#upsert_or_remove_entitlements_for_a_feature).
107
-
108
- Upserts or removes a set of &#x60;item_entitlements&#x60; for an [item](items?prod_cat_ver&#x3D;2) depending on the &#x60;action&#x60; specified. The API returns the upserted or deleted &#x60;item_entitlements&#x60; after successfully completing the operation. The operation returns an error when the first &#x60;item_entitlement&#x60; fails to be processed. Either all the &#x60;item_entitlement&#x60;s provided in the request are processed or none.
109
-
110
- */
111
-
112
- upsert_or_remove_item_entitlements_for_item(item_id:string, input:UpsertOrRemoveItemEntitlementsForItemInputParam):ChargebeeRequest<UpsertOrRemoveItemEntitlementsForItemResponse>;
15
+ export namespace ItemEntitlement {
16
+ export class ItemEntitlementResource {
17
+ itemEntitlementsForItem(
18
+ item_id: string,
19
+ input?: ItemEntitlementsForItemInputParam,
20
+ headers?: ChargebeeRequestHeader,
21
+ ): Promise<ChargebeeResponse<ItemEntitlementsForItemResponse>>;
22
+
23
+ itemEntitlementsForFeature(
24
+ feature_id: string,
25
+ input?: ItemEntitlementsForFeatureInputParam,
26
+ headers?: ChargebeeRequestHeader,
27
+ ): Promise<ChargebeeResponse<ItemEntitlementsForFeatureResponse>>;
28
+
29
+ addItemEntitlements(
30
+ feature_id: string,
31
+ input: AddItemEntitlementsInputParam,
32
+ headers?: ChargebeeRequestHeader,
33
+ ): Promise<ChargebeeResponse<AddItemEntitlementsResponse>>;
34
+
35
+ upsertOrRemoveItemEntitlementsForItem(
36
+ item_id: string,
37
+ input: UpsertOrRemoveItemEntitlementsForItemInputParam,
38
+ headers?: ChargebeeRequestHeader,
39
+ ): Promise<
40
+ ChargebeeResponse<UpsertOrRemoveItemEntitlementsForItemResponse>
41
+ >;
113
42
  }
114
- export interface ItemEntitlementsForItemResponse {
115
- /**
116
- * @description **Deprecated**
117
43
 
118
- This endpoint remains operational, but we recommend transitioning to its successor: [List entitlements](entitlements?prod_cat_ver&#x3D;2#list_all_entitlements).
119
- Retrieves a list of all the &#x60;item_entitlements&#x60; for the &#x60;item&#x60; specified.
120
-
121
- */
122
-
123
- list:{item_entitlement:ItemEntitlement}[];
124
-
125
- /**
126
- * @description **Deprecated**
127
-
128
- This endpoint remains operational, but we recommend transitioning to its successor: [List entitlements](entitlements?prod_cat_ver&#x3D;2#list_all_entitlements).
129
- Retrieves a list of all the &#x60;item_entitlements&#x60; for the &#x60;item&#x60; specified.
130
-
131
- */
132
-
133
- next_offset?:string;
44
+ export interface ItemEntitlementsForItemResponse {
45
+ list: { item_entitlement: ItemEntitlement }[];
46
+ next_offset?: string;
134
47
  }
135
- export interface ItemEntitlementsForItemInputParam {
136
- [key : string]: any;
137
- /**
138
- * @description **Deprecated**
139
-
140
- This endpoint remains operational, but we recommend transitioning to its successor: [List entitlements](entitlements?prod_cat_ver&#x3D;2#list_all_entitlements).
141
- Retrieves a list of all the &#x60;item_entitlements&#x60; for the &#x60;item&#x60; specified.
142
48
 
143
- */
144
-
145
- limit?:number;
146
-
147
- /**
148
- * @description **Deprecated**
49
+ export interface ItemEntitlementsForFeatureResponse {
50
+ list: { item_entitlement: ItemEntitlement }[];
51
+ next_offset?: string;
52
+ }
149
53
 
150
- This endpoint remains operational, but we recommend transitioning to its successor: [List entitlements](entitlements?prod_cat_ver&#x3D;2#list_all_entitlements).
151
- Retrieves a list of all the &#x60;item_entitlements&#x60; for the &#x60;item&#x60; specified.
54
+ export interface AddItemEntitlementsResponse {
55
+ item_entitlement: ItemEntitlement;
56
+ }
152
57
 
153
- */
154
-
155
- offset?:string;
58
+ export interface UpsertOrRemoveItemEntitlementsForItemResponse {
59
+ item_entitlement: ItemEntitlement;
156
60
  }
157
- export interface ItemEntitlementsForFeatureResponse {
158
- /**
159
- * @description **Deprecated**
160
61
 
161
- This endpoint remains operational, but we recommend transitioning to its successor: [List entitlements](entitlements?prod_cat_ver&#x3D;2#list_all_entitlements).
162
- Retrieves a list of all the &#x60;item_entitlement&#x60;s for the &#x60;feature&#x60; specified.
62
+ // REQUEST PARAMS
63
+ //---------------
163
64
 
164
- */
165
-
166
- list:{item_entitlement:ItemEntitlement}[];
167
-
168
- /**
169
- * @description **Deprecated**
65
+ export interface ItemEntitlementsForItemInputParam {
66
+ limit?: number;
67
+ offset?: string /**
68
+ * @deprecated Please refer API docs to use other attributes
69
+ */;
170
70
 
171
- This endpoint remains operational, but we recommend transitioning to its successor: [List entitlements](entitlements?prod_cat_ver&#x3D;2#list_all_entitlements).
172
- Retrieves a list of all the &#x60;item_entitlement&#x60;s for the &#x60;feature&#x60; specified.
71
+ include_drafts?: boolean /**
72
+ * @deprecated Please refer API docs to use other attributes
73
+ */;
173
74
 
174
- */
175
-
176
- next_offset?:string;
75
+ embed?: string;
177
76
  }
178
77
  export interface ItemEntitlementsForFeatureInputParam {
179
- [key : string]: any;
180
- /**
181
- * @description **Deprecated**
182
-
183
- This endpoint remains operational, but we recommend transitioning to its successor: [List entitlements](entitlements?prod_cat_ver&#x3D;2#list_all_entitlements).
184
- Retrieves a list of all the &#x60;item_entitlement&#x60;s for the &#x60;feature&#x60; specified.
185
-
186
- */
187
-
188
- limit?:number;
189
-
190
- /**
191
- * @description **Deprecated**
78
+ limit?: number;
79
+ offset?: string /**
80
+ * @deprecated Please refer API docs to use other attributes
81
+ */;
192
82
 
193
- This endpoint remains operational, but we recommend transitioning to its successor: [List entitlements](entitlements?prod_cat_ver&#x3D;2#list_all_entitlements).
194
- Retrieves a list of all the &#x60;item_entitlement&#x60;s for the &#x60;feature&#x60; specified.
195
-
196
- */
197
-
198
- offset?:string;
199
- }
200
- export interface AddItemEntitlementsResponse {
201
- item_entitlement:ItemEntitlement;
83
+ include_drafts?: boolean;
202
84
  }
203
85
  export interface AddItemEntitlementsInputParam {
204
-
205
- /**
206
- * @description The specific action to be performed for each &#x60;item_entitlement&#x60; specified. \* remove - Deletes the &#x60;item_entitlement&#x60; for the &#x60;feature_id&#x60; and &#x60;item_id&#x60; combination, if it exists. \* upsert - If the &#x60;item_entitlement&#x60; already exists for the &#x60;feature_id&#x60; and &#x60;item_id&#x60; combination, the &#x60;value&#x60; of the &#x60;item_entitlement&#x60; is updated. If it doesn&#x27;t exist, a new &#x60;item_entitelment&#x60; is created.
207
-
208
- */
209
-
210
- action:Action;
211
-
212
- /**
213
- * @description Parameters for item_entitlements
214
-
215
- */
216
-
217
- item_entitlements?:{item_id:string,item_type?:'item' | 'charge' | 'addon' | 'subscription' | 'plan',value?:string}[];
218
- }
219
- export interface UpsertOrRemoveItemEntitlementsForItemResponse {
220
- item_entitlement:ItemEntitlement;
86
+ action: Action;
87
+ item_entitlements?: ItemEntitlementsAddItemEntitlementsInputParam[];
221
88
  }
222
89
  export interface UpsertOrRemoveItemEntitlementsForItemInputParam {
223
-
224
- /**
225
- * @description The specific action to be performed for each &#x60;item_entitlement&#x60; specified. \* remove - Deletes the &#x60;item_entitlement&#x60; for the &#x60;feature_id&#x60; and &#x60;item_id&#x60; combination, if it exists. \* upsert - If the &#x60;item_entitlement&#x60; already exists for the &#x60;feature_id&#x60; and &#x60;item_id&#x60; combination, the &#x60;value&#x60; of the &#x60;item_entitlement&#x60; is updated. If it doesn&#x27;t exist, a new &#x60;item_entitelment&#x60; is created.
226
-
227
- */
228
-
229
- action:Action;
230
-
231
- /**
232
- * @description Parameters for item_entitlements
233
-
234
- */
235
-
236
- item_entitlements?:{feature_id:string,value?:string}[];
90
+ action: Action;
91
+ item_entitlements?: ItemEntitlementsUpsertOrRemoveItemEntitlementsForItemInputParam[];
92
+ }
93
+ export interface ItemEntitlementsAddItemEntitlementsInputParam {
94
+ item_id: string;
95
+ item_type?: 'plan' | 'addon' | 'charge' | 'subscription' | 'item';
96
+ value?: string;
97
+ }
98
+ export interface ItemEntitlementsUpsertOrRemoveItemEntitlementsForItemInputParam {
99
+ feature_id: string;
100
+ value?: string;
237
101
  }
238
-
239
102
  }
240
- }
103
+ }
@@ -1,198 +1,89 @@
1
1
  ///<reference path='./../core.d.ts'/>
2
+ ///<reference path='./../index.d.ts'/>
3
+ ///<reference path='./filter.d.ts'/>
2
4
  declare module 'chargebee' {
3
5
  export interface ItemFamily {
4
- [key : string] : any;
5
- /**
6
- * @description The identifier for the item family. It is unique and immutable.
7
-
8
- */
9
-
10
- id:string;
11
-
12
- /**
13
- * @description A unique display name for the item family. This is visible only in Chargebee and not to customers.
14
-
15
- */
16
-
17
- name:string;
18
-
19
- /**
20
- * @description Description of the item family. This is visible only in Chargebee and not to customers.
21
-
22
- */
23
-
24
- description?:string;
25
-
26
- /**
27
- * @description Status of the item family. \* active - The item family is active and can be used to create new items. \* deleted - The item family has been deleted and cannot be used to create new items. The &#x60;id&#x60; and &#x60;name&#x60; can be reused to create a new item family.
28
-
29
- */
30
-
31
- status?:'deleted' | 'active';
32
-
33
- /**
34
- * @description The version number of this resource. For every change made to the resource, &#x60;resource_version&#x60; is updated with a new timestamp in milliseconds.
35
-
36
- */
37
-
38
- resource_version?:number;
39
-
40
- /**
41
- * @description When the item family was last updated.
42
-
43
- */
44
-
45
- updated_at?:number;
46
-
47
- /**
48
- * @description The subscription channel this object originated from and is maintained in. \* app_store - The object data is synchronized with data from [in-app subscription(s)](https://apidocs.chargebee.com/docs/api/in_app_subscriptions) created in Apple App Store. Direct manipulation of this object via UI or API is disallowed. \* play_store - The object data is synchronized with data from [in-app subscription(s)](https://apidocs.chargebee.com/docs/api/in_app_subscriptions) created in Google Play Store. Direct manipulation of this object via UI or API is disallowed. \* web - The object was created (and is maintained) for the web channel directly in Chargebee via API or UI.
49
-
50
- */
51
-
52
- channel?:Channel;
6
+ [key: string]: unknown;
7
+ id: string;
8
+ name: string;
9
+ description?: string;
10
+ status?: 'active' | 'deleted';
11
+ resource_version?: number;
12
+ updated_at?: number;
13
+ channel?: Channel;
53
14
  }
54
- export namespace ItemFamily {
55
- export class ItemFamilyResource {
56
- /**
57
- * @description This endpoint creates an item family for your product line or service.
58
-
59
- */
60
-
61
- create(input:CreateInputParam):ChargebeeRequest<CreateResponse>;
62
-
63
- /**
64
- * @description This endpoint retrieves an item family based on the item family id.
65
-
66
- */
67
-
68
- retrieve(item_family_id:string):ChargebeeRequest<RetrieveResponse>;
69
-
70
- /**
71
- * @description Returns a list of item families satisfying **all** the conditions specified in the filter parameters below. The list is sorted by date of creation, in descending order.
72
-
73
- */
74
-
75
- list(input?:ListInputParam):ChargebeeRequest<ListResponse>;
76
-
77
- /**
78
- * @description This endpoint updates the name and/or description of the item family.
79
15
 
80
- */
81
-
82
- update(item_family_id:string, input?:UpdateInputParam):ChargebeeRequest<UpdateResponse>;
83
-
84
- /**
85
- * @description Deletes an item family, marking its &#x60;status&#x60; as &#x60;deleted&#x60;. This is not allowed if there are &#x60;active&#x60; items under the item family. Once deleted, the &#x60;id&#x60; and &#x60;name&#x60; of the item family can be reused to create a new item family.
86
-
87
- */
88
-
89
- delete(item_family_id:string):ChargebeeRequest<DeleteResponse>;
90
- }
91
- export interface CreateResponse {
92
- item_family:ItemFamily;
16
+ export namespace ItemFamily {
17
+ export class ItemFamilyResource {
18
+ create(
19
+ input: CreateInputParam,
20
+ headers?: ChargebeeRequestHeader,
21
+ ): Promise<ChargebeeResponse<CreateResponse>>;
22
+
23
+ retrieve(
24
+ item_family_id: string,
25
+ headers?: ChargebeeRequestHeader,
26
+ ): Promise<ChargebeeResponse<RetrieveResponse>>;
27
+
28
+ list(
29
+ input?: ListInputParam,
30
+ headers?: ChargebeeRequestHeader,
31
+ ): Promise<ChargebeeResponse<ListResponse>>;
32
+
33
+ update(
34
+ item_family_id: string,
35
+ input?: UpdateInputParam,
36
+ headers?: ChargebeeRequestHeader,
37
+ ): Promise<ChargebeeResponse<UpdateResponse>>;
38
+
39
+ delete(
40
+ item_family_id: string,
41
+ headers?: ChargebeeRequestHeader,
42
+ ): Promise<ChargebeeResponse<DeleteResponse>>;
93
43
  }
94
- export interface CreateInputParam {
95
- [key : string] : any;
96
- /**
97
- * @description The identifier for the item family. Must be unique and is immutable.
98
-
99
- */
100
-
101
- id:string;
102
-
103
- /**
104
- * @description The display name for the item family. Must be unique. This is visible only in Chargebee and not to customers.
105
44
 
106
- */
107
-
108
- name:string;
109
-
110
- /**
111
- * @description Description of the item family. This is visible only in Chargebee and not to customers.
112
-
113
- */
114
-
115
- description?:string;
116
- }
117
- export interface RetrieveResponse {
118
- item_family:ItemFamily;
45
+ export interface CreateResponse {
46
+ item_family: ItemFamily;
119
47
  }
120
-
121
- export interface ListResponse {
122
- /**
123
- * @description Returns a list of item families satisfying **all** the conditions specified in the filter parameters below. The list is sorted by date of creation, in descending order.
124
48
 
125
- */
126
-
127
- list:{item_family:ItemFamily}[];
128
-
129
- /**
130
- * @description Returns a list of item families satisfying **all** the conditions specified in the filter parameters below. The list is sorted by date of creation, in descending order.
131
-
132
- */
133
-
134
- next_offset?:string;
49
+ export interface RetrieveResponse {
50
+ item_family: ItemFamily;
135
51
  }
136
- export interface ListInputParam {
137
- [key : string]: any;
138
- /**
139
- * @description Returns a list of item families satisfying **all** the conditions specified in the filter parameters below. The list is sorted by date of creation, in descending order.
140
52
 
141
- */
142
-
143
- limit?:number;
144
-
145
- /**
146
- * @description Returns a list of item families satisfying **all** the conditions specified in the filter parameters below. The list is sorted by date of creation, in descending order.
53
+ export interface ListResponse {
54
+ list: { item_family: ItemFamily }[];
55
+ next_offset?: string;
56
+ }
147
57
 
148
- */
149
-
150
- offset?:string;
151
-
152
- /**
153
- * @description Returns a list of item families satisfying **all** the conditions specified in the filter parameters below. The list is sorted by date of creation, in descending order.
58
+ export interface UpdateResponse {
59
+ item_family: ItemFamily;
60
+ }
154
61
 
155
- */
156
-
157
- id?:{in?:string,is?:string,is_not?:string,not_in?:string,starts_with?:string};
158
-
159
- /**
160
- * @description Returns a list of item families satisfying **all** the conditions specified in the filter parameters below. The list is sorted by date of creation, in descending order.
62
+ export interface DeleteResponse {
63
+ item_family: ItemFamily;
64
+ }
161
65
 
162
- */
163
-
164
- name?:{is?:string,is_not?:string,starts_with?:string};
165
-
166
- /**
167
- * @description Returns a list of item families satisfying **all** the conditions specified in the filter parameters below. The list is sorted by date of creation, in descending order.
66
+ // REQUEST PARAMS
67
+ //---------------
168
68
 
169
- */
170
-
171
- updated_at?:{after?:string,before?:string,between?:string,on?:string};
69
+ export interface CreateInputParam {
70
+ id: string;
71
+ name: string;
72
+ description?: string;
73
+ [key: string]: unknown;
172
74
  }
173
- export interface UpdateResponse {
174
- item_family:ItemFamily;
75
+ export interface ListInputParam {
76
+ limit?: number;
77
+ offset?: string;
78
+ id?: filter.String;
79
+ name?: filter.String;
80
+ updated_at?: filter.Timestamp;
81
+ [key: string]: unknown;
175
82
  }
176
83
  export interface UpdateInputParam {
177
- [key : string] : any;
178
- /**
179
- * @description The display name for the item family. Must be unique. This is visible only in Chargebee and not to customers.
180
-
181
- */
182
-
183
- name?:string;
184
-
185
- /**
186
- * @description Description of the item family. This is visible only in Chargebee and not to customers.
187
-
188
- */
189
-
190
- description?:string;
191
- }
192
- export interface DeleteResponse {
193
- item_family:ItemFamily;
84
+ name?: string;
85
+ description?: string;
86
+ [key: string]: unknown;
194
87
  }
195
-
196
-
197
88
  }
198
- }
89
+ }