@metronome/sdk 0.1.0-beta.9 → 0.2.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 +194 -0
- package/README.md +30 -46
- package/_shims/index.d.ts +2 -0
- package/_shims/index.js +5 -1
- package/_shims/index.mjs +5 -1
- package/core.d.ts +19 -5
- package/core.d.ts.map +1 -1
- package/core.js +23 -14
- package/core.js.map +1 -1
- package/core.mjs +24 -15
- package/core.mjs.map +1 -1
- package/index.d.mts +3 -2
- package/index.d.ts +3 -2
- package/index.d.ts.map +1 -1
- package/index.js +6 -3
- package/index.js.map +1 -1
- package/index.mjs +6 -3
- package/index.mjs.map +1 -1
- package/package.json +1 -5
- package/pagination.d.ts +1 -0
- package/pagination.d.ts.map +1 -1
- package/pagination.js +3 -0
- package/pagination.js.map +1 -1
- package/pagination.mjs +3 -0
- package/pagination.mjs.map +1 -1
- package/resource.d.ts +1 -1
- package/resource.d.ts.map +1 -1
- package/resource.js.map +1 -1
- package/resource.mjs.map +1 -1
- package/resources/shared.d.ts +521 -37
- package/resources/shared.d.ts.map +1 -1
- package/resources/v1/alerts.d.ts +30 -10
- package/resources/v1/alerts.d.ts.map +1 -1
- package/resources/v1/alerts.js +19 -0
- package/resources/v1/alerts.js.map +1 -1
- package/resources/v1/alerts.mjs +19 -0
- package/resources/v1/alerts.mjs.map +1 -1
- package/resources/v1/audit-logs.d.ts +8 -0
- package/resources/v1/audit-logs.d.ts.map +1 -1
- package/resources/v1/audit-logs.js.map +1 -1
- package/resources/v1/audit-logs.mjs.map +1 -1
- package/resources/v1/billable-metrics.d.ts +58 -3
- package/resources/v1/billable-metrics.d.ts.map +1 -1
- package/resources/v1/billable-metrics.js +41 -0
- package/resources/v1/billable-metrics.js.map +1 -1
- package/resources/v1/billable-metrics.mjs +41 -0
- package/resources/v1/billable-metrics.mjs.map +1 -1
- package/resources/v1/contracts/contracts.d.ts +1556 -122
- package/resources/v1/contracts/contracts.d.ts.map +1 -1
- package/resources/v1/contracts/contracts.js +180 -3
- package/resources/v1/contracts/contracts.js.map +1 -1
- package/resources/v1/contracts/contracts.mjs +180 -3
- package/resources/v1/contracts/contracts.mjs.map +1 -1
- package/resources/v1/contracts/index.d.ts +2 -2
- package/resources/v1/contracts/index.d.ts.map +1 -1
- package/resources/v1/contracts/index.js.map +1 -1
- package/resources/v1/contracts/index.mjs.map +1 -1
- package/resources/v1/contracts/named-schedules.d.ts +21 -0
- package/resources/v1/contracts/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/named-schedules.js +21 -0
- package/resources/v1/contracts/named-schedules.js.map +1 -1
- package/resources/v1/contracts/named-schedules.mjs +21 -0
- package/resources/v1/contracts/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/products.d.ts +51 -3
- package/resources/v1/contracts/products.d.ts.map +1 -1
- package/resources/v1/contracts/products.js +33 -0
- package/resources/v1/contracts/products.js.map +1 -1
- package/resources/v1/contracts/products.mjs +33 -0
- package/resources/v1/contracts/products.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/index.d.ts +1 -1
- package/resources/v1/contracts/rate-cards/index.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/index.js.map +1 -1
- package/resources/v1/contracts/rate-cards/index.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.js +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.js.map +1 -1
- package/resources/v1/contracts/rate-cards/named-schedules.mjs +25 -0
- package/resources/v1/contracts/rate-cards/named-schedules.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.d.ts +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.js +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.js.map +1 -1
- package/resources/v1/contracts/rate-cards/product-orders.mjs +30 -0
- package/resources/v1/contracts/rate-cards/product-orders.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts +107 -10
- package/resources/v1/contracts/rate-cards/rate-cards.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.js +71 -0
- package/resources/v1/contracts/rate-cards/rate-cards.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rate-cards.mjs +71 -0
- package/resources/v1/contracts/rate-cards/rate-cards.mjs.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.d.ts +102 -14
- package/resources/v1/contracts/rate-cards/rates.d.ts.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.js +68 -0
- package/resources/v1/contracts/rate-cards/rates.js.map +1 -1
- package/resources/v1/contracts/rate-cards/rates.mjs +68 -0
- package/resources/v1/contracts/rate-cards/rates.mjs.map +1 -1
- package/resources/v1/credit-grants.d.ts +77 -2
- package/resources/v1/credit-grants.d.ts.map +1 -1
- package/resources/v1/credit-grants.js +39 -2
- package/resources/v1/credit-grants.js.map +1 -1
- package/resources/v1/credit-grants.mjs +39 -2
- package/resources/v1/credit-grants.mjs.map +1 -1
- package/resources/v1/custom-fields.d.ts +51 -7
- package/resources/v1/custom-fields.d.ts.map +1 -1
- package/resources/v1/custom-fields.js +35 -0
- package/resources/v1/custom-fields.js.map +1 -1
- package/resources/v1/custom-fields.mjs +35 -0
- package/resources/v1/custom-fields.mjs.map +1 -1
- package/resources/v1/customers/alerts.d.ts +37 -0
- package/resources/v1/customers/alerts.d.ts.map +1 -1
- package/resources/v1/customers/alerts.js +23 -0
- package/resources/v1/customers/alerts.js.map +1 -1
- package/resources/v1/customers/alerts.mjs +23 -0
- package/resources/v1/customers/alerts.mjs.map +1 -1
- package/resources/v1/customers/billing-config.d.ts +31 -0
- package/resources/v1/customers/billing-config.d.ts.map +1 -1
- package/resources/v1/customers/billing-config.js +27 -0
- package/resources/v1/customers/billing-config.js.map +1 -1
- package/resources/v1/customers/billing-config.mjs +27 -0
- package/resources/v1/customers/billing-config.mjs.map +1 -1
- package/resources/v1/customers/commits.d.ts +94 -7
- package/resources/v1/customers/commits.d.ts.map +1 -1
- package/resources/v1/customers/commits.js +56 -1
- package/resources/v1/customers/commits.js.map +1 -1
- package/resources/v1/customers/commits.mjs +56 -1
- package/resources/v1/customers/commits.mjs.map +1 -1
- package/resources/v1/customers/credits.d.ts +73 -3
- package/resources/v1/customers/credits.d.ts.map +1 -1
- package/resources/v1/customers/credits.js +41 -1
- package/resources/v1/customers/credits.js.map +1 -1
- package/resources/v1/customers/credits.mjs +41 -1
- package/resources/v1/customers/credits.mjs.map +1 -1
- package/resources/v1/customers/customers.d.ts +186 -9
- package/resources/v1/customers/customers.d.ts.map +1 -1
- package/resources/v1/customers/customers.js +106 -1
- package/resources/v1/customers/customers.js.map +1 -1
- package/resources/v1/customers/customers.mjs +106 -1
- package/resources/v1/customers/customers.mjs.map +1 -1
- package/resources/v1/customers/index.d.ts +1 -1
- package/resources/v1/customers/index.d.ts.map +1 -1
- package/resources/v1/customers/index.js.map +1 -1
- package/resources/v1/customers/index.mjs.map +1 -1
- package/resources/v1/customers/invoices.d.ts +144 -52
- package/resources/v1/customers/invoices.d.ts.map +1 -1
- package/resources/v1/customers/invoices.js +49 -0
- package/resources/v1/customers/invoices.js.map +1 -1
- package/resources/v1/customers/invoices.mjs +49 -0
- package/resources/v1/customers/invoices.mjs.map +1 -1
- package/resources/v1/customers/named-schedules.d.ts +21 -0
- package/resources/v1/customers/named-schedules.d.ts.map +1 -1
- package/resources/v1/customers/named-schedules.js +21 -0
- package/resources/v1/customers/named-schedules.js.map +1 -1
- package/resources/v1/customers/named-schedules.mjs +21 -0
- package/resources/v1/customers/named-schedules.mjs.map +1 -1
- package/resources/v1/customers/plans.d.ts +46 -1
- package/resources/v1/customers/plans.d.ts.map +1 -1
- package/resources/v1/customers/plans.js +43 -0
- package/resources/v1/customers/plans.js.map +1 -1
- package/resources/v1/customers/plans.mjs +43 -0
- package/resources/v1/customers/plans.mjs.map +1 -1
- package/resources/v1/dashboards.d.ts +31 -3
- package/resources/v1/dashboards.d.ts.map +1 -1
- package/resources/v1/dashboards.js +26 -0
- package/resources/v1/dashboards.js.map +1 -1
- package/resources/v1/dashboards.mjs +26 -0
- package/resources/v1/dashboards.mjs.map +1 -1
- package/resources/v1/index.d.ts +3 -3
- package/resources/v1/index.d.ts.map +1 -1
- package/resources/v1/index.js.map +1 -1
- package/resources/v1/index.mjs.map +1 -1
- package/resources/v1/invoices.d.ts +14 -0
- package/resources/v1/invoices.d.ts.map +1 -1
- package/resources/v1/invoices.js +14 -0
- package/resources/v1/invoices.js.map +1 -1
- package/resources/v1/invoices.mjs +14 -0
- package/resources/v1/invoices.mjs.map +1 -1
- package/resources/v1/plans.d.ts +47 -4
- package/resources/v1/plans.d.ts.map +1 -1
- package/resources/v1/plans.js +27 -0
- package/resources/v1/plans.js.map +1 -1
- package/resources/v1/plans.mjs +27 -0
- package/resources/v1/plans.mjs.map +1 -1
- package/resources/v1/pricing-units.d.ts +8 -0
- package/resources/v1/pricing-units.d.ts.map +1 -1
- package/resources/v1/pricing-units.js.map +1 -1
- package/resources/v1/pricing-units.mjs.map +1 -1
- package/resources/v1/services.d.ts +5 -0
- package/resources/v1/services.d.ts.map +1 -1
- package/resources/v1/services.js +5 -0
- package/resources/v1/services.js.map +1 -1
- package/resources/v1/services.mjs +5 -0
- package/resources/v1/services.mjs.map +1 -1
- package/resources/v1/usage.d.ts +161 -3
- package/resources/v1/usage.d.ts.map +1 -1
- package/resources/v1/usage.js +46 -0
- package/resources/v1/usage.js.map +1 -1
- package/resources/v1/usage.mjs +46 -0
- package/resources/v1/usage.mjs.map +1 -1
- package/resources/v1/v1.d.ts +6 -6
- package/resources/v1/v1.d.ts.map +1 -1
- package/resources/v1/v1.js.map +1 -1
- package/resources/v1/v1.mjs.map +1 -1
- package/resources/v2/contracts.d.ts +3241 -205
- package/resources/v2/contracts.d.ts.map +1 -1
- package/resources/v2/contracts.js +90 -2
- package/resources/v2/contracts.js.map +1 -1
- package/resources/v2/contracts.mjs +90 -2
- package/resources/v2/contracts.mjs.map +1 -1
- package/resources/webhooks.js +5 -5
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +5 -5
- package/resources/webhooks.mjs.map +1 -1
- package/src/_shims/auto/runtime-bun.ts +1 -1
- package/src/_shims/auto/runtime-node.ts +1 -1
- package/src/_shims/auto/runtime.ts +1 -1
- package/src/_shims/auto/types-node.ts +1 -1
- package/src/_shims/bun-runtime.ts +2 -2
- package/src/_shims/index.d.ts +5 -3
- package/src/_shims/index.js +5 -1
- package/src/_shims/index.mjs +6 -2
- package/src/_shims/node-runtime.ts +3 -3
- package/src/_shims/registry.ts +1 -1
- package/src/_shims/web-runtime.ts +3 -3
- package/src/core.ts +46 -18
- package/src/error.ts +1 -1
- package/src/index.ts +22 -16
- package/src/internal/qs/formats.ts +1 -1
- package/src/internal/qs/index.ts +3 -3
- package/src/internal/qs/stringify.ts +3 -3
- package/src/internal/qs/utils.ts +2 -2
- package/src/pagination.ts +5 -1
- package/src/resource.ts +2 -2
- package/src/resources/index.ts +4 -4
- package/src/resources/shared.ts +605 -40
- package/src/resources/v1/alerts.ts +33 -13
- package/src/resources/v1/audit-logs.ts +12 -4
- package/src/resources/v1/billable-metrics.ts +57 -8
- package/src/resources/v1/contracts/contracts.ts +1723 -135
- package/src/resources/v1/contracts/index.ts +8 -4
- package/src/resources/v1/contracts/named-schedules.ts +23 -2
- package/src/resources/v1/contracts/products.ts +53 -9
- package/src/resources/v1/contracts/rate-cards/index.ts +6 -4
- package/src/resources/v1/contracts/rate-cards/named-schedules.ts +27 -2
- package/src/resources/v1/contracts/rate-cards/product-orders.ts +33 -3
- package/src/resources/v1/contracts/rate-cards/rate-cards.ts +113 -20
- package/src/resources/v1/contracts/rate-cards/rates.ts +86 -18
- package/src/resources/v1/contracts/rate-cards.ts +1 -1
- package/src/resources/v1/contracts.ts +1 -1
- package/src/resources/v1/credit-grants.ts +82 -10
- package/src/resources/v1/custom-fields.ts +57 -9
- package/src/resources/v1/customers/alerts.ts +44 -3
- package/src/resources/v1/customers/billing-config.ts +34 -2
- package/src/resources/v1/customers/commits.ts +97 -10
- package/src/resources/v1/customers/credits.ts +76 -6
- package/src/resources/v1/customers/customers.ts +208 -27
- package/src/resources/v1/customers/index.ts +10 -8
- package/src/resources/v1/customers/invoices.ts +123 -57
- package/src/resources/v1/customers/named-schedules.ts +23 -2
- package/src/resources/v1/customers/plans.ts +48 -5
- package/src/resources/v1/customers.ts +1 -1
- package/src/resources/v1/dashboards.ts +33 -5
- package/src/resources/v1/index.ts +20 -14
- package/src/resources/v1/invoices.ts +16 -2
- package/src/resources/v1/plans.ts +45 -10
- package/src/resources/v1/pricing-units.ts +12 -4
- package/src/resources/v1/services.ts +7 -2
- package/src/resources/v1/usage.ts +187 -6
- package/src/resources/v1/v1.ts +39 -27
- package/src/resources/v1.ts +1 -1
- package/src/resources/v2/contracts.ts +3838 -261
- package/src/resources/v2/index.ts +2 -2
- package/src/resources/v2/v2.ts +3 -3
- package/src/resources/v2.ts +1 -1
- package/src/resources/webhooks.ts +7 -7
- package/src/resources.ts +1 -1
- package/src/shims/node.ts +3 -3
- package/src/shims/web.ts +3 -3
- package/src/uploads.ts +4 -4
- package/src/version.ts +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -6,13 +6,13 @@ export {
|
|
|
6
6
|
type AlertArchiveResponse,
|
|
7
7
|
type AlertCreateParams,
|
|
8
8
|
type AlertArchiveParams,
|
|
9
|
-
} from
|
|
9
|
+
} from "./alerts.js";
|
|
10
10
|
export {
|
|
11
11
|
AuditLogListResponsesCursorPage,
|
|
12
12
|
AuditLogs,
|
|
13
13
|
type AuditLogListResponse,
|
|
14
14
|
type AuditLogListParams,
|
|
15
|
-
} from
|
|
15
|
+
} from "./audit-logs.js";
|
|
16
16
|
export {
|
|
17
17
|
BillableMetricListResponsesCursorPage,
|
|
18
18
|
BillableMetrics,
|
|
@@ -24,7 +24,7 @@ export {
|
|
|
24
24
|
type BillableMetricRetrieveParams,
|
|
25
25
|
type BillableMetricListParams,
|
|
26
26
|
type BillableMetricArchiveParams,
|
|
27
|
-
} from
|
|
27
|
+
} from "./billable-metrics.js";
|
|
28
28
|
export {
|
|
29
29
|
Contracts,
|
|
30
30
|
type ContractCreateResponse,
|
|
@@ -35,6 +35,7 @@ export {
|
|
|
35
35
|
type ContractCreateHistoricalInvoicesResponse,
|
|
36
36
|
type ContractListBalancesResponse,
|
|
37
37
|
type ContractRetrieveRateScheduleResponse,
|
|
38
|
+
type ContractRetrieveSubscriptionQuantityHistoryResponse,
|
|
38
39
|
type ContractScheduleProServicesInvoiceResponse,
|
|
39
40
|
type ContractUpdateEndDateResponse,
|
|
40
41
|
type ContractCreateParams,
|
|
@@ -46,10 +47,11 @@ export {
|
|
|
46
47
|
type ContractCreateHistoricalInvoicesParams,
|
|
47
48
|
type ContractListBalancesParams,
|
|
48
49
|
type ContractRetrieveRateScheduleParams,
|
|
50
|
+
type ContractRetrieveSubscriptionQuantityHistoryParams,
|
|
49
51
|
type ContractScheduleProServicesInvoiceParams,
|
|
50
52
|
type ContractSetUsageFilterParams,
|
|
51
53
|
type ContractUpdateEndDateParams,
|
|
52
|
-
} from
|
|
54
|
+
} from "./contracts/index.js";
|
|
53
55
|
export {
|
|
54
56
|
CreditGrantListResponsesCursorPage,
|
|
55
57
|
CreditGrants,
|
|
@@ -66,7 +68,7 @@ export {
|
|
|
66
68
|
type CreditGrantEditParams,
|
|
67
69
|
type CreditGrantListEntriesParams,
|
|
68
70
|
type CreditGrantVoidParams,
|
|
69
|
-
} from
|
|
71
|
+
} from "./credit-grants.js";
|
|
70
72
|
export {
|
|
71
73
|
CustomFields,
|
|
72
74
|
type CustomFieldListKeysResponse,
|
|
@@ -75,7 +77,7 @@ export {
|
|
|
75
77
|
type CustomFieldListKeysParams,
|
|
76
78
|
type CustomFieldRemoveKeyParams,
|
|
77
79
|
type CustomFieldSetValuesParams,
|
|
78
|
-
} from
|
|
80
|
+
} from "./custom-fields.js";
|
|
79
81
|
export {
|
|
80
82
|
CustomerDetailsCursorPage,
|
|
81
83
|
CustomerListBillableMetricsResponsesCursorPage,
|
|
@@ -88,6 +90,7 @@ export {
|
|
|
88
90
|
type CustomerArchiveResponse,
|
|
89
91
|
type CustomerListBillableMetricsResponse,
|
|
90
92
|
type CustomerListCostsResponse,
|
|
93
|
+
type CustomerPreviewEventsResponse,
|
|
91
94
|
type CustomerSetNameResponse,
|
|
92
95
|
type CustomerCreateParams,
|
|
93
96
|
type CustomerRetrieveParams,
|
|
@@ -95,22 +98,23 @@ export {
|
|
|
95
98
|
type CustomerArchiveParams,
|
|
96
99
|
type CustomerListBillableMetricsParams,
|
|
97
100
|
type CustomerListCostsParams,
|
|
101
|
+
type CustomerPreviewEventsParams,
|
|
98
102
|
type CustomerSetIngestAliasesParams,
|
|
99
103
|
type CustomerSetNameParams,
|
|
100
104
|
type CustomerUpdateConfigParams,
|
|
101
|
-
} from
|
|
105
|
+
} from "./customers/index.js";
|
|
102
106
|
export {
|
|
103
107
|
Dashboards,
|
|
104
108
|
type DashboardGetEmbeddableURLResponse,
|
|
105
109
|
type DashboardGetEmbeddableURLParams,
|
|
106
|
-
} from
|
|
110
|
+
} from "./dashboards.js";
|
|
107
111
|
export {
|
|
108
112
|
Invoices,
|
|
109
113
|
type InvoiceRegenerateResponse,
|
|
110
114
|
type InvoiceVoidResponse,
|
|
111
115
|
type InvoiceRegenerateParams,
|
|
112
116
|
type InvoiceVoidParams,
|
|
113
|
-
} from
|
|
117
|
+
} from "./invoices.js";
|
|
114
118
|
export {
|
|
115
119
|
PlanListResponsesCursorPage,
|
|
116
120
|
PlanListChargesResponsesCursorPage,
|
|
@@ -125,21 +129,23 @@ export {
|
|
|
125
129
|
type PlanGetDetailsParams,
|
|
126
130
|
type PlanListChargesParams,
|
|
127
131
|
type PlanListCustomersParams,
|
|
128
|
-
} from
|
|
132
|
+
} from "./plans.js";
|
|
129
133
|
export {
|
|
130
134
|
PricingUnitListResponsesCursorPage,
|
|
131
135
|
PricingUnits,
|
|
132
136
|
type PricingUnitListResponse,
|
|
133
137
|
type PricingUnitListParams,
|
|
134
|
-
} from
|
|
135
|
-
export { Services, type ServiceListResponse } from
|
|
138
|
+
} from "./pricing-units.js";
|
|
139
|
+
export { Services, type ServiceListResponse } from "./services.js";
|
|
136
140
|
export {
|
|
137
141
|
UsageListWithGroupsResponsesCursorPage,
|
|
138
142
|
Usage,
|
|
139
143
|
type UsageListResponse,
|
|
140
144
|
type UsageListWithGroupsResponse,
|
|
145
|
+
type UsageSearchResponse,
|
|
141
146
|
type UsageListParams,
|
|
142
147
|
type UsageIngestParams,
|
|
143
148
|
type UsageListWithGroupsParams,
|
|
144
|
-
|
|
145
|
-
|
|
149
|
+
type UsageSearchParams,
|
|
150
|
+
} from "./usage.js";
|
|
151
|
+
export { V1 } from "./v1.js";
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import * as Core from
|
|
3
|
+
import { APIResource } from "../../resource.js";
|
|
4
|
+
import * as Core from "../../core.js";
|
|
5
5
|
|
|
6
6
|
export class Invoices extends APIResource {
|
|
7
7
|
/**
|
|
8
8
|
* Regenerate a voided contract invoice
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```ts
|
|
12
|
+
* const response = await client.v1.invoices.regenerate({
|
|
13
|
+
* id: '6a37bb88-8538-48c5-b37b-a41c836328bd',
|
|
14
|
+
* });
|
|
15
|
+
* ```
|
|
9
16
|
*/
|
|
10
17
|
regenerate(
|
|
11
18
|
body: InvoiceRegenerateParams,
|
|
@@ -16,6 +23,13 @@ export class Invoices extends APIResource {
|
|
|
16
23
|
|
|
17
24
|
/**
|
|
18
25
|
* Void an invoice
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const response = await client.v1.invoices.void({
|
|
30
|
+
* id: '6a37bb88-8538-48c5-b37b-a41c836328bd',
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
19
33
|
*/
|
|
20
34
|
void(body: InvoiceVoidParams, options?: Core.RequestOptions): Core.APIPromise<InvoiceVoidResponse> {
|
|
21
35
|
return this._client.post('/v1/invoices/void', { body, ...options });
|
|
@@ -1,15 +1,23 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import { isRequestOptions } from
|
|
5
|
-
import * as Core from
|
|
6
|
-
import * as Shared from
|
|
7
|
-
import * as CustomersAPI from
|
|
8
|
-
import { CursorPage, type CursorPageParams } from
|
|
3
|
+
import { APIResource } from "../../resource.js";
|
|
4
|
+
import { isRequestOptions } from "../../core.js";
|
|
5
|
+
import * as Core from "../../core.js";
|
|
6
|
+
import * as Shared from "../shared.js";
|
|
7
|
+
import * as CustomersAPI from "./customers/customers.js";
|
|
8
|
+
import { CursorPage, type CursorPageParams } from "../../pagination.js";
|
|
9
9
|
|
|
10
10
|
export class Plans extends APIResource {
|
|
11
11
|
/**
|
|
12
12
|
* List all available plans.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* // Automatically fetches more pages as needed.
|
|
17
|
+
* for await (const planListResponse of client.v1.plans.list()) {
|
|
18
|
+
* // ...
|
|
19
|
+
* }
|
|
20
|
+
* ```
|
|
13
21
|
*/
|
|
14
22
|
list(
|
|
15
23
|
query?: PlanListParams,
|
|
@@ -28,6 +36,13 @@ export class Plans extends APIResource {
|
|
|
28
36
|
|
|
29
37
|
/**
|
|
30
38
|
* Fetch high level details of a specific plan.
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* ```ts
|
|
42
|
+
* const response = await client.v1.plans.getDetails({
|
|
43
|
+
* plan_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc',
|
|
44
|
+
* });
|
|
45
|
+
* ```
|
|
31
46
|
*/
|
|
32
47
|
getDetails(
|
|
33
48
|
params: PlanGetDetailsParams,
|
|
@@ -39,6 +54,16 @@ export class Plans extends APIResource {
|
|
|
39
54
|
|
|
40
55
|
/**
|
|
41
56
|
* Fetches a list of charges of a specific plan.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* // Automatically fetches more pages as needed.
|
|
61
|
+
* for await (const planListChargesResponse of client.v1.plans.listCharges(
|
|
62
|
+
* { plan_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
63
|
+
* )) {
|
|
64
|
+
* // ...
|
|
65
|
+
* }
|
|
66
|
+
* ```
|
|
42
67
|
*/
|
|
43
68
|
listCharges(
|
|
44
69
|
params: PlanListChargesParams,
|
|
@@ -54,6 +79,16 @@ export class Plans extends APIResource {
|
|
|
54
79
|
/**
|
|
55
80
|
* Fetches a list of customers on a specific plan (by default, only currently
|
|
56
81
|
* active plans are included)
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```ts
|
|
85
|
+
* // Automatically fetches more pages as needed.
|
|
86
|
+
* for await (const planListCustomersResponse of client.v1.plans.listCustomers(
|
|
87
|
+
* { plan_id: 'd7abd0cd-4ae9-4db7-8676-e986a4ebd8dc' },
|
|
88
|
+
* )) {
|
|
89
|
+
* // ...
|
|
90
|
+
* }
|
|
91
|
+
* ```
|
|
57
92
|
*/
|
|
58
93
|
listCustomers(
|
|
59
94
|
params: PlanListCustomersParams,
|
|
@@ -77,7 +112,7 @@ export class PlanListCustomersResponsesCursorPage extends CursorPage<PlanListCus
|
|
|
77
112
|
export interface PlanDetail {
|
|
78
113
|
id: string;
|
|
79
114
|
|
|
80
|
-
custom_fields:
|
|
115
|
+
custom_fields: { [key: string]: string };
|
|
81
116
|
|
|
82
117
|
name: string;
|
|
83
118
|
|
|
@@ -151,7 +186,7 @@ export interface PlanListResponse {
|
|
|
151
186
|
|
|
152
187
|
name: string;
|
|
153
188
|
|
|
154
|
-
custom_fields?:
|
|
189
|
+
custom_fields?: { [key: string]: string };
|
|
155
190
|
}
|
|
156
191
|
|
|
157
192
|
export interface PlanGetDetailsResponse {
|
|
@@ -165,7 +200,7 @@ export interface PlanListChargesResponse {
|
|
|
165
200
|
|
|
166
201
|
credit_type: Shared.CreditTypeData;
|
|
167
202
|
|
|
168
|
-
custom_fields:
|
|
203
|
+
custom_fields: { [key: string]: string };
|
|
169
204
|
|
|
170
205
|
name: string;
|
|
171
206
|
|
|
@@ -238,7 +273,7 @@ export namespace PlanListCustomersResponse {
|
|
|
238
273
|
export interface PlanDetails {
|
|
239
274
|
id: string;
|
|
240
275
|
|
|
241
|
-
custom_fields:
|
|
276
|
+
custom_fields: { [key: string]: string };
|
|
242
277
|
|
|
243
278
|
customer_plan_id: string;
|
|
244
279
|
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import { isRequestOptions } from
|
|
5
|
-
import * as Core from
|
|
6
|
-
import { CursorPage, type CursorPageParams } from
|
|
3
|
+
import { APIResource } from "../../resource.js";
|
|
4
|
+
import { isRequestOptions } from "../../core.js";
|
|
5
|
+
import * as Core from "../../core.js";
|
|
6
|
+
import { CursorPage, type CursorPageParams } from "../../pagination.js";
|
|
7
7
|
|
|
8
8
|
export class PricingUnits extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* List all pricing units (known in the API by the legacy term "credit types").
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* // Automatically fetches more pages as needed.
|
|
15
|
+
* for await (const pricingUnitListResponse of client.v1.pricingUnits.list()) {
|
|
16
|
+
* // ...
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
11
19
|
*/
|
|
12
20
|
list(
|
|
13
21
|
query?: PricingUnitListParams,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import * as Core from
|
|
3
|
+
import { APIResource } from "../../resource.js";
|
|
4
|
+
import * as Core from "../../core.js";
|
|
5
5
|
|
|
6
6
|
export class Services extends APIResource {
|
|
7
7
|
/**
|
|
@@ -9,6 +9,11 @@ export class Services extends APIResource {
|
|
|
9
9
|
* addresses are not necessarily unique between services. In most cases, IP
|
|
10
10
|
* addresses will appear in the list at least 30 days before they are used for the
|
|
11
11
|
* first time.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```ts
|
|
15
|
+
* const services = await client.v1.services.list();
|
|
16
|
+
* ```
|
|
12
17
|
*/
|
|
13
18
|
list(options?: Core.RequestOptions): Core.APIPromise<ServiceListResponse> {
|
|
14
19
|
return this._client.get('/v1/services', options);
|
|
@@ -1,14 +1,24 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import { APIResource } from
|
|
4
|
-
import { isRequestOptions } from
|
|
5
|
-
import * as Core from
|
|
6
|
-
import
|
|
3
|
+
import { APIResource } from "../../resource.js";
|
|
4
|
+
import { isRequestOptions } from "../../core.js";
|
|
5
|
+
import * as Core from "../../core.js";
|
|
6
|
+
import * as Shared from "../shared.js";
|
|
7
|
+
import { CursorPage, type CursorPageParams } from "../../pagination.js";
|
|
7
8
|
|
|
8
9
|
export class Usage extends APIResource {
|
|
9
10
|
/**
|
|
10
11
|
* Fetch aggregated usage data for multiple customers and billable-metrics, broken
|
|
11
12
|
* into intervals of the specified length.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const usages = await client.v1.usage.list({
|
|
17
|
+
* ending_before: '2021-01-03T00:00:00Z',
|
|
18
|
+
* starting_on: '2021-01-01T00:00:00Z',
|
|
19
|
+
* window_size: 'day',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
12
22
|
*/
|
|
13
23
|
list(params: UsageListParams, options?: Core.RequestOptions): Core.APIPromise<UsageListResponse> {
|
|
14
24
|
const { next_page, ...body } = params;
|
|
@@ -21,6 +31,18 @@ export class Usage extends APIResource {
|
|
|
21
31
|
* supported with a `Content-Encoding: gzip` header. See
|
|
22
32
|
* [Getting usage into Metronome](https://docs.metronome.com/connect-metronome/) to
|
|
23
33
|
* learn more about usage events.
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* await client.v1.usage.ingest([
|
|
38
|
+
* {
|
|
39
|
+
* customer_id: 'team@example.com',
|
|
40
|
+
* event_type: 'heartbeat',
|
|
41
|
+
* timestamp: '2021-01-01T00:00:00Z',
|
|
42
|
+
* transaction_id: '2021-01-01T00:00:00Z_cluster42',
|
|
43
|
+
* },
|
|
44
|
+
* ]);
|
|
45
|
+
* ```
|
|
24
46
|
*/
|
|
25
47
|
ingest(body?: UsageIngestParams, options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
26
48
|
ingest(options?: Core.RequestOptions): Core.APIPromise<void>;
|
|
@@ -41,6 +63,27 @@ export class Usage extends APIResource {
|
|
|
41
63
|
/**
|
|
42
64
|
* Fetch aggregated usage data for the specified customer, billable-metric, and
|
|
43
65
|
* optional group, broken into intervals of the specified length.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* // Automatically fetches more pages as needed.
|
|
70
|
+
* for await (const usageListWithGroupsResponse of client.v1.usage.listWithGroups(
|
|
71
|
+
* {
|
|
72
|
+
* billable_metric_id:
|
|
73
|
+
* '222796fd-d29c-429e-89b2-549fabda4ed6',
|
|
74
|
+
* customer_id: '04ca7e72-4229-4a6e-ab11-9f7376fccbcb',
|
|
75
|
+
* window_size: 'day',
|
|
76
|
+
* ending_before: '2021-01-03T00:00:00Z',
|
|
77
|
+
* group_by: {
|
|
78
|
+
* key: 'region',
|
|
79
|
+
* values: ['US-East', 'US-West', 'EU-Central'],
|
|
80
|
+
* },
|
|
81
|
+
* starting_on: '2021-01-01T00:00:00Z',
|
|
82
|
+
* },
|
|
83
|
+
* )) {
|
|
84
|
+
* // ...
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
44
87
|
*/
|
|
45
88
|
listWithGroups(
|
|
46
89
|
params: UsageListWithGroupsParams,
|
|
@@ -54,6 +97,23 @@ export class Usage extends APIResource {
|
|
|
54
97
|
...options,
|
|
55
98
|
});
|
|
56
99
|
}
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* For a set of events, look up matched billable metrics and customers by
|
|
103
|
+
* transaction id. This endpoint looks at transactions that occurred in the last 34
|
|
104
|
+
* days, and is intended for sampling-based testing workflows. It is heavily rate
|
|
105
|
+
* limited.
|
|
106
|
+
*
|
|
107
|
+
* @example
|
|
108
|
+
* ```ts
|
|
109
|
+
* const response = await client.v1.usage.search({
|
|
110
|
+
* transactionIds: ['2021-01-01T00:00:00Z_cluster42'],
|
|
111
|
+
* });
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
114
|
+
search(body: UsageSearchParams, options?: Core.RequestOptions): Core.APIPromise<UsageSearchResponse> {
|
|
115
|
+
return this._client.post('/v1/events/search', { body, ...options });
|
|
116
|
+
}
|
|
57
117
|
}
|
|
58
118
|
|
|
59
119
|
export class UsageListWithGroupsResponsesCursorPage extends CursorPage<UsageListWithGroupsResponse> {}
|
|
@@ -82,7 +142,7 @@ export namespace UsageListResponse {
|
|
|
82
142
|
* Values will be either a number or null. Null indicates that there were no
|
|
83
143
|
* matches for the group_by value.
|
|
84
144
|
*/
|
|
85
|
-
groups?:
|
|
145
|
+
groups?: { [key: string]: number | null };
|
|
86
146
|
}
|
|
87
147
|
}
|
|
88
148
|
|
|
@@ -98,6 +158,118 @@ export interface UsageListWithGroupsResponse {
|
|
|
98
158
|
value: number | null;
|
|
99
159
|
}
|
|
100
160
|
|
|
161
|
+
export type UsageSearchResponse = Array<UsageSearchResponse.UsageSearchResponseItem>;
|
|
162
|
+
|
|
163
|
+
export namespace UsageSearchResponse {
|
|
164
|
+
export interface UsageSearchResponseItem {
|
|
165
|
+
id: string;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* The ID of the customer in the ingest event body
|
|
169
|
+
*/
|
|
170
|
+
customer_id: string;
|
|
171
|
+
|
|
172
|
+
event_type: string;
|
|
173
|
+
|
|
174
|
+
timestamp: string;
|
|
175
|
+
|
|
176
|
+
transaction_id: string;
|
|
177
|
+
|
|
178
|
+
is_duplicate?: boolean;
|
|
179
|
+
|
|
180
|
+
matched_billable_metrics?: Array<UsageSearchResponseItem.MatchedBillableMetric>;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* The customer the event was matched to if a match was found
|
|
184
|
+
*/
|
|
185
|
+
matched_customer?: UsageSearchResponseItem.MatchedCustomer;
|
|
186
|
+
|
|
187
|
+
processed_at?: string;
|
|
188
|
+
|
|
189
|
+
properties?: { [key: string]: unknown };
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export namespace UsageSearchResponseItem {
|
|
193
|
+
export interface MatchedBillableMetric {
|
|
194
|
+
id: string;
|
|
195
|
+
|
|
196
|
+
name: string;
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* (DEPRECATED) use aggregation_type instead
|
|
200
|
+
*/
|
|
201
|
+
aggregate?: string;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* (DEPRECATED) use aggregation_key instead
|
|
205
|
+
*/
|
|
206
|
+
aggregate_keys?: Array<string>;
|
|
207
|
+
|
|
208
|
+
/**
|
|
209
|
+
* A key that specifies which property of the event is used to aggregate data. This
|
|
210
|
+
* key must be one of the property filter names and is not applicable when the
|
|
211
|
+
* aggregation type is 'count'.
|
|
212
|
+
*/
|
|
213
|
+
aggregation_key?: string;
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Specifies the type of aggregation performed on matching events.
|
|
217
|
+
*/
|
|
218
|
+
aggregation_type?: 'COUNT' | 'LATEST' | 'MAX' | 'SUM' | 'UNIQUE';
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* RFC 3339 timestamp indicating when the billable metric was archived. If not
|
|
222
|
+
* provided, the billable metric is not archived.
|
|
223
|
+
*/
|
|
224
|
+
archived_at?: string;
|
|
225
|
+
|
|
226
|
+
custom_fields?: { [key: string]: string };
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* An optional filtering rule to match the 'event_type' property of an event.
|
|
230
|
+
*/
|
|
231
|
+
event_type_filter?: Shared.EventTypeFilter;
|
|
232
|
+
|
|
233
|
+
/**
|
|
234
|
+
* (DEPRECATED) use property_filters & event_type_filter instead
|
|
235
|
+
*/
|
|
236
|
+
filter?: { [key: string]: unknown };
|
|
237
|
+
|
|
238
|
+
/**
|
|
239
|
+
* (DEPRECATED) use group_keys instead
|
|
240
|
+
*/
|
|
241
|
+
group_by?: Array<string>;
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* Property names that are used to group usage costs on an invoice. Each entry
|
|
245
|
+
* represents a set of properties used to slice events into distinct buckets.
|
|
246
|
+
*/
|
|
247
|
+
group_keys?: Array<Array<string>>;
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* A list of filters to match events to this billable metric. Each filter defines a
|
|
251
|
+
* rule on an event property. All rules must pass for the event to match the
|
|
252
|
+
* billable metric.
|
|
253
|
+
*/
|
|
254
|
+
property_filters?: Array<Shared.PropertyFilter>;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* The SQL query associated with the billable metric
|
|
258
|
+
*/
|
|
259
|
+
sql?: string;
|
|
260
|
+
}
|
|
261
|
+
|
|
262
|
+
/**
|
|
263
|
+
* The customer the event was matched to if a match was found
|
|
264
|
+
*/
|
|
265
|
+
export interface MatchedCustomer {
|
|
266
|
+
id?: string;
|
|
267
|
+
|
|
268
|
+
name?: string;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
|
|
101
273
|
export interface UsageListParams {
|
|
102
274
|
/**
|
|
103
275
|
* Body param:
|
|
@@ -173,7 +345,7 @@ export namespace UsageIngestParams {
|
|
|
173
345
|
|
|
174
346
|
transaction_id: string;
|
|
175
347
|
|
|
176
|
-
properties?:
|
|
348
|
+
properties?: { [key: string]: unknown };
|
|
177
349
|
}
|
|
178
350
|
}
|
|
179
351
|
|
|
@@ -234,15 +406,24 @@ export namespace UsageListWithGroupsParams {
|
|
|
234
406
|
}
|
|
235
407
|
}
|
|
236
408
|
|
|
409
|
+
export interface UsageSearchParams {
|
|
410
|
+
/**
|
|
411
|
+
* The transaction IDs of the events to retrieve
|
|
412
|
+
*/
|
|
413
|
+
transactionIds: Array<string>;
|
|
414
|
+
}
|
|
415
|
+
|
|
237
416
|
Usage.UsageListWithGroupsResponsesCursorPage = UsageListWithGroupsResponsesCursorPage;
|
|
238
417
|
|
|
239
418
|
export declare namespace Usage {
|
|
240
419
|
export {
|
|
241
420
|
type UsageListResponse as UsageListResponse,
|
|
242
421
|
type UsageListWithGroupsResponse as UsageListWithGroupsResponse,
|
|
422
|
+
type UsageSearchResponse as UsageSearchResponse,
|
|
243
423
|
UsageListWithGroupsResponsesCursorPage as UsageListWithGroupsResponsesCursorPage,
|
|
244
424
|
type UsageListParams as UsageListParams,
|
|
245
425
|
type UsageIngestParams as UsageIngestParams,
|
|
246
426
|
type UsageListWithGroupsParams as UsageListWithGroupsParams,
|
|
427
|
+
type UsageSearchParams as UsageSearchParams,
|
|
247
428
|
};
|
|
248
429
|
}
|