dodopayments 2.23.2 → 2.24.0

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 (142) hide show
  1. package/CHANGELOG.md +46 -0
  2. package/bin/migration-config.json +187 -0
  3. package/client.d.mts +6 -0
  4. package/client.d.mts.map +1 -1
  5. package/client.d.ts +6 -0
  6. package/client.d.ts.map +1 -1
  7. package/client.js +9 -2
  8. package/client.js.map +1 -1
  9. package/client.mjs +9 -2
  10. package/client.mjs.map +1 -1
  11. package/package.json +12 -1
  12. package/resources/checkout-sessions.d.mts +17 -2
  13. package/resources/checkout-sessions.d.mts.map +1 -1
  14. package/resources/checkout-sessions.d.ts +17 -2
  15. package/resources/checkout-sessions.d.ts.map +1 -1
  16. package/resources/customers/customer-portal.d.mts +5 -0
  17. package/resources/customers/customer-portal.d.mts.map +1 -1
  18. package/resources/customers/customer-portal.d.ts +5 -0
  19. package/resources/customers/customer-portal.d.ts.map +1 -1
  20. package/resources/customers/customer-portal.js +2 -2
  21. package/resources/customers/customer-portal.js.map +1 -1
  22. package/resources/customers/customer-portal.mjs +2 -2
  23. package/resources/customers/customer-portal.mjs.map +1 -1
  24. package/resources/customers/customers.d.mts +5 -0
  25. package/resources/customers/customers.d.mts.map +1 -1
  26. package/resources/customers/customers.d.ts +5 -0
  27. package/resources/customers/customers.d.ts.map +1 -1
  28. package/resources/customers/customers.js.map +1 -1
  29. package/resources/customers/customers.mjs.map +1 -1
  30. package/resources/index.d.mts +2 -0
  31. package/resources/index.d.mts.map +1 -1
  32. package/resources/index.d.ts +2 -0
  33. package/resources/index.d.ts.map +1 -1
  34. package/resources/index.js +5 -1
  35. package/resources/index.js.map +1 -1
  36. package/resources/index.mjs +2 -0
  37. package/resources/index.mjs.map +1 -1
  38. package/resources/invoices/payments.d.mts +1 -0
  39. package/resources/invoices/payments.d.mts.map +1 -1
  40. package/resources/invoices/payments.d.ts +1 -0
  41. package/resources/invoices/payments.d.ts.map +1 -1
  42. package/resources/invoices/payments.js +7 -0
  43. package/resources/invoices/payments.js.map +1 -1
  44. package/resources/invoices/payments.mjs +7 -0
  45. package/resources/invoices/payments.mjs.map +1 -1
  46. package/resources/payments.d.mts +5 -0
  47. package/resources/payments.d.mts.map +1 -1
  48. package/resources/payments.d.ts +5 -0
  49. package/resources/payments.d.ts.map +1 -1
  50. package/resources/product-collections/groups/groups.d.mts +107 -0
  51. package/resources/product-collections/groups/groups.d.mts.map +1 -0
  52. package/resources/product-collections/groups/groups.d.ts +107 -0
  53. package/resources/product-collections/groups/groups.d.ts.map +1 -0
  54. package/resources/product-collections/groups/groups.js +37 -0
  55. package/resources/product-collections/groups/groups.js.map +1 -0
  56. package/resources/product-collections/groups/groups.mjs +32 -0
  57. package/resources/product-collections/groups/groups.mjs.map +1 -0
  58. package/resources/product-collections/groups/index.d.mts +3 -0
  59. package/resources/product-collections/groups/index.d.mts.map +1 -0
  60. package/resources/product-collections/groups/index.d.ts +3 -0
  61. package/resources/product-collections/groups/index.d.ts.map +1 -0
  62. package/resources/product-collections/groups/index.js +9 -0
  63. package/resources/product-collections/groups/index.js.map +1 -0
  64. package/resources/product-collections/groups/index.mjs +4 -0
  65. package/resources/product-collections/groups/index.mjs.map +1 -0
  66. package/resources/product-collections/groups/items.d.mts +91 -0
  67. package/resources/product-collections/groups/items.d.mts.map +1 -0
  68. package/resources/product-collections/groups/items.d.ts +91 -0
  69. package/resources/product-collections/groups/items.d.ts.map +1 -0
  70. package/resources/product-collections/groups/items.js +30 -0
  71. package/resources/product-collections/groups/items.js.map +1 -0
  72. package/resources/product-collections/groups/items.mjs +26 -0
  73. package/resources/product-collections/groups/items.mjs.map +1 -0
  74. package/resources/product-collections/groups.d.mts +2 -0
  75. package/resources/product-collections/groups.d.mts.map +1 -0
  76. package/resources/product-collections/groups.d.ts +2 -0
  77. package/resources/product-collections/groups.d.ts.map +1 -0
  78. package/resources/product-collections/groups.js +6 -0
  79. package/resources/product-collections/groups.js.map +1 -0
  80. package/resources/product-collections/groups.mjs +3 -0
  81. package/resources/product-collections/groups.mjs.map +1 -0
  82. package/resources/product-collections/index.d.mts +3 -0
  83. package/resources/product-collections/index.d.mts.map +1 -0
  84. package/resources/product-collections/index.d.ts +3 -0
  85. package/resources/product-collections/index.d.ts.map +1 -0
  86. package/resources/product-collections/index.js +9 -0
  87. package/resources/product-collections/index.js.map +1 -0
  88. package/resources/product-collections/index.mjs +4 -0
  89. package/resources/product-collections/index.mjs.map +1 -0
  90. package/resources/product-collections/product-collections.d.mts +307 -0
  91. package/resources/product-collections/product-collections.d.mts.map +1 -0
  92. package/resources/product-collections/product-collections.d.ts +307 -0
  93. package/resources/product-collections/product-collections.d.ts.map +1 -0
  94. package/resources/product-collections/product-collections.js +49 -0
  95. package/resources/product-collections/product-collections.js.map +1 -0
  96. package/resources/product-collections/product-collections.mjs +44 -0
  97. package/resources/product-collections/product-collections.mjs.map +1 -0
  98. package/resources/product-collections.d.mts +2 -0
  99. package/resources/product-collections.d.mts.map +1 -0
  100. package/resources/product-collections.d.ts +2 -0
  101. package/resources/product-collections.d.ts.map +1 -0
  102. package/resources/product-collections.js +6 -0
  103. package/resources/product-collections.js.map +1 -0
  104. package/resources/product-collections.mjs +3 -0
  105. package/resources/product-collections.mjs.map +1 -0
  106. package/resources/subscriptions.d.mts +147 -3
  107. package/resources/subscriptions.d.mts.map +1 -1
  108. package/resources/subscriptions.d.ts +147 -3
  109. package/resources/subscriptions.d.ts.map +1 -1
  110. package/resources/subscriptions.js +6 -0
  111. package/resources/subscriptions.js.map +1 -1
  112. package/resources/subscriptions.mjs +6 -0
  113. package/resources/subscriptions.mjs.map +1 -1
  114. package/resources/your-webhook-url.d.mts +85 -0
  115. package/resources/your-webhook-url.d.mts.map +1 -0
  116. package/resources/your-webhook-url.d.ts +85 -0
  117. package/resources/your-webhook-url.d.ts.map +1 -0
  118. package/resources/your-webhook-url.js +26 -0
  119. package/resources/your-webhook-url.js.map +1 -0
  120. package/resources/your-webhook-url.mjs +22 -0
  121. package/resources/your-webhook-url.mjs.map +1 -0
  122. package/src/client.ts +37 -2
  123. package/src/resources/checkout-sessions.ts +20 -2
  124. package/src/resources/customers/customer-portal.ts +8 -2
  125. package/src/resources/customers/customers.ts +5 -0
  126. package/src/resources/index.ts +14 -0
  127. package/src/resources/invoices/payments.ts +8 -0
  128. package/src/resources/payments.ts +5 -0
  129. package/src/resources/product-collections/groups/groups.ts +174 -0
  130. package/src/resources/product-collections/groups/index.ts +16 -0
  131. package/src/resources/product-collections/groups/items.ts +149 -0
  132. package/src/resources/product-collections/groups.ts +3 -0
  133. package/src/resources/product-collections/index.ts +22 -0
  134. package/src/resources/product-collections/product-collections.ts +472 -0
  135. package/src/resources/product-collections.ts +3 -0
  136. package/src/resources/subscriptions.ts +193 -3
  137. package/src/resources/your-webhook-url.ts +138 -0
  138. package/src/version.ts +1 -1
  139. package/version.d.mts +1 -1
  140. package/version.d.ts +1 -1
  141. package/version.js +1 -1
  142. package/version.mjs +1 -1
@@ -0,0 +1,174 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as MiscAPI from '../../misc';
5
+ import * as ProductsAPI from '../../products/products';
6
+ import * as ItemsAPI from './items';
7
+ import { ItemCreateParams, ItemCreateResponse, ItemDeleteParams, ItemUpdateParams, Items } from './items';
8
+ import { APIPromise } from '../../../core/api-promise';
9
+ import { buildHeaders } from '../../../internal/headers';
10
+ import { RequestOptions } from '../../../internal/request-options';
11
+ import { path } from '../../../internal/utils/path';
12
+
13
+ export class Groups extends APIResource {
14
+ items: ItemsAPI.Items = new ItemsAPI.Items(this._client);
15
+
16
+ create(id: string, body: GroupCreateParams, options?: RequestOptions): APIPromise<GroupCreateResponse> {
17
+ return this._client.post(path`/product-collections/${id}/groups`, { body, ...options });
18
+ }
19
+
20
+ update(groupID: string, params: GroupUpdateParams, options?: RequestOptions): APIPromise<void> {
21
+ const { id, ...body } = params;
22
+ return this._client.patch(path`/product-collections/${id}/groups/${groupID}`, {
23
+ body,
24
+ ...options,
25
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
26
+ });
27
+ }
28
+
29
+ delete(groupID: string, params: GroupDeleteParams, options?: RequestOptions): APIPromise<void> {
30
+ const { id } = params;
31
+ return this._client.delete(path`/product-collections/${id}/groups/${groupID}`, {
32
+ ...options,
33
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
34
+ });
35
+ }
36
+ }
37
+
38
+ export interface GroupCreateResponse {
39
+ group_id: string;
40
+
41
+ products: Array<GroupCreateResponse.Product>;
42
+
43
+ status: boolean;
44
+
45
+ group_name?: string | null;
46
+ }
47
+
48
+ export namespace GroupCreateResponse {
49
+ export interface Product {
50
+ id: string;
51
+
52
+ addons_count: number;
53
+
54
+ files_count: number;
55
+
56
+ /**
57
+ * Whether this product has any credit entitlements attached
58
+ */
59
+ has_credit_entitlements: boolean;
60
+
61
+ is_recurring: boolean;
62
+
63
+ license_key_enabled: boolean;
64
+
65
+ meters_count: number;
66
+
67
+ product_id: string;
68
+
69
+ status: boolean;
70
+
71
+ currency?: MiscAPI.Currency | null;
72
+
73
+ description?: string | null;
74
+
75
+ name?: string | null;
76
+
77
+ price?: number | null;
78
+
79
+ /**
80
+ * One-time price details.
81
+ */
82
+ price_detail?: ProductsAPI.Price | null;
83
+
84
+ /**
85
+ * Represents the different categories of taxation applicable to various products
86
+ * and services.
87
+ */
88
+ tax_category?: MiscAPI.TaxCategory | null;
89
+
90
+ tax_inclusive?: boolean | null;
91
+ }
92
+ }
93
+
94
+ export interface GroupCreateParams {
95
+ /**
96
+ * Products in this group
97
+ */
98
+ products: Array<GroupCreateParams.Product>;
99
+
100
+ /**
101
+ * Optional group name. Multiple groups can have null names, but named groups must
102
+ * be unique per collection
103
+ */
104
+ group_name?: string | null;
105
+
106
+ /**
107
+ * Status of the group (defaults to true if not provided)
108
+ */
109
+ status?: boolean | null;
110
+ }
111
+
112
+ export namespace GroupCreateParams {
113
+ export interface Product {
114
+ /**
115
+ * Product ID to include in the group
116
+ */
117
+ product_id: string;
118
+
119
+ /**
120
+ * Status of the product in this group (defaults to true if not provided)
121
+ */
122
+ status?: boolean | null;
123
+ }
124
+ }
125
+
126
+ export interface GroupUpdateParams {
127
+ /**
128
+ * Path param: Product Collection Id
129
+ */
130
+ id: string;
131
+
132
+ /**
133
+ * Body param: Optional group name update: Some(Some(name)) = set name, Some(None)
134
+ * = clear name, None = no change
135
+ */
136
+ group_name?: string | null;
137
+
138
+ /**
139
+ * Body param: Optional new order for products in this group (array of
140
+ * product_collection_group_pdts UUIDs)
141
+ */
142
+ product_order?: Array<string> | null;
143
+
144
+ /**
145
+ * Body param: Optional status update
146
+ */
147
+ status?: boolean | null;
148
+ }
149
+
150
+ export interface GroupDeleteParams {
151
+ /**
152
+ * Product Collection Id
153
+ */
154
+ id: string;
155
+ }
156
+
157
+ Groups.Items = Items;
158
+
159
+ export declare namespace Groups {
160
+ export {
161
+ type GroupCreateResponse as GroupCreateResponse,
162
+ type GroupCreateParams as GroupCreateParams,
163
+ type GroupUpdateParams as GroupUpdateParams,
164
+ type GroupDeleteParams as GroupDeleteParams,
165
+ };
166
+
167
+ export {
168
+ Items as Items,
169
+ type ItemCreateResponse as ItemCreateResponse,
170
+ type ItemCreateParams as ItemCreateParams,
171
+ type ItemUpdateParams as ItemUpdateParams,
172
+ type ItemDeleteParams as ItemDeleteParams,
173
+ };
174
+ }
@@ -0,0 +1,16 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ Groups,
5
+ type GroupCreateResponse,
6
+ type GroupCreateParams,
7
+ type GroupUpdateParams,
8
+ type GroupDeleteParams,
9
+ } from './groups';
10
+ export {
11
+ Items,
12
+ type ItemCreateResponse,
13
+ type ItemCreateParams,
14
+ type ItemUpdateParams,
15
+ type ItemDeleteParams,
16
+ } from './items';
@@ -0,0 +1,149 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ import { APIResource } from '../../../core/resource';
4
+ import * as MiscAPI from '../../misc';
5
+ import * as ProductsAPI from '../../products/products';
6
+ import { APIPromise } from '../../../core/api-promise';
7
+ import { buildHeaders } from '../../../internal/headers';
8
+ import { RequestOptions } from '../../../internal/request-options';
9
+ import { path } from '../../../internal/utils/path';
10
+
11
+ export class Items extends APIResource {
12
+ create(
13
+ groupID: string,
14
+ params: ItemCreateParams,
15
+ options?: RequestOptions,
16
+ ): APIPromise<ItemCreateResponse> {
17
+ const { id, ...body } = params;
18
+ return this._client.post(path`/product-collections/${id}/groups/${groupID}/items`, { body, ...options });
19
+ }
20
+
21
+ update(itemID: string, params: ItemUpdateParams, options?: RequestOptions): APIPromise<void> {
22
+ const { id, group_id, ...body } = params;
23
+ return this._client.patch(path`/product-collections/${id}/groups/${group_id}/items/${itemID}`, {
24
+ body,
25
+ ...options,
26
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
27
+ });
28
+ }
29
+
30
+ delete(itemID: string, params: ItemDeleteParams, options?: RequestOptions): APIPromise<void> {
31
+ const { id, group_id } = params;
32
+ return this._client.delete(path`/product-collections/${id}/groups/${group_id}/items/${itemID}`, {
33
+ ...options,
34
+ headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
35
+ });
36
+ }
37
+ }
38
+
39
+ export type ItemCreateResponse = Array<ItemCreateResponse.ItemCreateResponseItem>;
40
+
41
+ export namespace ItemCreateResponse {
42
+ export interface ItemCreateResponseItem {
43
+ id: string;
44
+
45
+ addons_count: number;
46
+
47
+ files_count: number;
48
+
49
+ /**
50
+ * Whether this product has any credit entitlements attached
51
+ */
52
+ has_credit_entitlements: boolean;
53
+
54
+ is_recurring: boolean;
55
+
56
+ license_key_enabled: boolean;
57
+
58
+ meters_count: number;
59
+
60
+ product_id: string;
61
+
62
+ status: boolean;
63
+
64
+ currency?: MiscAPI.Currency | null;
65
+
66
+ description?: string | null;
67
+
68
+ name?: string | null;
69
+
70
+ price?: number | null;
71
+
72
+ /**
73
+ * One-time price details.
74
+ */
75
+ price_detail?: ProductsAPI.Price | null;
76
+
77
+ /**
78
+ * Represents the different categories of taxation applicable to various products
79
+ * and services.
80
+ */
81
+ tax_category?: MiscAPI.TaxCategory | null;
82
+
83
+ tax_inclusive?: boolean | null;
84
+ }
85
+ }
86
+
87
+ export interface ItemCreateParams {
88
+ /**
89
+ * Path param: Product Collection Id
90
+ */
91
+ id: string;
92
+
93
+ /**
94
+ * Body param: Products to add to the group
95
+ */
96
+ products: Array<ItemCreateParams.Product>;
97
+ }
98
+
99
+ export namespace ItemCreateParams {
100
+ export interface Product {
101
+ /**
102
+ * Product ID to include in the group
103
+ */
104
+ product_id: string;
105
+
106
+ /**
107
+ * Status of the product in this group (defaults to true if not provided)
108
+ */
109
+ status?: boolean | null;
110
+ }
111
+ }
112
+
113
+ export interface ItemUpdateParams {
114
+ /**
115
+ * Path param: Product Collection Id
116
+ */
117
+ id: string;
118
+
119
+ /**
120
+ * Path param: Product Collection Group Id
121
+ */
122
+ group_id: string;
123
+
124
+ /**
125
+ * Body param: Status of the product in the group
126
+ */
127
+ status: boolean;
128
+ }
129
+
130
+ export interface ItemDeleteParams {
131
+ /**
132
+ * Product Collection Id
133
+ */
134
+ id: string;
135
+
136
+ /**
137
+ * Product Collection Group Id
138
+ */
139
+ group_id: string;
140
+ }
141
+
142
+ export declare namespace Items {
143
+ export {
144
+ type ItemCreateResponse as ItemCreateResponse,
145
+ type ItemCreateParams as ItemCreateParams,
146
+ type ItemUpdateParams as ItemUpdateParams,
147
+ type ItemDeleteParams as ItemDeleteParams,
148
+ };
149
+ }
@@ -0,0 +1,3 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export * from './groups/index';
@@ -0,0 +1,22 @@
1
+ // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
+
3
+ export {
4
+ Groups,
5
+ type GroupCreateResponse,
6
+ type GroupCreateParams,
7
+ type GroupUpdateParams,
8
+ type GroupDeleteParams,
9
+ } from './groups/index';
10
+ export {
11
+ ProductCollections,
12
+ type ProductCollectionCreateResponse,
13
+ type ProductCollectionRetrieveResponse,
14
+ type ProductCollectionListResponse,
15
+ type ProductCollectionUnarchiveResponse,
16
+ type ProductCollectionUpdateImagesResponse,
17
+ type ProductCollectionCreateParams,
18
+ type ProductCollectionUpdateParams,
19
+ type ProductCollectionListParams,
20
+ type ProductCollectionUpdateImagesParams,
21
+ type ProductCollectionListResponsesDefaultPageNumberPagination,
22
+ } from './product-collections';