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.
@@ -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
- query?: ItemListParams,
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<ItemListResponsesPage, ItemListResponse> {
26
+ ): Core.PagePromise<ItemsPage, Item> {
23
27
  if (isRequestOptions(query)) {
24
28
  return this.list({}, query);
25
29
  }
26
- return this.getAPIList('/items', ItemListResponsesPage, { query, ...options });
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<ItemFetchResponse> {
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 ItemListResponsesPage extends Page<ItemListResponse> {}
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 ItemListResponse {
48
+ export interface Item {
45
49
  id: string;
46
50
 
47
51
  created_at: string;
48
52
 
49
- external_connections: Array<ItemListResponse.ExternalConnection>;
53
+ external_connections: Array<Item.ExternalConnection>;
50
54
 
51
55
  name: string;
52
56
  }
53
57
 
54
- export namespace ItemListResponse {
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
- * The Item resource represents a sellable product or good. Items are associated
71
- * with all line items, billable metrics, and prices and are used for defining
72
- * external sync behavior for invoices and tax calculation purposes.
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 ItemListResponse = ItemsAPI.ItemListResponse;
103
- export import ItemFetchResponse = ItemsAPI.ItemFetchResponse;
104
- export import ItemListResponsesPage = ItemsAPI.ItemListResponsesPage;
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
  }
@@ -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: MetricCreateResponse.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: MetricListResponse.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: MetricFetchResponse.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.24.1'; // x-release-please-version
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.24.1";
1
+ export declare const VERSION = "1.25.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.24.1'; // x-release-please-version
4
+ exports.VERSION = '1.25.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '1.24.1'; // x-release-please-version
1
+ export const VERSION = '1.25.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map