orb-billing 1.24.1 → 1.25.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.
- package/CHANGELOG.md +16 -0
- package/error.d.ts +7 -0
- package/error.d.ts.map +1 -1
- package/error.js +26 -12
- package/error.js.map +1 -1
- package/error.mjs +24 -11
- package/error.mjs.map +1 -1
- package/index.d.mts +5 -4
- package/index.d.ts +5 -4
- package/index.d.ts.map +1 -1
- package/index.js +4 -3
- package/index.js.map +1 -1
- package/index.mjs +3 -2
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +2 -2
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/items.d.ts +18 -25
- package/resources/items.d.ts.map +1 -1
- package/resources/items.js +11 -5
- package/resources/items.js.map +1 -1
- package/resources/items.mjs +9 -3
- package/resources/items.mjs.map +1 -1
- package/resources/metrics.d.ts +4 -60
- package/resources/metrics.d.ts.map +1 -1
- package/resources/metrics.js.map +1 -1
- package/resources/metrics.mjs.map +1 -1
- package/src/error.ts +40 -11
- package/src/index.ts +5 -3
- package/src/resources/index.ts +1 -1
- package/src/resources/items.ts +23 -42
- package/src/resources/metrics.ts +4 -99
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/items.ts
CHANGED
|
@@ -7,51 +7,55 @@ import * as ItemsAPI from "./items";
|
|
|
7
7
|
import { Page, type PageParams } from "../pagination";
|
|
8
8
|
|
|
9
9
|
export class Items extends APIResource {
|
|
10
|
+
/**
|
|
11
|
+
* This endpoint is used to create an [Item](../guides/concepts#item).
|
|
12
|
+
*/
|
|
13
|
+
create(body: ItemCreateParams, options?: Core.RequestOptions): Core.APIPromise<Item> {
|
|
14
|
+
return this.post('/items', { body, ...options });
|
|
15
|
+
}
|
|
16
|
+
|
|
10
17
|
/**
|
|
11
18
|
* This endpoint returns a list of all Items, ordered in descending order by
|
|
12
19
|
* creation time.
|
|
13
20
|
*/
|
|
14
|
-
list(
|
|
15
|
-
|
|
16
|
-
options?: Core.RequestOptions,
|
|
17
|
-
): Core.PagePromise<ItemListResponsesPage, ItemListResponse>;
|
|
18
|
-
list(options?: Core.RequestOptions): Core.PagePromise<ItemListResponsesPage, ItemListResponse>;
|
|
21
|
+
list(query?: ItemListParams, options?: Core.RequestOptions): Core.PagePromise<ItemsPage, Item>;
|
|
22
|
+
list(options?: Core.RequestOptions): Core.PagePromise<ItemsPage, Item>;
|
|
19
23
|
list(
|
|
20
24
|
query: ItemListParams | Core.RequestOptions = {},
|
|
21
25
|
options?: Core.RequestOptions,
|
|
22
|
-
): Core.PagePromise<
|
|
26
|
+
): Core.PagePromise<ItemsPage, Item> {
|
|
23
27
|
if (isRequestOptions(query)) {
|
|
24
28
|
return this.list({}, query);
|
|
25
29
|
}
|
|
26
|
-
return this.getAPIList('/items',
|
|
30
|
+
return this.getAPIList('/items', ItemsPage, { query, ...options });
|
|
27
31
|
}
|
|
28
32
|
|
|
29
33
|
/**
|
|
30
34
|
* This endpoint returns an item identified by its item_id.
|
|
31
35
|
*/
|
|
32
|
-
fetch(itemId: string, options?: Core.RequestOptions): Core.APIPromise<
|
|
36
|
+
fetch(itemId: string, options?: Core.RequestOptions): Core.APIPromise<Item> {
|
|
33
37
|
return this.get(`/items/${itemId}`, options);
|
|
34
38
|
}
|
|
35
39
|
}
|
|
36
40
|
|
|
37
|
-
export class
|
|
41
|
+
export class ItemsPage extends Page<Item> {}
|
|
38
42
|
|
|
39
43
|
/**
|
|
40
44
|
* The Item resource represents a sellable product or good. Items are associated
|
|
41
45
|
* with all line items, billable metrics, and prices and are used for defining
|
|
42
46
|
* external sync behavior for invoices and tax calculation purposes.
|
|
43
47
|
*/
|
|
44
|
-
export interface
|
|
48
|
+
export interface Item {
|
|
45
49
|
id: string;
|
|
46
50
|
|
|
47
51
|
created_at: string;
|
|
48
52
|
|
|
49
|
-
external_connections: Array<
|
|
53
|
+
external_connections: Array<Item.ExternalConnection>;
|
|
50
54
|
|
|
51
55
|
name: string;
|
|
52
56
|
}
|
|
53
57
|
|
|
54
|
-
export namespace
|
|
58
|
+
export namespace Item {
|
|
55
59
|
export interface ExternalConnection {
|
|
56
60
|
external_connection_name:
|
|
57
61
|
| 'stripe'
|
|
@@ -66,41 +70,18 @@ export namespace ItemListResponse {
|
|
|
66
70
|
}
|
|
67
71
|
}
|
|
68
72
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
*/
|
|
74
|
-
export interface ItemFetchResponse {
|
|
75
|
-
id: string;
|
|
76
|
-
|
|
77
|
-
created_at: string;
|
|
78
|
-
|
|
79
|
-
external_connections: Array<ItemFetchResponse.ExternalConnection>;
|
|
80
|
-
|
|
73
|
+
export interface ItemCreateParams {
|
|
74
|
+
/**
|
|
75
|
+
* The name of the item.
|
|
76
|
+
*/
|
|
81
77
|
name: string;
|
|
82
78
|
}
|
|
83
79
|
|
|
84
|
-
export namespace ItemFetchResponse {
|
|
85
|
-
export interface ExternalConnection {
|
|
86
|
-
external_connection_name:
|
|
87
|
-
| 'stripe'
|
|
88
|
-
| 'quickbooks'
|
|
89
|
-
| 'bill.com'
|
|
90
|
-
| 'netsuite'
|
|
91
|
-
| 'taxjar'
|
|
92
|
-
| 'avalara'
|
|
93
|
-
| 'anrok';
|
|
94
|
-
|
|
95
|
-
external_entity_id: string;
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
80
|
export interface ItemListParams extends PageParams {}
|
|
100
81
|
|
|
101
82
|
export namespace Items {
|
|
102
|
-
export import
|
|
103
|
-
export import
|
|
104
|
-
export import
|
|
83
|
+
export import Item = ItemsAPI.Item;
|
|
84
|
+
export import ItemsPage = ItemsAPI.ItemsPage;
|
|
85
|
+
export import ItemCreateParams = ItemsAPI.ItemCreateParams;
|
|
105
86
|
export import ItemListParams = ItemsAPI.ItemListParams;
|
|
106
87
|
}
|
package/src/resources/metrics.ts
CHANGED
|
@@ -4,6 +4,7 @@ import * as Core from "../core";
|
|
|
4
4
|
import { APIResource } from "../resource";
|
|
5
5
|
import { isRequestOptions } from "../core";
|
|
6
6
|
import * as MetricsAPI from "./metrics";
|
|
7
|
+
import * as ItemsAPI from "./items";
|
|
7
8
|
import { Page, type PageParams } from "../pagination";
|
|
8
9
|
|
|
9
10
|
export class Metrics extends APIResource {
|
|
@@ -63,7 +64,7 @@ export interface MetricCreateResponse {
|
|
|
63
64
|
* with all line items, billable metrics, and prices and are used for defining
|
|
64
65
|
* external sync behavior for invoices and tax calculation purposes.
|
|
65
66
|
*/
|
|
66
|
-
item:
|
|
67
|
+
item: ItemsAPI.Item;
|
|
67
68
|
|
|
68
69
|
metadata: Record<string, string>;
|
|
69
70
|
|
|
@@ -72,38 +73,6 @@ export interface MetricCreateResponse {
|
|
|
72
73
|
status: 'active' | 'draft' | 'archived';
|
|
73
74
|
}
|
|
74
75
|
|
|
75
|
-
export namespace MetricCreateResponse {
|
|
76
|
-
/**
|
|
77
|
-
* The Item resource represents a sellable product or good. Items are associated
|
|
78
|
-
* with all line items, billable metrics, and prices and are used for defining
|
|
79
|
-
* external sync behavior for invoices and tax calculation purposes.
|
|
80
|
-
*/
|
|
81
|
-
export interface Item {
|
|
82
|
-
id: string;
|
|
83
|
-
|
|
84
|
-
created_at: string;
|
|
85
|
-
|
|
86
|
-
external_connections: Array<Item.ExternalConnection>;
|
|
87
|
-
|
|
88
|
-
name: string;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export namespace Item {
|
|
92
|
-
export interface ExternalConnection {
|
|
93
|
-
external_connection_name:
|
|
94
|
-
| 'stripe'
|
|
95
|
-
| 'quickbooks'
|
|
96
|
-
| 'bill.com'
|
|
97
|
-
| 'netsuite'
|
|
98
|
-
| 'taxjar'
|
|
99
|
-
| 'avalara'
|
|
100
|
-
| 'anrok';
|
|
101
|
-
|
|
102
|
-
external_entity_id: string;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
|
|
107
76
|
/**
|
|
108
77
|
* The Metric resource represents a calculation of a quantity based on events.
|
|
109
78
|
* Metrics are defined by the query that transforms raw usage events into
|
|
@@ -119,7 +88,7 @@ export interface MetricListResponse {
|
|
|
119
88
|
* with all line items, billable metrics, and prices and are used for defining
|
|
120
89
|
* external sync behavior for invoices and tax calculation purposes.
|
|
121
90
|
*/
|
|
122
|
-
item:
|
|
91
|
+
item: ItemsAPI.Item;
|
|
123
92
|
|
|
124
93
|
metadata: Record<string, string>;
|
|
125
94
|
|
|
@@ -128,38 +97,6 @@ export interface MetricListResponse {
|
|
|
128
97
|
status: 'active' | 'draft' | 'archived';
|
|
129
98
|
}
|
|
130
99
|
|
|
131
|
-
export namespace MetricListResponse {
|
|
132
|
-
/**
|
|
133
|
-
* The Item resource represents a sellable product or good. Items are associated
|
|
134
|
-
* with all line items, billable metrics, and prices and are used for defining
|
|
135
|
-
* external sync behavior for invoices and tax calculation purposes.
|
|
136
|
-
*/
|
|
137
|
-
export interface Item {
|
|
138
|
-
id: string;
|
|
139
|
-
|
|
140
|
-
created_at: string;
|
|
141
|
-
|
|
142
|
-
external_connections: Array<Item.ExternalConnection>;
|
|
143
|
-
|
|
144
|
-
name: string;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
export namespace Item {
|
|
148
|
-
export interface ExternalConnection {
|
|
149
|
-
external_connection_name:
|
|
150
|
-
| 'stripe'
|
|
151
|
-
| 'quickbooks'
|
|
152
|
-
| 'bill.com'
|
|
153
|
-
| 'netsuite'
|
|
154
|
-
| 'taxjar'
|
|
155
|
-
| 'avalara'
|
|
156
|
-
| 'anrok';
|
|
157
|
-
|
|
158
|
-
external_entity_id: string;
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
}
|
|
162
|
-
|
|
163
100
|
/**
|
|
164
101
|
* The Metric resource represents a calculation of a quantity based on events.
|
|
165
102
|
* Metrics are defined by the query that transforms raw usage events into
|
|
@@ -175,7 +112,7 @@ export interface MetricFetchResponse {
|
|
|
175
112
|
* with all line items, billable metrics, and prices and are used for defining
|
|
176
113
|
* external sync behavior for invoices and tax calculation purposes.
|
|
177
114
|
*/
|
|
178
|
-
item:
|
|
115
|
+
item: ItemsAPI.Item;
|
|
179
116
|
|
|
180
117
|
metadata: Record<string, string>;
|
|
181
118
|
|
|
@@ -184,38 +121,6 @@ export interface MetricFetchResponse {
|
|
|
184
121
|
status: 'active' | 'draft' | 'archived';
|
|
185
122
|
}
|
|
186
123
|
|
|
187
|
-
export namespace MetricFetchResponse {
|
|
188
|
-
/**
|
|
189
|
-
* The Item resource represents a sellable product or good. Items are associated
|
|
190
|
-
* with all line items, billable metrics, and prices and are used for defining
|
|
191
|
-
* external sync behavior for invoices and tax calculation purposes.
|
|
192
|
-
*/
|
|
193
|
-
export interface Item {
|
|
194
|
-
id: string;
|
|
195
|
-
|
|
196
|
-
created_at: string;
|
|
197
|
-
|
|
198
|
-
external_connections: Array<Item.ExternalConnection>;
|
|
199
|
-
|
|
200
|
-
name: string;
|
|
201
|
-
}
|
|
202
|
-
|
|
203
|
-
export namespace Item {
|
|
204
|
-
export interface ExternalConnection {
|
|
205
|
-
external_connection_name:
|
|
206
|
-
| 'stripe'
|
|
207
|
-
| 'quickbooks'
|
|
208
|
-
| 'bill.com'
|
|
209
|
-
| 'netsuite'
|
|
210
|
-
| 'taxjar'
|
|
211
|
-
| 'avalara'
|
|
212
|
-
| 'anrok';
|
|
213
|
-
|
|
214
|
-
external_entity_id: string;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
218
|
-
|
|
219
124
|
export interface MetricCreateParams {
|
|
220
125
|
/**
|
|
221
126
|
* A description of the metric.
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.25.0'; // x-release-please-version
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.25.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '1.
|
|
1
|
+
export const VERSION = '1.25.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|