@leaflow/sdk 0.126.0 → 0.127.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/dist/billing/type/order/v1/generated/models.d.ts +25 -0
- package/dist/billing/type/order/v1/generated/validators/monthlyStatement.zod.d.ts +36 -0
- package/dist/billing/type/order/v1/generated/validators/monthlyStatement.zod.js +30 -0
- package/dist/billing/type/order/v1/generated/validators/monthlyStatementList.zod.d.ts +43 -0
- package/dist/billing/type/order/v1/generated/validators/monthlyStatementList.zod.js +14 -0
- package/dist/billing/v1/generated/functions.d.ts +22 -1
- package/dist/billing/v1/generated/functions.js +25 -0
- package/dist/billing/v1/generated/models.d.ts +48 -0
- package/dist/billing/v1/generated/schemas.zod.d.ts +15 -0
- package/dist/billing/v1/generated/schemas.zod.js +25 -0
- package/dist/billing/v1/generated/validators/listMonthlyStatementsParams.zod.d.ts +21 -0
- package/dist/billing/v1/generated/validators/listMonthlyStatementsParams.zod.js +27 -0
- package/dist/billing/v1/generated/validators/monthlyStatement.zod.d.ts +36 -0
- package/dist/billing/v1/generated/validators/monthlyStatement.zod.js +30 -0
- package/dist/billing/v1/generated/validators/monthlyStatementList.zod.d.ts +43 -0
- package/dist/billing/v1/generated/validators/monthlyStatementList.zod.js +14 -0
- package/dist/canopy/v1/generated/models.d.ts +25 -0
- package/dist/canopy/v1/generated/validators/monthlyStatement.zod.d.ts +59 -0
- package/dist/canopy/v1/generated/validators/monthlyStatement.zod.js +53 -0
- package/dist/canopy/v1/generated/validators/monthlyStatementList.zod.d.ts +66 -0
- package/dist/canopy/v1/generated/validators/monthlyStatementList.zod.js +37 -0
- package/dist/compute/v1/generated/models.d.ts +25 -0
- package/dist/compute/v1/generated/validators/monthlyStatement.zod.d.ts +52 -0
- package/dist/compute/v1/generated/validators/monthlyStatement.zod.js +46 -0
- package/dist/compute/v1/generated/validators/monthlyStatementList.zod.d.ts +59 -0
- package/dist/compute/v1/generated/validators/monthlyStatementList.zod.js +30 -0
- package/dist/membership/v1/generated/models.d.ts +25 -0
- package/dist/membership/v1/generated/validators/monthlyStatement.zod.d.ts +36 -0
- package/dist/membership/v1/generated/validators/monthlyStatement.zod.js +30 -0
- package/dist/membership/v1/generated/validators/monthlyStatementList.zod.d.ts +43 -0
- package/dist/membership/v1/generated/validators/monthlyStatementList.zod.js +14 -0
- package/dist/routes.d.ts +8 -0
- package/dist/routes.js +9 -0
- package/package.json +1 -1
|
@@ -2874,6 +2874,31 @@ export interface StatementAmounts {
|
|
|
2874
2874
|
tax_amount: Money;
|
|
2875
2875
|
total: Money;
|
|
2876
2876
|
}
|
|
2877
|
+
/**
|
|
2878
|
+
* One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.
|
|
2879
|
+
*/
|
|
2880
|
+
export interface MonthlyStatement {
|
|
2881
|
+
billing_account_id: number;
|
|
2882
|
+
currency: string;
|
|
2883
|
+
period_start: string;
|
|
2884
|
+
period_end: string;
|
|
2885
|
+
/** True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here. */
|
|
2886
|
+
finalized: boolean;
|
|
2887
|
+
finalized_at?: string;
|
|
2888
|
+
/** Statements of the period, including the open one. */
|
|
2889
|
+
statement_count: number;
|
|
2890
|
+
billed: StatementAmounts;
|
|
2891
|
+
credited_amount: Money;
|
|
2892
|
+
unbilled?: StatementAmounts;
|
|
2893
|
+
credit_applied: Money;
|
|
2894
|
+
amount_paid: Money;
|
|
2895
|
+
amount_due: Money;
|
|
2896
|
+
amount_refunded: Money;
|
|
2897
|
+
}
|
|
2898
|
+
export interface MonthlyStatementList {
|
|
2899
|
+
items: MonthlyStatement[];
|
|
2900
|
+
pagination: OffsetPagination;
|
|
2901
|
+
}
|
|
2877
2902
|
export type StatementStatus = (typeof StatementStatus)[keyof typeof StatementStatus];
|
|
2878
2903
|
export declare const StatementStatus: {
|
|
2879
2904
|
readonly open: "open";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Billing Order Types
|
|
5
|
+
* The Billing order a product purchase placed. Types only; this document declares no operations.
|
|
6
|
+
* OpenAPI spec version: v1
|
|
7
|
+
*/
|
|
8
|
+
import * as zod from "zod";
|
|
9
|
+
export declare const MonthlyStatement: zod.ZodObject<{
|
|
10
|
+
billing_account_id: zod.ZodInt;
|
|
11
|
+
currency: zod.ZodString;
|
|
12
|
+
period_start: zod.z.ZodISODateTime;
|
|
13
|
+
period_end: zod.z.ZodISODateTime;
|
|
14
|
+
finalized: zod.ZodBoolean;
|
|
15
|
+
finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
16
|
+
statement_count: zod.ZodInt;
|
|
17
|
+
billed: zod.ZodObject<{
|
|
18
|
+
subtotal: zod.ZodString;
|
|
19
|
+
discount_amount: zod.ZodString;
|
|
20
|
+
tax_amount: zod.ZodString;
|
|
21
|
+
total: zod.ZodString;
|
|
22
|
+
}, zod.z.core.$strict>;
|
|
23
|
+
credited_amount: zod.ZodString;
|
|
24
|
+
unbilled: zod.ZodOptional<zod.ZodObject<{
|
|
25
|
+
subtotal: zod.ZodString;
|
|
26
|
+
discount_amount: zod.ZodString;
|
|
27
|
+
tax_amount: zod.ZodString;
|
|
28
|
+
total: zod.ZodString;
|
|
29
|
+
}, zod.z.core.$strict>>;
|
|
30
|
+
credit_applied: zod.ZodString;
|
|
31
|
+
amount_paid: zod.ZodString;
|
|
32
|
+
amount_due: zod.ZodString;
|
|
33
|
+
amount_refunded: zod.ZodString;
|
|
34
|
+
}, zod.z.core.$strict>;
|
|
35
|
+
export type MonthlyStatement = zod.input<typeof MonthlyStatement>;
|
|
36
|
+
export type MonthlyStatementOutput = zod.output<typeof MonthlyStatement>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Billing Order Types
|
|
5
|
+
* The Billing order a product purchase placed. Types only; this document declares no operations.
|
|
6
|
+
* OpenAPI spec version: v1
|
|
7
|
+
*/
|
|
8
|
+
import * as zod from "zod";
|
|
9
|
+
import { Money } from "./money.zod.js";
|
|
10
|
+
import { StatementAmounts } from "./statementAmounts.zod.js";
|
|
11
|
+
export const MonthlyStatement = zod
|
|
12
|
+
.strictObject({
|
|
13
|
+
billing_account_id: zod.int(),
|
|
14
|
+
currency: zod.string(),
|
|
15
|
+
period_start: zod.iso.datetime({ offset: true }),
|
|
16
|
+
period_end: zod.iso.datetime({ offset: true }),
|
|
17
|
+
finalized: zod
|
|
18
|
+
.boolean()
|
|
19
|
+
.describe("True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here."),
|
|
20
|
+
finalized_at: zod.iso.datetime({ offset: true }).optional(),
|
|
21
|
+
statement_count: zod.int().describe("Statements of the period, including the open one."),
|
|
22
|
+
billed: StatementAmounts,
|
|
23
|
+
credited_amount: Money,
|
|
24
|
+
unbilled: StatementAmounts.optional(),
|
|
25
|
+
credit_applied: Money,
|
|
26
|
+
amount_paid: Money,
|
|
27
|
+
amount_due: Money,
|
|
28
|
+
amount_refunded: Money,
|
|
29
|
+
})
|
|
30
|
+
.describe("One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.");
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Billing Order Types
|
|
5
|
+
* The Billing order a product purchase placed. Types only; this document declares no operations.
|
|
6
|
+
* OpenAPI spec version: v1
|
|
7
|
+
*/
|
|
8
|
+
import * as zod from "zod";
|
|
9
|
+
export declare const MonthlyStatementList: zod.ZodObject<{
|
|
10
|
+
items: zod.ZodArray<zod.ZodObject<{
|
|
11
|
+
billing_account_id: zod.ZodInt;
|
|
12
|
+
currency: zod.ZodString;
|
|
13
|
+
period_start: zod.z.ZodISODateTime;
|
|
14
|
+
period_end: zod.z.ZodISODateTime;
|
|
15
|
+
finalized: zod.ZodBoolean;
|
|
16
|
+
finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
17
|
+
statement_count: zod.ZodInt;
|
|
18
|
+
billed: zod.ZodObject<{
|
|
19
|
+
subtotal: zod.ZodString;
|
|
20
|
+
discount_amount: zod.ZodString;
|
|
21
|
+
tax_amount: zod.ZodString;
|
|
22
|
+
total: zod.ZodString;
|
|
23
|
+
}, zod.z.core.$strict>;
|
|
24
|
+
credited_amount: zod.ZodString;
|
|
25
|
+
unbilled: zod.ZodOptional<zod.ZodObject<{
|
|
26
|
+
subtotal: zod.ZodString;
|
|
27
|
+
discount_amount: zod.ZodString;
|
|
28
|
+
tax_amount: zod.ZodString;
|
|
29
|
+
total: zod.ZodString;
|
|
30
|
+
}, zod.z.core.$strict>>;
|
|
31
|
+
credit_applied: zod.ZodString;
|
|
32
|
+
amount_paid: zod.ZodString;
|
|
33
|
+
amount_due: zod.ZodString;
|
|
34
|
+
amount_refunded: zod.ZodString;
|
|
35
|
+
}, zod.z.core.$strict>>;
|
|
36
|
+
pagination: zod.ZodObject<{
|
|
37
|
+
page: zod.ZodInt;
|
|
38
|
+
page_size: zod.ZodInt;
|
|
39
|
+
total_count: zod.ZodOptional<zod.ZodInt>;
|
|
40
|
+
}, zod.z.core.$strict>;
|
|
41
|
+
}, zod.z.core.$strict>;
|
|
42
|
+
export type MonthlyStatementList = zod.input<typeof MonthlyStatementList>;
|
|
43
|
+
export type MonthlyStatementListOutput = zod.output<typeof MonthlyStatementList>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Billing Order Types
|
|
5
|
+
* The Billing order a product purchase placed. Types only; this document declares no operations.
|
|
6
|
+
* OpenAPI spec version: v1
|
|
7
|
+
*/
|
|
8
|
+
import * as zod from "zod";
|
|
9
|
+
import { MonthlyStatement } from "./monthlyStatement.zod.js";
|
|
10
|
+
import { OffsetPagination } from "./offsetPagination.zod.js";
|
|
11
|
+
export const MonthlyStatementList = zod.strictObject({
|
|
12
|
+
items: zod.array(MonthlyStatement),
|
|
13
|
+
pagination: OffsetPagination,
|
|
14
|
+
});
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
|
|
6
6
|
* OpenAPI spec version: v1
|
|
7
7
|
*/
|
|
8
|
-
import type { AccountBalance, ActiveResourceList, AllowanceList, AutoRenewSet, BillingAccount, BillingAccountCreate, BillingAccountList, BillingAccountUpdate, CancelSubscriptionRequest, Cancellation, CancellationCreate, CancellationList, Contact, ContactCreate, ContactList, ContactUpdate, CreditGrantList, CreditNote, CreditNoteItemList, CreditNoteList, CurrencyList, DiscountList, EntitlementList, Error, ErrorResponse, FeatureGrantList, GetPlanHeaders, GetPriceHeaders, GetProductHeaders, GetStatementUsageParams, Invoice, InvoiceItemList, InvoiceList, ListAccountDiscountsParams, ListActiveResourcesParams, ListAllowancesParams, ListBillingAccountsParams, ListCancellationsParams, ListContactsParams, ListCreditGrantsParams, ListCreditNoteItemsParams, ListCreditNotesParams, ListCurrenciesParams, ListEntitlementsParams, ListFeatureGrantsParams, ListInvoiceItemsParams, ListInvoicesParams, ListOrderItemsParams, ListOrdersParams, ListPaymentMethodsParams, ListPaymentOptionsParams, ListPlansHeaders, ListPlansParams, ListPricesByPlanHeaders, ListPricesByPlanParams, ListPricesHeaders, ListPricesParams, ListProductsHeaders, ListProductsParams, ListProjectAssignmentsParams, ListRatesHeaders, ListRatesParams, ListRefundsParams, ListRenewalPricesParams, ListSpendParams, ListStatementsParams, ListSubscriptionsParams, ListTopUpsParams, ListTransactionsParams, ListUsageChargesParams, NotModifiedResponse, Order, OrderCancel, OrderItemList, OrderList, PayInvoiceRequest, PayTogetherRequest, PaymentMethod, PaymentMethodList, PaymentMethodSetup, PaymentMethodSetupResult, PaymentOptionList, PaymentPreview, PaymentResult, Plan, PlanList, PreviewInvoicePaymentParams, Price, PriceList, Product, ProductID, ProductList, ProjectAssignment, ProjectAssignmentList, Quote, QuoteRequest, RateList, RefundList, RenewRequest, RenewalOrderRequest, RenewalPriceList, SetProjectAssignmentRequest, SpendRowList, Statement, StatementList, StatementSummary, Subscription, SubscriptionList, TopUp, TopUpCreate, TopUpList, TransactionList, UsageChargeList } from "./models.js";
|
|
8
|
+
import type { AccountBalance, ActiveResourceList, AllowanceList, AutoRenewSet, BillingAccount, BillingAccountCreate, BillingAccountList, BillingAccountUpdate, CancelSubscriptionRequest, Cancellation, CancellationCreate, CancellationList, Contact, ContactCreate, ContactList, ContactUpdate, CreditGrantList, CreditNote, CreditNoteItemList, CreditNoteList, CurrencyList, DiscountList, EntitlementList, Error, ErrorResponse, FeatureGrantList, GetPlanHeaders, GetPriceHeaders, GetProductHeaders, GetStatementUsageParams, Invoice, InvoiceItemList, InvoiceList, ListAccountDiscountsParams, ListActiveResourcesParams, ListAllowancesParams, ListBillingAccountsParams, ListCancellationsParams, ListContactsParams, ListCreditGrantsParams, ListCreditNoteItemsParams, ListCreditNotesParams, ListCurrenciesParams, ListEntitlementsParams, ListFeatureGrantsParams, ListInvoiceItemsParams, ListInvoicesParams, ListMonthlyStatementsParams, ListOrderItemsParams, ListOrdersParams, ListPaymentMethodsParams, ListPaymentOptionsParams, ListPlansHeaders, ListPlansParams, ListPricesByPlanHeaders, ListPricesByPlanParams, ListPricesHeaders, ListPricesParams, ListProductsHeaders, ListProductsParams, ListProjectAssignmentsParams, ListRatesHeaders, ListRatesParams, ListRefundsParams, ListRenewalPricesParams, ListSpendParams, ListStatementsParams, ListSubscriptionsParams, ListTopUpsParams, ListTransactionsParams, ListUsageChargesParams, MonthlyStatementList, NotModifiedResponse, Order, OrderCancel, OrderItemList, OrderList, PayInvoiceRequest, PayTogetherRequest, PaymentMethod, PaymentMethodList, PaymentMethodSetup, PaymentMethodSetupResult, PaymentOptionList, PaymentPreview, PaymentResult, Plan, PlanList, PreviewInvoicePaymentParams, Price, PriceList, Product, ProductID, ProductList, ProjectAssignment, ProjectAssignmentList, Quote, QuoteRequest, RateList, RefundList, RenewRequest, RenewalOrderRequest, RenewalPriceList, SetProjectAssignmentRequest, SpendRowList, Statement, StatementList, StatementSummary, Subscription, SubscriptionList, TopUp, TopUpCreate, TopUpList, TransactionList, UsageChargeList } from "./models.js";
|
|
9
9
|
export type HTTPStatusCode1xx = 100 | 101 | 102 | 103;
|
|
10
10
|
export type HTTPStatusCode2xx = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207;
|
|
11
11
|
export type HTTPStatusCode3xx = 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308;
|
|
@@ -1770,6 +1770,27 @@ export declare const getListSpendUrl: (params: ListSpendParams) => string;
|
|
|
1770
1770
|
* @summary List account spend
|
|
1771
1771
|
*/
|
|
1772
1772
|
export declare const listSpend: (params: ListSpendParams, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<listSpendResponse>;
|
|
1773
|
+
export type listMonthlyStatementsResponse200 = {
|
|
1774
|
+
data: MonthlyStatementList;
|
|
1775
|
+
status: 200;
|
|
1776
|
+
};
|
|
1777
|
+
export type listMonthlyStatementsResponseDefault = {
|
|
1778
|
+
data: ErrorResponse;
|
|
1779
|
+
status: Exclude<HTTPStatusCodes, 200>;
|
|
1780
|
+
};
|
|
1781
|
+
export type listMonthlyStatementsResponseSuccess = listMonthlyStatementsResponse200 & {
|
|
1782
|
+
headers: Headers;
|
|
1783
|
+
};
|
|
1784
|
+
export type listMonthlyStatementsResponseError = listMonthlyStatementsResponseDefault & {
|
|
1785
|
+
headers: Headers;
|
|
1786
|
+
};
|
|
1787
|
+
export type listMonthlyStatementsResponse = listMonthlyStatementsResponseSuccess | listMonthlyStatementsResponseError;
|
|
1788
|
+
export declare const getListMonthlyStatementsUrl: (params?: ListMonthlyStatementsParams) => string;
|
|
1789
|
+
/**
|
|
1790
|
+
* Usage billing by UTC calendar month for owned billing accounts, newest first. Each period combines its statements, the invoices they issued and how those invoices were paid; usage is billed about hourly, so a month holds many statements. Filter by billing_account_id and by period start.
|
|
1791
|
+
* @summary List monthly statements
|
|
1792
|
+
*/
|
|
1793
|
+
export declare const listMonthlyStatements: (params?: ListMonthlyStatementsParams, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<listMonthlyStatementsResponse>;
|
|
1773
1794
|
export type listStatementsResponse200 = {
|
|
1774
1795
|
data: StatementList;
|
|
1775
1796
|
status: 200;
|
|
@@ -2064,6 +2064,31 @@ export const listSpend = async (params, options, fetchFn) => {
|
|
|
2064
2064
|
const data = body ? JSON.parse(body) : {};
|
|
2065
2065
|
return { data, status: res.status, headers: res.headers };
|
|
2066
2066
|
};
|
|
2067
|
+
export const getListMonthlyStatementsUrl = (params) => {
|
|
2068
|
+
const normalizedParams = new URLSearchParams();
|
|
2069
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
2070
|
+
if (value !== undefined) {
|
|
2071
|
+
normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2072
|
+
}
|
|
2073
|
+
});
|
|
2074
|
+
const stringifiedParams = normalizedParams.toString();
|
|
2075
|
+
return stringifiedParams.length > 0
|
|
2076
|
+
? `https://billing.leaflow.cloud/api/v1/monthly-statements?${stringifiedParams}`
|
|
2077
|
+
: `https://billing.leaflow.cloud/api/v1/monthly-statements`;
|
|
2078
|
+
};
|
|
2079
|
+
/**
|
|
2080
|
+
* Usage billing by UTC calendar month for owned billing accounts, newest first. Each period combines its statements, the invoices they issued and how those invoices were paid; usage is billed about hourly, so a month holds many statements. Filter by billing_account_id and by period start.
|
|
2081
|
+
* @summary List monthly statements
|
|
2082
|
+
*/
|
|
2083
|
+
export const listMonthlyStatements = async (params, options, fetchFn) => {
|
|
2084
|
+
const res = await (fetchFn ?? fetch)(getListMonthlyStatementsUrl(params), {
|
|
2085
|
+
...options,
|
|
2086
|
+
method: "GET",
|
|
2087
|
+
});
|
|
2088
|
+
const body = [204, 205, 304].includes(res.status) ? null : await res.text();
|
|
2089
|
+
const data = body ? JSON.parse(body) : {};
|
|
2090
|
+
return { data, status: res.status, headers: res.headers };
|
|
2091
|
+
};
|
|
2067
2092
|
export const getListStatementsUrl = (params) => {
|
|
2068
2093
|
const normalizedParams = new URLSearchParams();
|
|
2069
2094
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
@@ -2858,6 +2858,31 @@ export interface StatementAmounts {
|
|
|
2858
2858
|
tax_amount: Money;
|
|
2859
2859
|
total: Money;
|
|
2860
2860
|
}
|
|
2861
|
+
/**
|
|
2862
|
+
* One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.
|
|
2863
|
+
*/
|
|
2864
|
+
export interface MonthlyStatement {
|
|
2865
|
+
billing_account_id: number;
|
|
2866
|
+
currency: string;
|
|
2867
|
+
period_start: string;
|
|
2868
|
+
period_end: string;
|
|
2869
|
+
/** True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here. */
|
|
2870
|
+
finalized: boolean;
|
|
2871
|
+
finalized_at?: string;
|
|
2872
|
+
/** Statements of the period, including the open one. */
|
|
2873
|
+
statement_count: number;
|
|
2874
|
+
billed: StatementAmounts;
|
|
2875
|
+
credited_amount: Money;
|
|
2876
|
+
unbilled?: StatementAmounts;
|
|
2877
|
+
credit_applied: Money;
|
|
2878
|
+
amount_paid: Money;
|
|
2879
|
+
amount_due: Money;
|
|
2880
|
+
amount_refunded: Money;
|
|
2881
|
+
}
|
|
2882
|
+
export interface MonthlyStatementList {
|
|
2883
|
+
items: MonthlyStatement[];
|
|
2884
|
+
pagination: OffsetPagination;
|
|
2885
|
+
}
|
|
2861
2886
|
export type StatementStatus = (typeof StatementStatus)[keyof typeof StatementStatus];
|
|
2862
2887
|
export declare const StatementStatus: {
|
|
2863
2888
|
readonly open: "open";
|
|
@@ -3750,6 +3775,29 @@ export declare const ListSpendGroupBy: {
|
|
|
3750
3775
|
readonly plan: "plan";
|
|
3751
3776
|
readonly resource: "resource";
|
|
3752
3777
|
};
|
|
3778
|
+
export type ListMonthlyStatementsParams = {
|
|
3779
|
+
billing_account_id?: number;
|
|
3780
|
+
/**
|
|
3781
|
+
* Earliest period start, inclusive.
|
|
3782
|
+
*/
|
|
3783
|
+
from?: string;
|
|
3784
|
+
/**
|
|
3785
|
+
* Latest period start, exclusive.
|
|
3786
|
+
*/
|
|
3787
|
+
to?: string;
|
|
3788
|
+
/**
|
|
3789
|
+
* 1-based page number. Defaults to 1.
|
|
3790
|
+
* @minimum 1
|
|
3791
|
+
* @maximum 2147483647
|
|
3792
|
+
*/
|
|
3793
|
+
page?: number;
|
|
3794
|
+
/**
|
|
3795
|
+
* Items per page. Defaults to 50; at most 200.
|
|
3796
|
+
* @minimum 1
|
|
3797
|
+
* @maximum 200
|
|
3798
|
+
*/
|
|
3799
|
+
page_size?: number;
|
|
3800
|
+
};
|
|
3753
3801
|
export type ListStatementsParams = {
|
|
3754
3802
|
billing_account_id?: number;
|
|
3755
3803
|
status?: StatementStatus;
|
|
@@ -1273,6 +1273,21 @@ export declare const ListSpendQueryParams: zod.ZodObject<{
|
|
|
1273
1273
|
billing_account_id: zod.ZodInt;
|
|
1274
1274
|
project_ids: zod.ZodOptional<zod.ZodArray<zod.ZodUUID>>;
|
|
1275
1275
|
}, zod.z.core.$strict>;
|
|
1276
|
+
/**
|
|
1277
|
+
* Usage billing by UTC calendar month for owned billing accounts, newest first. Each period combines its statements, the invoices they issued and how those invoices were paid; usage is billed about hourly, so a month holds many statements. Filter by billing_account_id and by period start.
|
|
1278
|
+
* @summary List monthly statements
|
|
1279
|
+
*/
|
|
1280
|
+
export declare const listMonthlyStatementsQueryPageDefault = 1;
|
|
1281
|
+
export declare const listMonthlyStatementsQueryPageMax = 2147483647;
|
|
1282
|
+
export declare const listMonthlyStatementsQueryPageSizeDefault = 50;
|
|
1283
|
+
export declare const listMonthlyStatementsQueryPageSizeMax = 200;
|
|
1284
|
+
export declare const ListMonthlyStatementsQueryParams: zod.ZodObject<{
|
|
1285
|
+
billing_account_id: zod.ZodOptional<zod.ZodInt>;
|
|
1286
|
+
from: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
1287
|
+
to: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
1288
|
+
page: zod.ZodDefault<zod.ZodInt>;
|
|
1289
|
+
page_size: zod.ZodDefault<zod.ZodInt>;
|
|
1290
|
+
}, zod.z.core.$strict>;
|
|
1276
1291
|
/**
|
|
1277
1292
|
* Paginated consumption statement batches for owned billing accounts, filtered by billing_account_id, open or closed state and period-start interval. A closed batch is not proof that the whole month has finished.
|
|
1278
1293
|
* @summary List statements
|
|
@@ -1600,6 +1600,31 @@ export const ListSpendQueryParams = zod.strictObject({
|
|
|
1600
1600
|
.optional()
|
|
1601
1601
|
.describe("Restrict the account-authorized results to these projects. Omit for all projects and account-level records. This filter does not grant access to another billing account."),
|
|
1602
1602
|
});
|
|
1603
|
+
/**
|
|
1604
|
+
* Usage billing by UTC calendar month for owned billing accounts, newest first. Each period combines its statements, the invoices they issued and how those invoices were paid; usage is billed about hourly, so a month holds many statements. Filter by billing_account_id and by period start.
|
|
1605
|
+
* @summary List monthly statements
|
|
1606
|
+
*/
|
|
1607
|
+
export const listMonthlyStatementsQueryPageDefault = 1;
|
|
1608
|
+
export const listMonthlyStatementsQueryPageMax = 2147483647;
|
|
1609
|
+
export const listMonthlyStatementsQueryPageSizeDefault = 50;
|
|
1610
|
+
export const listMonthlyStatementsQueryPageSizeMax = 200;
|
|
1611
|
+
export const ListMonthlyStatementsQueryParams = zod.strictObject({
|
|
1612
|
+
billing_account_id: zod.int().optional(),
|
|
1613
|
+
from: zod.iso.datetime({ offset: true }).optional().describe("Earliest period start, inclusive."),
|
|
1614
|
+
to: zod.iso.datetime({ offset: true }).optional().describe("Latest period start, exclusive."),
|
|
1615
|
+
page: zod
|
|
1616
|
+
.int()
|
|
1617
|
+
.min(1)
|
|
1618
|
+
.max(listMonthlyStatementsQueryPageMax)
|
|
1619
|
+
.default(listMonthlyStatementsQueryPageDefault)
|
|
1620
|
+
.describe("1-based page number. Defaults to 1."),
|
|
1621
|
+
page_size: zod
|
|
1622
|
+
.int()
|
|
1623
|
+
.min(1)
|
|
1624
|
+
.max(listMonthlyStatementsQueryPageSizeMax)
|
|
1625
|
+
.default(listMonthlyStatementsQueryPageSizeDefault)
|
|
1626
|
+
.describe("Items per page. Defaults to 50; at most 200."),
|
|
1627
|
+
});
|
|
1603
1628
|
/**
|
|
1604
1629
|
* Paginated consumption statement batches for owned billing accounts, filtered by billing_account_id, open or closed state and period-start interval. A closed batch is not proof that the whole month has finished.
|
|
1605
1630
|
* @summary List statements
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Billing API
|
|
5
|
+
* Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
|
|
6
|
+
* OpenAPI spec version: v1
|
|
7
|
+
*/
|
|
8
|
+
import * as zod from "zod";
|
|
9
|
+
export declare const listMonthlyStatementsParamsPageDefault = 1;
|
|
10
|
+
export declare const listMonthlyStatementsParamsPageMax = 2147483647;
|
|
11
|
+
export declare const listMonthlyStatementsParamsPageSizeDefault = 50;
|
|
12
|
+
export declare const listMonthlyStatementsParamsPageSizeMax = 200;
|
|
13
|
+
export declare const ListMonthlyStatementsParams: zod.ZodObject<{
|
|
14
|
+
billing_account_id: zod.ZodOptional<zod.ZodInt>;
|
|
15
|
+
from: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
16
|
+
to: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
17
|
+
page: zod.ZodDefault<zod.ZodInt>;
|
|
18
|
+
page_size: zod.ZodDefault<zod.ZodInt>;
|
|
19
|
+
}, zod.z.core.$strict>;
|
|
20
|
+
export type ListMonthlyStatementsParams = zod.input<typeof ListMonthlyStatementsParams>;
|
|
21
|
+
export type ListMonthlyStatementsParamsOutput = zod.output<typeof ListMonthlyStatementsParams>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Billing API
|
|
5
|
+
* Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
|
|
6
|
+
* OpenAPI spec version: v1
|
|
7
|
+
*/
|
|
8
|
+
import * as zod from "zod";
|
|
9
|
+
export const listMonthlyStatementsParamsPageDefault = 1;
|
|
10
|
+
export const listMonthlyStatementsParamsPageMax = 2147483647;
|
|
11
|
+
export const listMonthlyStatementsParamsPageSizeDefault = 50;
|
|
12
|
+
export const listMonthlyStatementsParamsPageSizeMax = 200;
|
|
13
|
+
export const ListMonthlyStatementsParams = zod.strictObject({
|
|
14
|
+
billing_account_id: zod.int().optional(),
|
|
15
|
+
from: zod.iso.datetime({ offset: true }).optional(),
|
|
16
|
+
to: zod.iso.datetime({ offset: true }).optional(),
|
|
17
|
+
page: zod
|
|
18
|
+
.int()
|
|
19
|
+
.min(1)
|
|
20
|
+
.max(listMonthlyStatementsParamsPageMax)
|
|
21
|
+
.default(listMonthlyStatementsParamsPageDefault),
|
|
22
|
+
page_size: zod
|
|
23
|
+
.int()
|
|
24
|
+
.min(1)
|
|
25
|
+
.max(listMonthlyStatementsParamsPageSizeMax)
|
|
26
|
+
.default(listMonthlyStatementsParamsPageSizeDefault),
|
|
27
|
+
});
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Billing API
|
|
5
|
+
* Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
|
|
6
|
+
* OpenAPI spec version: v1
|
|
7
|
+
*/
|
|
8
|
+
import * as zod from "zod";
|
|
9
|
+
export declare const MonthlyStatement: zod.ZodObject<{
|
|
10
|
+
billing_account_id: zod.ZodInt;
|
|
11
|
+
currency: zod.ZodString;
|
|
12
|
+
period_start: zod.z.ZodISODateTime;
|
|
13
|
+
period_end: zod.z.ZodISODateTime;
|
|
14
|
+
finalized: zod.ZodBoolean;
|
|
15
|
+
finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
16
|
+
statement_count: zod.ZodInt;
|
|
17
|
+
billed: zod.ZodObject<{
|
|
18
|
+
subtotal: zod.ZodString;
|
|
19
|
+
discount_amount: zod.ZodString;
|
|
20
|
+
tax_amount: zod.ZodString;
|
|
21
|
+
total: zod.ZodString;
|
|
22
|
+
}, zod.z.core.$strict>;
|
|
23
|
+
credited_amount: zod.ZodString;
|
|
24
|
+
unbilled: zod.ZodOptional<zod.ZodObject<{
|
|
25
|
+
subtotal: zod.ZodString;
|
|
26
|
+
discount_amount: zod.ZodString;
|
|
27
|
+
tax_amount: zod.ZodString;
|
|
28
|
+
total: zod.ZodString;
|
|
29
|
+
}, zod.z.core.$strict>>;
|
|
30
|
+
credit_applied: zod.ZodString;
|
|
31
|
+
amount_paid: zod.ZodString;
|
|
32
|
+
amount_due: zod.ZodString;
|
|
33
|
+
amount_refunded: zod.ZodString;
|
|
34
|
+
}, zod.z.core.$strict>;
|
|
35
|
+
export type MonthlyStatement = zod.input<typeof MonthlyStatement>;
|
|
36
|
+
export type MonthlyStatementOutput = zod.output<typeof MonthlyStatement>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Billing API
|
|
5
|
+
* Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
|
|
6
|
+
* OpenAPI spec version: v1
|
|
7
|
+
*/
|
|
8
|
+
import * as zod from "zod";
|
|
9
|
+
import { Money } from "./money.zod.js";
|
|
10
|
+
import { StatementAmounts } from "./statementAmounts.zod.js";
|
|
11
|
+
export const MonthlyStatement = zod
|
|
12
|
+
.strictObject({
|
|
13
|
+
billing_account_id: zod.int(),
|
|
14
|
+
currency: zod.string(),
|
|
15
|
+
period_start: zod.iso.datetime({ offset: true }),
|
|
16
|
+
period_end: zod.iso.datetime({ offset: true }),
|
|
17
|
+
finalized: zod
|
|
18
|
+
.boolean()
|
|
19
|
+
.describe("True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here."),
|
|
20
|
+
finalized_at: zod.iso.datetime({ offset: true }).optional(),
|
|
21
|
+
statement_count: zod.int().describe("Statements of the period, including the open one."),
|
|
22
|
+
billed: StatementAmounts,
|
|
23
|
+
credited_amount: Money,
|
|
24
|
+
unbilled: StatementAmounts.optional(),
|
|
25
|
+
credit_applied: Money,
|
|
26
|
+
amount_paid: Money,
|
|
27
|
+
amount_due: Money,
|
|
28
|
+
amount_refunded: Money,
|
|
29
|
+
})
|
|
30
|
+
.describe("One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.");
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Billing API
|
|
5
|
+
* Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
|
|
6
|
+
* OpenAPI spec version: v1
|
|
7
|
+
*/
|
|
8
|
+
import * as zod from "zod";
|
|
9
|
+
export declare const MonthlyStatementList: zod.ZodObject<{
|
|
10
|
+
items: zod.ZodArray<zod.ZodObject<{
|
|
11
|
+
billing_account_id: zod.ZodInt;
|
|
12
|
+
currency: zod.ZodString;
|
|
13
|
+
period_start: zod.z.ZodISODateTime;
|
|
14
|
+
period_end: zod.z.ZodISODateTime;
|
|
15
|
+
finalized: zod.ZodBoolean;
|
|
16
|
+
finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
17
|
+
statement_count: zod.ZodInt;
|
|
18
|
+
billed: zod.ZodObject<{
|
|
19
|
+
subtotal: zod.ZodString;
|
|
20
|
+
discount_amount: zod.ZodString;
|
|
21
|
+
tax_amount: zod.ZodString;
|
|
22
|
+
total: zod.ZodString;
|
|
23
|
+
}, zod.z.core.$strict>;
|
|
24
|
+
credited_amount: zod.ZodString;
|
|
25
|
+
unbilled: zod.ZodOptional<zod.ZodObject<{
|
|
26
|
+
subtotal: zod.ZodString;
|
|
27
|
+
discount_amount: zod.ZodString;
|
|
28
|
+
tax_amount: zod.ZodString;
|
|
29
|
+
total: zod.ZodString;
|
|
30
|
+
}, zod.z.core.$strict>>;
|
|
31
|
+
credit_applied: zod.ZodString;
|
|
32
|
+
amount_paid: zod.ZodString;
|
|
33
|
+
amount_due: zod.ZodString;
|
|
34
|
+
amount_refunded: zod.ZodString;
|
|
35
|
+
}, zod.z.core.$strict>>;
|
|
36
|
+
pagination: zod.ZodObject<{
|
|
37
|
+
page: zod.ZodInt;
|
|
38
|
+
page_size: zod.ZodInt;
|
|
39
|
+
total_count: zod.ZodOptional<zod.ZodInt>;
|
|
40
|
+
}, zod.z.core.$strict>;
|
|
41
|
+
}, zod.z.core.$strict>;
|
|
42
|
+
export type MonthlyStatementList = zod.input<typeof MonthlyStatementList>;
|
|
43
|
+
export type MonthlyStatementListOutput = zod.output<typeof MonthlyStatementList>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Billing API
|
|
5
|
+
* Products, prices, orders, subscriptions and account billing. Financial operations require an account access token and billing-account authorization. Public catalogue operations declare no security requirement.
|
|
6
|
+
* OpenAPI spec version: v1
|
|
7
|
+
*/
|
|
8
|
+
import * as zod from "zod";
|
|
9
|
+
import { MonthlyStatement } from "./monthlyStatement.zod.js";
|
|
10
|
+
import { OffsetPagination } from "./offsetPagination.zod.js";
|
|
11
|
+
export const MonthlyStatementList = zod.strictObject({
|
|
12
|
+
items: zod.array(MonthlyStatement),
|
|
13
|
+
pagination: OffsetPagination,
|
|
14
|
+
});
|
|
@@ -3342,6 +3342,31 @@ export interface StatementAmounts {
|
|
|
3342
3342
|
tax_amount: Money;
|
|
3343
3343
|
total: Money;
|
|
3344
3344
|
}
|
|
3345
|
+
/**
|
|
3346
|
+
* One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.
|
|
3347
|
+
*/
|
|
3348
|
+
export interface MonthlyStatement {
|
|
3349
|
+
billing_account_id: number;
|
|
3350
|
+
currency: string;
|
|
3351
|
+
period_start: string;
|
|
3352
|
+
period_end: string;
|
|
3353
|
+
/** True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here. */
|
|
3354
|
+
finalized: boolean;
|
|
3355
|
+
finalized_at?: string;
|
|
3356
|
+
/** Statements of the period, including the open one. */
|
|
3357
|
+
statement_count: number;
|
|
3358
|
+
billed: StatementAmounts;
|
|
3359
|
+
credited_amount: Money;
|
|
3360
|
+
unbilled?: StatementAmounts;
|
|
3361
|
+
credit_applied: Money;
|
|
3362
|
+
amount_paid: Money;
|
|
3363
|
+
amount_due: Money;
|
|
3364
|
+
amount_refunded: Money;
|
|
3365
|
+
}
|
|
3366
|
+
export interface MonthlyStatementList {
|
|
3367
|
+
items: MonthlyStatement[];
|
|
3368
|
+
pagination: OffsetPagination;
|
|
3369
|
+
}
|
|
3345
3370
|
export type StatementStatus = (typeof StatementStatus)[keyof typeof StatementStatus];
|
|
3346
3371
|
export declare const StatementStatus: {
|
|
3347
3372
|
readonly open: "open";
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Canopy API
|
|
5
|
+
* Management of API keys, together with the models available and the usage recorded against them.
|
|
6
|
+
*
|
|
7
|
+
* **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
|
|
8
|
+
*
|
|
9
|
+
* ```
|
|
10
|
+
* POST /v1/chat/completions OpenAI
|
|
11
|
+
* POST /v1/messages Anthropic
|
|
12
|
+
* POST /v1beta/models/{model}:generateContent Gemini
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* ## Authentication
|
|
16
|
+
*
|
|
17
|
+
* Every request carries a scoped token; see the `bearerAuth` security scheme.
|
|
18
|
+
*
|
|
19
|
+
* These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
|
|
20
|
+
*
|
|
21
|
+
* ## Conventions
|
|
22
|
+
*
|
|
23
|
+
* - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
|
|
24
|
+
* - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
|
|
25
|
+
* - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
|
|
26
|
+
* - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
|
|
27
|
+
* - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
|
|
28
|
+
* - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
|
|
29
|
+
* OpenAPI spec version: 1.0.0
|
|
30
|
+
*/
|
|
31
|
+
import * as zod from "zod";
|
|
32
|
+
export declare const MonthlyStatement: zod.ZodObject<{
|
|
33
|
+
billing_account_id: zod.ZodInt;
|
|
34
|
+
currency: zod.ZodString;
|
|
35
|
+
period_start: zod.z.ZodISODateTime;
|
|
36
|
+
period_end: zod.z.ZodISODateTime;
|
|
37
|
+
finalized: zod.ZodBoolean;
|
|
38
|
+
finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
39
|
+
statement_count: zod.ZodInt;
|
|
40
|
+
billed: zod.ZodObject<{
|
|
41
|
+
subtotal: zod.ZodString;
|
|
42
|
+
discount_amount: zod.ZodString;
|
|
43
|
+
tax_amount: zod.ZodString;
|
|
44
|
+
total: zod.ZodString;
|
|
45
|
+
}, zod.z.core.$strict>;
|
|
46
|
+
credited_amount: zod.ZodString;
|
|
47
|
+
unbilled: zod.ZodOptional<zod.ZodObject<{
|
|
48
|
+
subtotal: zod.ZodString;
|
|
49
|
+
discount_amount: zod.ZodString;
|
|
50
|
+
tax_amount: zod.ZodString;
|
|
51
|
+
total: zod.ZodString;
|
|
52
|
+
}, zod.z.core.$strict>>;
|
|
53
|
+
credit_applied: zod.ZodString;
|
|
54
|
+
amount_paid: zod.ZodString;
|
|
55
|
+
amount_due: zod.ZodString;
|
|
56
|
+
amount_refunded: zod.ZodString;
|
|
57
|
+
}, zod.z.core.$strict>;
|
|
58
|
+
export type MonthlyStatement = zod.input<typeof MonthlyStatement>;
|
|
59
|
+
export type MonthlyStatementOutput = zod.output<typeof MonthlyStatement>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Canopy API
|
|
5
|
+
* Management of API keys, together with the models available and the usage recorded against them.
|
|
6
|
+
*
|
|
7
|
+
* **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
|
|
8
|
+
*
|
|
9
|
+
* ```
|
|
10
|
+
* POST /v1/chat/completions OpenAI
|
|
11
|
+
* POST /v1/messages Anthropic
|
|
12
|
+
* POST /v1beta/models/{model}:generateContent Gemini
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* ## Authentication
|
|
16
|
+
*
|
|
17
|
+
* Every request carries a scoped token; see the `bearerAuth` security scheme.
|
|
18
|
+
*
|
|
19
|
+
* These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
|
|
20
|
+
*
|
|
21
|
+
* ## Conventions
|
|
22
|
+
*
|
|
23
|
+
* - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
|
|
24
|
+
* - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
|
|
25
|
+
* - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
|
|
26
|
+
* - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
|
|
27
|
+
* - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
|
|
28
|
+
* - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
|
|
29
|
+
* OpenAPI spec version: 1.0.0
|
|
30
|
+
*/
|
|
31
|
+
import * as zod from "zod";
|
|
32
|
+
import { Money } from "./money.zod.js";
|
|
33
|
+
import { StatementAmounts } from "./statementAmounts.zod.js";
|
|
34
|
+
export const MonthlyStatement = zod
|
|
35
|
+
.strictObject({
|
|
36
|
+
billing_account_id: zod.int(),
|
|
37
|
+
currency: zod.string(),
|
|
38
|
+
period_start: zod.iso.datetime({ offset: true }),
|
|
39
|
+
period_end: zod.iso.datetime({ offset: true }),
|
|
40
|
+
finalized: zod
|
|
41
|
+
.boolean()
|
|
42
|
+
.describe("True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here."),
|
|
43
|
+
finalized_at: zod.iso.datetime({ offset: true }).optional(),
|
|
44
|
+
statement_count: zod.int().describe("Statements of the period, including the open one."),
|
|
45
|
+
billed: StatementAmounts,
|
|
46
|
+
credited_amount: Money,
|
|
47
|
+
unbilled: StatementAmounts.optional(),
|
|
48
|
+
credit_applied: Money,
|
|
49
|
+
amount_paid: Money,
|
|
50
|
+
amount_due: Money,
|
|
51
|
+
amount_refunded: Money,
|
|
52
|
+
})
|
|
53
|
+
.describe("One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.");
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Canopy API
|
|
5
|
+
* Management of API keys, together with the models available and the usage recorded against them.
|
|
6
|
+
*
|
|
7
|
+
* **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
|
|
8
|
+
*
|
|
9
|
+
* ```
|
|
10
|
+
* POST /v1/chat/completions OpenAI
|
|
11
|
+
* POST /v1/messages Anthropic
|
|
12
|
+
* POST /v1beta/models/{model}:generateContent Gemini
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* ## Authentication
|
|
16
|
+
*
|
|
17
|
+
* Every request carries a scoped token; see the `bearerAuth` security scheme.
|
|
18
|
+
*
|
|
19
|
+
* These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
|
|
20
|
+
*
|
|
21
|
+
* ## Conventions
|
|
22
|
+
*
|
|
23
|
+
* - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
|
|
24
|
+
* - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
|
|
25
|
+
* - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
|
|
26
|
+
* - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
|
|
27
|
+
* - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
|
|
28
|
+
* - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
|
|
29
|
+
* OpenAPI spec version: 1.0.0
|
|
30
|
+
*/
|
|
31
|
+
import * as zod from "zod";
|
|
32
|
+
export declare const MonthlyStatementList: zod.ZodObject<{
|
|
33
|
+
items: zod.ZodArray<zod.ZodObject<{
|
|
34
|
+
billing_account_id: zod.ZodInt;
|
|
35
|
+
currency: zod.ZodString;
|
|
36
|
+
period_start: zod.z.ZodISODateTime;
|
|
37
|
+
period_end: zod.z.ZodISODateTime;
|
|
38
|
+
finalized: zod.ZodBoolean;
|
|
39
|
+
finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
40
|
+
statement_count: zod.ZodInt;
|
|
41
|
+
billed: zod.ZodObject<{
|
|
42
|
+
subtotal: zod.ZodString;
|
|
43
|
+
discount_amount: zod.ZodString;
|
|
44
|
+
tax_amount: zod.ZodString;
|
|
45
|
+
total: zod.ZodString;
|
|
46
|
+
}, zod.z.core.$strict>;
|
|
47
|
+
credited_amount: zod.ZodString;
|
|
48
|
+
unbilled: zod.ZodOptional<zod.ZodObject<{
|
|
49
|
+
subtotal: zod.ZodString;
|
|
50
|
+
discount_amount: zod.ZodString;
|
|
51
|
+
tax_amount: zod.ZodString;
|
|
52
|
+
total: zod.ZodString;
|
|
53
|
+
}, zod.z.core.$strict>>;
|
|
54
|
+
credit_applied: zod.ZodString;
|
|
55
|
+
amount_paid: zod.ZodString;
|
|
56
|
+
amount_due: zod.ZodString;
|
|
57
|
+
amount_refunded: zod.ZodString;
|
|
58
|
+
}, zod.z.core.$strict>>;
|
|
59
|
+
pagination: zod.ZodObject<{
|
|
60
|
+
page: zod.ZodInt;
|
|
61
|
+
page_size: zod.ZodInt;
|
|
62
|
+
total_count: zod.ZodOptional<zod.ZodInt>;
|
|
63
|
+
}, zod.z.core.$strict>;
|
|
64
|
+
}, zod.z.core.$strict>;
|
|
65
|
+
export type MonthlyStatementList = zod.input<typeof MonthlyStatementList>;
|
|
66
|
+
export type MonthlyStatementListOutput = zod.output<typeof MonthlyStatementList>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Canopy API
|
|
5
|
+
* Management of API keys, together with the models available and the usage recorded against them.
|
|
6
|
+
*
|
|
7
|
+
* **These endpoints do not perform inference.** Requests are issued to the forwarding address, which accepts the OpenAI, Anthropic and Gemini request formats:
|
|
8
|
+
*
|
|
9
|
+
* ```
|
|
10
|
+
* POST /v1/chat/completions OpenAI
|
|
11
|
+
* POST /v1/messages Anthropic
|
|
12
|
+
* POST /v1beta/models/{model}:generateContent Gemini
|
|
13
|
+
* ```
|
|
14
|
+
*
|
|
15
|
+
* ## Authentication
|
|
16
|
+
*
|
|
17
|
+
* Every request carries a scoped token; see the `bearerAuth` security scheme.
|
|
18
|
+
*
|
|
19
|
+
* These endpoints do not accept an API key, and the forwarding endpoints do not accept a scoped token.
|
|
20
|
+
*
|
|
21
|
+
* ## Conventions
|
|
22
|
+
*
|
|
23
|
+
* - **The plaintext of an API key is returned once.** The `secret` appears in the response that issues it and is returned by no other endpoint. A key that has been lost has to be revoked and reissued.
|
|
24
|
+
* - **Disabling and revoking are distinct.** A disabled key may be enabled again at any time, while a revocation is irreversible and is intended for a key that has been exposed. Neither removes the record, and the usage the key accrued remains readable.
|
|
25
|
+
* - **A usage query must carry a time range**, spanning no more than 31 days. `from` and `to` carry a timezone offset, which the server does not infer.
|
|
26
|
+
* - **The request and response bodies do not appear in the ledger.** They are not recorded. Quote the `upstream_request_id` from the response when reporting a problem.
|
|
27
|
+
* - **Usage may be estimated.** The upstream provider does not report usage on every request. Where it does not, `usage_source` is `estimated` and the figures are derived from the character classes of the payload, to within roughly fifteen per cent.
|
|
28
|
+
* - **The service is enabled before use.** A project enables the model platform once, through `create-service`; the forwarding endpoints refuse its requests until the service is `active`. Requests are then billed under the service's subscription by the tokens they use, at the rates stated in each model's `pricing`.
|
|
29
|
+
* OpenAPI spec version: 1.0.0
|
|
30
|
+
*/
|
|
31
|
+
import * as zod from "zod";
|
|
32
|
+
import { MonthlyStatement } from "./monthlyStatement.zod.js";
|
|
33
|
+
import { OffsetPagination } from "./offsetPagination.zod.js";
|
|
34
|
+
export const MonthlyStatementList = zod.strictObject({
|
|
35
|
+
items: zod.array(MonthlyStatement),
|
|
36
|
+
pagination: OffsetPagination,
|
|
37
|
+
});
|
|
@@ -5288,6 +5288,31 @@ export interface StatementAmounts {
|
|
|
5288
5288
|
tax_amount: Money;
|
|
5289
5289
|
total: Money;
|
|
5290
5290
|
}
|
|
5291
|
+
/**
|
|
5292
|
+
* One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.
|
|
5293
|
+
*/
|
|
5294
|
+
export interface MonthlyStatement {
|
|
5295
|
+
billing_account_id: number;
|
|
5296
|
+
currency: string;
|
|
5297
|
+
period_start: string;
|
|
5298
|
+
period_end: string;
|
|
5299
|
+
/** True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here. */
|
|
5300
|
+
finalized: boolean;
|
|
5301
|
+
finalized_at?: string;
|
|
5302
|
+
/** Statements of the period, including the open one. */
|
|
5303
|
+
statement_count: number;
|
|
5304
|
+
billed: StatementAmounts;
|
|
5305
|
+
credited_amount: Money;
|
|
5306
|
+
unbilled?: StatementAmounts;
|
|
5307
|
+
credit_applied: Money;
|
|
5308
|
+
amount_paid: Money;
|
|
5309
|
+
amount_due: Money;
|
|
5310
|
+
amount_refunded: Money;
|
|
5311
|
+
}
|
|
5312
|
+
export interface MonthlyStatementList {
|
|
5313
|
+
items: MonthlyStatement[];
|
|
5314
|
+
pagination: OffsetPagination;
|
|
5315
|
+
}
|
|
5291
5316
|
export type StatementStatus = (typeof StatementStatus)[keyof typeof StatementStatus];
|
|
5292
5317
|
export declare const StatementStatus: {
|
|
5293
5318
|
readonly open: "open";
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Compute API
|
|
5
|
+
* Leaflow Compute user API for managing instances, disks, snapshots, backups, images, private networks, subnets, routes, security groups, network interfaces and floating IPs.
|
|
6
|
+
*
|
|
7
|
+
* ## Authentication
|
|
8
|
+
*
|
|
9
|
+
* Every request carries a scoped token; see the `scopedTokenAuth` security scheme.
|
|
10
|
+
*
|
|
11
|
+
* ## Conventions
|
|
12
|
+
*
|
|
13
|
+
* - **Purchases.** A purchase that creates resources returns them together with a PlacedOrder. They are readable at once and start as `pending`: the order has not been accepted, nothing exists in the cloud, no inventory such as an address is held, and fields known only after allocation, such as addresses, are null. Once Billing accepts the order, a resource becomes `provisioning` and then reaches its usual status, such as `active` or `available`. When the order is declined, canceled or expires, or creation fails, the resource ends `failed` and `failure_reason` states why; the charge for a resource that failed after acceptance is refunded. Read the order in Billing for checkout and payment progress.
|
|
14
|
+
* - **Pricing.** Catalog items, such as instance types, disk types and public IP pools, carry `pricing`: the prepaid and postpaid options Billing offers for them, in the currency of the project's current billing account, or null when the project has no billing account. They are list amounts before promotion codes, not a checkout guarantee. A purchase chooses one option with `billing`, which applies to all of its components. Every purchase and change has a quote operation beside it, at the same path followed by `/quote`, which returns what checkout would collect without ordering anything.
|
|
15
|
+
* - **Checkout.** Omit `checkout` for automatic checkout, which pays from eligible credit grants and balance when the order is placed; insufficient funds refuse the request with HTTP 422 `BILLING_INSUFFICIENT_FUNDS`, and nothing is created. With `checkout.mode` set to `deferred`, the resources are returned `pending` and nothing is created until checkout is confirmed and paid through Billing. An order whose total is zero, such as a postpaid purchase with nothing due now, completes checkout at placement in either mode and proceeds to provisioning.
|
|
16
|
+
* - **Operations.** Requests such as starting, stopping, attaching or deleting return HTTP 202 with the resource as it is when the request is accepted. While an operation runs, the resource's `operation` field names it; the field is null once the operation has finished, and the resource then shows the result. A resource with an operation in progress refuses another operation with HTTP 409 `COMPUTE_RESOURCE_BUSY`; an operation involving two resources, such as attaching a disk, is refused when either has one. A purchased change, such as a resize, is an operation from the moment its order is placed until it is applied or its order is canceled, including while it awaits checkout. Renaming and replacing labels or notes are not operations and are accepted at any time.
|
|
17
|
+
* - **Billing relationships.** A purchased resource records its `order_id`, `order_item_id` and `subscription_id`. The subscription is `pending` until the order is accepted, `provisioning` while the resource is created, and `active` once it is delivered. Bandwidth is a property of its floating IP, not a separate resource. Snapshots use a purchased per-region count quota, and backups are metered on the region's backup service; neither has an order or subscription of its own.
|
|
18
|
+
* - **Availability zones.** A disk and an instance must reside in the same availability zone to be attached. Instance types and disk types are each bound to one availability zone, so choosing a type determines the zone.
|
|
19
|
+
* - **IPv6 is not sold separately.** Once enabled on a private network, IPv6 addresses are assigned to the instances in that network automatically; they can be neither requested nor released individually.
|
|
20
|
+
* - **Floating IPs have a cooldown period.** A released address is neither available for re-allocation nor handed to another user for some time, so that DNS records and allow-lists still pointing at it do not break immediately.
|
|
21
|
+
* - **Passwords are returned once.** A password generated by the platform during creation or rebuild appears only in that response. Store it immediately.
|
|
22
|
+
* OpenAPI spec version: 1.0.0
|
|
23
|
+
*/
|
|
24
|
+
import * as zod from "zod";
|
|
25
|
+
export declare const MonthlyStatement: zod.ZodObject<{
|
|
26
|
+
billing_account_id: zod.ZodInt;
|
|
27
|
+
currency: zod.ZodString;
|
|
28
|
+
period_start: zod.z.ZodISODateTime;
|
|
29
|
+
period_end: zod.z.ZodISODateTime;
|
|
30
|
+
finalized: zod.ZodBoolean;
|
|
31
|
+
finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
32
|
+
statement_count: zod.ZodInt;
|
|
33
|
+
billed: zod.ZodObject<{
|
|
34
|
+
subtotal: zod.ZodString;
|
|
35
|
+
discount_amount: zod.ZodString;
|
|
36
|
+
tax_amount: zod.ZodString;
|
|
37
|
+
total: zod.ZodString;
|
|
38
|
+
}, zod.z.core.$strict>;
|
|
39
|
+
credited_amount: zod.ZodString;
|
|
40
|
+
unbilled: zod.ZodOptional<zod.ZodObject<{
|
|
41
|
+
subtotal: zod.ZodString;
|
|
42
|
+
discount_amount: zod.ZodString;
|
|
43
|
+
tax_amount: zod.ZodString;
|
|
44
|
+
total: zod.ZodString;
|
|
45
|
+
}, zod.z.core.$strict>>;
|
|
46
|
+
credit_applied: zod.ZodString;
|
|
47
|
+
amount_paid: zod.ZodString;
|
|
48
|
+
amount_due: zod.ZodString;
|
|
49
|
+
amount_refunded: zod.ZodString;
|
|
50
|
+
}, zod.z.core.$strict>;
|
|
51
|
+
export type MonthlyStatement = zod.input<typeof MonthlyStatement>;
|
|
52
|
+
export type MonthlyStatementOutput = zod.output<typeof MonthlyStatement>;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Compute API
|
|
5
|
+
* Leaflow Compute user API for managing instances, disks, snapshots, backups, images, private networks, subnets, routes, security groups, network interfaces and floating IPs.
|
|
6
|
+
*
|
|
7
|
+
* ## Authentication
|
|
8
|
+
*
|
|
9
|
+
* Every request carries a scoped token; see the `scopedTokenAuth` security scheme.
|
|
10
|
+
*
|
|
11
|
+
* ## Conventions
|
|
12
|
+
*
|
|
13
|
+
* - **Purchases.** A purchase that creates resources returns them together with a PlacedOrder. They are readable at once and start as `pending`: the order has not been accepted, nothing exists in the cloud, no inventory such as an address is held, and fields known only after allocation, such as addresses, are null. Once Billing accepts the order, a resource becomes `provisioning` and then reaches its usual status, such as `active` or `available`. When the order is declined, canceled or expires, or creation fails, the resource ends `failed` and `failure_reason` states why; the charge for a resource that failed after acceptance is refunded. Read the order in Billing for checkout and payment progress.
|
|
14
|
+
* - **Pricing.** Catalog items, such as instance types, disk types and public IP pools, carry `pricing`: the prepaid and postpaid options Billing offers for them, in the currency of the project's current billing account, or null when the project has no billing account. They are list amounts before promotion codes, not a checkout guarantee. A purchase chooses one option with `billing`, which applies to all of its components. Every purchase and change has a quote operation beside it, at the same path followed by `/quote`, which returns what checkout would collect without ordering anything.
|
|
15
|
+
* - **Checkout.** Omit `checkout` for automatic checkout, which pays from eligible credit grants and balance when the order is placed; insufficient funds refuse the request with HTTP 422 `BILLING_INSUFFICIENT_FUNDS`, and nothing is created. With `checkout.mode` set to `deferred`, the resources are returned `pending` and nothing is created until checkout is confirmed and paid through Billing. An order whose total is zero, such as a postpaid purchase with nothing due now, completes checkout at placement in either mode and proceeds to provisioning.
|
|
16
|
+
* - **Operations.** Requests such as starting, stopping, attaching or deleting return HTTP 202 with the resource as it is when the request is accepted. While an operation runs, the resource's `operation` field names it; the field is null once the operation has finished, and the resource then shows the result. A resource with an operation in progress refuses another operation with HTTP 409 `COMPUTE_RESOURCE_BUSY`; an operation involving two resources, such as attaching a disk, is refused when either has one. A purchased change, such as a resize, is an operation from the moment its order is placed until it is applied or its order is canceled, including while it awaits checkout. Renaming and replacing labels or notes are not operations and are accepted at any time.
|
|
17
|
+
* - **Billing relationships.** A purchased resource records its `order_id`, `order_item_id` and `subscription_id`. The subscription is `pending` until the order is accepted, `provisioning` while the resource is created, and `active` once it is delivered. Bandwidth is a property of its floating IP, not a separate resource. Snapshots use a purchased per-region count quota, and backups are metered on the region's backup service; neither has an order or subscription of its own.
|
|
18
|
+
* - **Availability zones.** A disk and an instance must reside in the same availability zone to be attached. Instance types and disk types are each bound to one availability zone, so choosing a type determines the zone.
|
|
19
|
+
* - **IPv6 is not sold separately.** Once enabled on a private network, IPv6 addresses are assigned to the instances in that network automatically; they can be neither requested nor released individually.
|
|
20
|
+
* - **Floating IPs have a cooldown period.** A released address is neither available for re-allocation nor handed to another user for some time, so that DNS records and allow-lists still pointing at it do not break immediately.
|
|
21
|
+
* - **Passwords are returned once.** A password generated by the platform during creation or rebuild appears only in that response. Store it immediately.
|
|
22
|
+
* OpenAPI spec version: 1.0.0
|
|
23
|
+
*/
|
|
24
|
+
import * as zod from "zod";
|
|
25
|
+
import { Money } from "./money.zod.js";
|
|
26
|
+
import { StatementAmounts } from "./statementAmounts.zod.js";
|
|
27
|
+
export const MonthlyStatement = zod
|
|
28
|
+
.strictObject({
|
|
29
|
+
billing_account_id: zod.int(),
|
|
30
|
+
currency: zod.string(),
|
|
31
|
+
period_start: zod.iso.datetime({ offset: true }),
|
|
32
|
+
period_end: zod.iso.datetime({ offset: true }),
|
|
33
|
+
finalized: zod
|
|
34
|
+
.boolean()
|
|
35
|
+
.describe("True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here."),
|
|
36
|
+
finalized_at: zod.iso.datetime({ offset: true }).optional(),
|
|
37
|
+
statement_count: zod.int().describe("Statements of the period, including the open one."),
|
|
38
|
+
billed: StatementAmounts,
|
|
39
|
+
credited_amount: Money,
|
|
40
|
+
unbilled: StatementAmounts.optional(),
|
|
41
|
+
credit_applied: Money,
|
|
42
|
+
amount_paid: Money,
|
|
43
|
+
amount_due: Money,
|
|
44
|
+
amount_refunded: Money,
|
|
45
|
+
})
|
|
46
|
+
.describe("One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.");
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Compute API
|
|
5
|
+
* Leaflow Compute user API for managing instances, disks, snapshots, backups, images, private networks, subnets, routes, security groups, network interfaces and floating IPs.
|
|
6
|
+
*
|
|
7
|
+
* ## Authentication
|
|
8
|
+
*
|
|
9
|
+
* Every request carries a scoped token; see the `scopedTokenAuth` security scheme.
|
|
10
|
+
*
|
|
11
|
+
* ## Conventions
|
|
12
|
+
*
|
|
13
|
+
* - **Purchases.** A purchase that creates resources returns them together with a PlacedOrder. They are readable at once and start as `pending`: the order has not been accepted, nothing exists in the cloud, no inventory such as an address is held, and fields known only after allocation, such as addresses, are null. Once Billing accepts the order, a resource becomes `provisioning` and then reaches its usual status, such as `active` or `available`. When the order is declined, canceled or expires, or creation fails, the resource ends `failed` and `failure_reason` states why; the charge for a resource that failed after acceptance is refunded. Read the order in Billing for checkout and payment progress.
|
|
14
|
+
* - **Pricing.** Catalog items, such as instance types, disk types and public IP pools, carry `pricing`: the prepaid and postpaid options Billing offers for them, in the currency of the project's current billing account, or null when the project has no billing account. They are list amounts before promotion codes, not a checkout guarantee. A purchase chooses one option with `billing`, which applies to all of its components. Every purchase and change has a quote operation beside it, at the same path followed by `/quote`, which returns what checkout would collect without ordering anything.
|
|
15
|
+
* - **Checkout.** Omit `checkout` for automatic checkout, which pays from eligible credit grants and balance when the order is placed; insufficient funds refuse the request with HTTP 422 `BILLING_INSUFFICIENT_FUNDS`, and nothing is created. With `checkout.mode` set to `deferred`, the resources are returned `pending` and nothing is created until checkout is confirmed and paid through Billing. An order whose total is zero, such as a postpaid purchase with nothing due now, completes checkout at placement in either mode and proceeds to provisioning.
|
|
16
|
+
* - **Operations.** Requests such as starting, stopping, attaching or deleting return HTTP 202 with the resource as it is when the request is accepted. While an operation runs, the resource's `operation` field names it; the field is null once the operation has finished, and the resource then shows the result. A resource with an operation in progress refuses another operation with HTTP 409 `COMPUTE_RESOURCE_BUSY`; an operation involving two resources, such as attaching a disk, is refused when either has one. A purchased change, such as a resize, is an operation from the moment its order is placed until it is applied or its order is canceled, including while it awaits checkout. Renaming and replacing labels or notes are not operations and are accepted at any time.
|
|
17
|
+
* - **Billing relationships.** A purchased resource records its `order_id`, `order_item_id` and `subscription_id`. The subscription is `pending` until the order is accepted, `provisioning` while the resource is created, and `active` once it is delivered. Bandwidth is a property of its floating IP, not a separate resource. Snapshots use a purchased per-region count quota, and backups are metered on the region's backup service; neither has an order or subscription of its own.
|
|
18
|
+
* - **Availability zones.** A disk and an instance must reside in the same availability zone to be attached. Instance types and disk types are each bound to one availability zone, so choosing a type determines the zone.
|
|
19
|
+
* - **IPv6 is not sold separately.** Once enabled on a private network, IPv6 addresses are assigned to the instances in that network automatically; they can be neither requested nor released individually.
|
|
20
|
+
* - **Floating IPs have a cooldown period.** A released address is neither available for re-allocation nor handed to another user for some time, so that DNS records and allow-lists still pointing at it do not break immediately.
|
|
21
|
+
* - **Passwords are returned once.** A password generated by the platform during creation or rebuild appears only in that response. Store it immediately.
|
|
22
|
+
* OpenAPI spec version: 1.0.0
|
|
23
|
+
*/
|
|
24
|
+
import * as zod from "zod";
|
|
25
|
+
export declare const MonthlyStatementList: zod.ZodObject<{
|
|
26
|
+
items: zod.ZodArray<zod.ZodObject<{
|
|
27
|
+
billing_account_id: zod.ZodInt;
|
|
28
|
+
currency: zod.ZodString;
|
|
29
|
+
period_start: zod.z.ZodISODateTime;
|
|
30
|
+
period_end: zod.z.ZodISODateTime;
|
|
31
|
+
finalized: zod.ZodBoolean;
|
|
32
|
+
finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
33
|
+
statement_count: zod.ZodInt;
|
|
34
|
+
billed: zod.ZodObject<{
|
|
35
|
+
subtotal: zod.ZodString;
|
|
36
|
+
discount_amount: zod.ZodString;
|
|
37
|
+
tax_amount: zod.ZodString;
|
|
38
|
+
total: zod.ZodString;
|
|
39
|
+
}, zod.z.core.$strict>;
|
|
40
|
+
credited_amount: zod.ZodString;
|
|
41
|
+
unbilled: zod.ZodOptional<zod.ZodObject<{
|
|
42
|
+
subtotal: zod.ZodString;
|
|
43
|
+
discount_amount: zod.ZodString;
|
|
44
|
+
tax_amount: zod.ZodString;
|
|
45
|
+
total: zod.ZodString;
|
|
46
|
+
}, zod.z.core.$strict>>;
|
|
47
|
+
credit_applied: zod.ZodString;
|
|
48
|
+
amount_paid: zod.ZodString;
|
|
49
|
+
amount_due: zod.ZodString;
|
|
50
|
+
amount_refunded: zod.ZodString;
|
|
51
|
+
}, zod.z.core.$strict>>;
|
|
52
|
+
pagination: zod.ZodObject<{
|
|
53
|
+
page: zod.ZodInt;
|
|
54
|
+
page_size: zod.ZodInt;
|
|
55
|
+
total_count: zod.ZodOptional<zod.ZodInt>;
|
|
56
|
+
}, zod.z.core.$strict>;
|
|
57
|
+
}, zod.z.core.$strict>;
|
|
58
|
+
export type MonthlyStatementList = zod.input<typeof MonthlyStatementList>;
|
|
59
|
+
export type MonthlyStatementListOutput = zod.output<typeof MonthlyStatementList>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Compute API
|
|
5
|
+
* Leaflow Compute user API for managing instances, disks, snapshots, backups, images, private networks, subnets, routes, security groups, network interfaces and floating IPs.
|
|
6
|
+
*
|
|
7
|
+
* ## Authentication
|
|
8
|
+
*
|
|
9
|
+
* Every request carries a scoped token; see the `scopedTokenAuth` security scheme.
|
|
10
|
+
*
|
|
11
|
+
* ## Conventions
|
|
12
|
+
*
|
|
13
|
+
* - **Purchases.** A purchase that creates resources returns them together with a PlacedOrder. They are readable at once and start as `pending`: the order has not been accepted, nothing exists in the cloud, no inventory such as an address is held, and fields known only after allocation, such as addresses, are null. Once Billing accepts the order, a resource becomes `provisioning` and then reaches its usual status, such as `active` or `available`. When the order is declined, canceled or expires, or creation fails, the resource ends `failed` and `failure_reason` states why; the charge for a resource that failed after acceptance is refunded. Read the order in Billing for checkout and payment progress.
|
|
14
|
+
* - **Pricing.** Catalog items, such as instance types, disk types and public IP pools, carry `pricing`: the prepaid and postpaid options Billing offers for them, in the currency of the project's current billing account, or null when the project has no billing account. They are list amounts before promotion codes, not a checkout guarantee. A purchase chooses one option with `billing`, which applies to all of its components. Every purchase and change has a quote operation beside it, at the same path followed by `/quote`, which returns what checkout would collect without ordering anything.
|
|
15
|
+
* - **Checkout.** Omit `checkout` for automatic checkout, which pays from eligible credit grants and balance when the order is placed; insufficient funds refuse the request with HTTP 422 `BILLING_INSUFFICIENT_FUNDS`, and nothing is created. With `checkout.mode` set to `deferred`, the resources are returned `pending` and nothing is created until checkout is confirmed and paid through Billing. An order whose total is zero, such as a postpaid purchase with nothing due now, completes checkout at placement in either mode and proceeds to provisioning.
|
|
16
|
+
* - **Operations.** Requests such as starting, stopping, attaching or deleting return HTTP 202 with the resource as it is when the request is accepted. While an operation runs, the resource's `operation` field names it; the field is null once the operation has finished, and the resource then shows the result. A resource with an operation in progress refuses another operation with HTTP 409 `COMPUTE_RESOURCE_BUSY`; an operation involving two resources, such as attaching a disk, is refused when either has one. A purchased change, such as a resize, is an operation from the moment its order is placed until it is applied or its order is canceled, including while it awaits checkout. Renaming and replacing labels or notes are not operations and are accepted at any time.
|
|
17
|
+
* - **Billing relationships.** A purchased resource records its `order_id`, `order_item_id` and `subscription_id`. The subscription is `pending` until the order is accepted, `provisioning` while the resource is created, and `active` once it is delivered. Bandwidth is a property of its floating IP, not a separate resource. Snapshots use a purchased per-region count quota, and backups are metered on the region's backup service; neither has an order or subscription of its own.
|
|
18
|
+
* - **Availability zones.** A disk and an instance must reside in the same availability zone to be attached. Instance types and disk types are each bound to one availability zone, so choosing a type determines the zone.
|
|
19
|
+
* - **IPv6 is not sold separately.** Once enabled on a private network, IPv6 addresses are assigned to the instances in that network automatically; they can be neither requested nor released individually.
|
|
20
|
+
* - **Floating IPs have a cooldown period.** A released address is neither available for re-allocation nor handed to another user for some time, so that DNS records and allow-lists still pointing at it do not break immediately.
|
|
21
|
+
* - **Passwords are returned once.** A password generated by the platform during creation or rebuild appears only in that response. Store it immediately.
|
|
22
|
+
* OpenAPI spec version: 1.0.0
|
|
23
|
+
*/
|
|
24
|
+
import * as zod from "zod";
|
|
25
|
+
import { MonthlyStatement } from "./monthlyStatement.zod.js";
|
|
26
|
+
import { OffsetPagination } from "./offsetPagination.zod.js";
|
|
27
|
+
export const MonthlyStatementList = zod.strictObject({
|
|
28
|
+
items: zod.array(MonthlyStatement),
|
|
29
|
+
pagination: OffsetPagination,
|
|
30
|
+
});
|
|
@@ -3165,6 +3165,31 @@ export interface StatementAmounts {
|
|
|
3165
3165
|
tax_amount: Money;
|
|
3166
3166
|
total: Money;
|
|
3167
3167
|
}
|
|
3168
|
+
/**
|
|
3169
|
+
* One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.
|
|
3170
|
+
*/
|
|
3171
|
+
export interface MonthlyStatement {
|
|
3172
|
+
billing_account_id: number;
|
|
3173
|
+
currency: string;
|
|
3174
|
+
period_start: string;
|
|
3175
|
+
period_end: string;
|
|
3176
|
+
/** True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here. */
|
|
3177
|
+
finalized: boolean;
|
|
3178
|
+
finalized_at?: string;
|
|
3179
|
+
/** Statements of the period, including the open one. */
|
|
3180
|
+
statement_count: number;
|
|
3181
|
+
billed: StatementAmounts;
|
|
3182
|
+
credited_amount: Money;
|
|
3183
|
+
unbilled?: StatementAmounts;
|
|
3184
|
+
credit_applied: Money;
|
|
3185
|
+
amount_paid: Money;
|
|
3186
|
+
amount_due: Money;
|
|
3187
|
+
amount_refunded: Money;
|
|
3188
|
+
}
|
|
3189
|
+
export interface MonthlyStatementList {
|
|
3190
|
+
items: MonthlyStatement[];
|
|
3191
|
+
pagination: OffsetPagination;
|
|
3192
|
+
}
|
|
3168
3193
|
export type StatementStatus = (typeof StatementStatus)[keyof typeof StatementStatus];
|
|
3169
3194
|
export declare const StatementStatus: {
|
|
3170
3195
|
readonly open: "open";
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Membership API
|
|
5
|
+
* Membership tiers and account memberships. Catalog queries support any configured currency; purchases use the billing account currency.
|
|
6
|
+
* OpenAPI spec version: 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
import * as zod from "zod";
|
|
9
|
+
export declare const MonthlyStatement: zod.ZodObject<{
|
|
10
|
+
billing_account_id: zod.ZodInt;
|
|
11
|
+
currency: zod.ZodString;
|
|
12
|
+
period_start: zod.z.ZodISODateTime;
|
|
13
|
+
period_end: zod.z.ZodISODateTime;
|
|
14
|
+
finalized: zod.ZodBoolean;
|
|
15
|
+
finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
16
|
+
statement_count: zod.ZodInt;
|
|
17
|
+
billed: zod.ZodObject<{
|
|
18
|
+
subtotal: zod.ZodString;
|
|
19
|
+
discount_amount: zod.ZodString;
|
|
20
|
+
tax_amount: zod.ZodString;
|
|
21
|
+
total: zod.ZodString;
|
|
22
|
+
}, zod.z.core.$strict>;
|
|
23
|
+
credited_amount: zod.ZodString;
|
|
24
|
+
unbilled: zod.ZodOptional<zod.ZodObject<{
|
|
25
|
+
subtotal: zod.ZodString;
|
|
26
|
+
discount_amount: zod.ZodString;
|
|
27
|
+
tax_amount: zod.ZodString;
|
|
28
|
+
total: zod.ZodString;
|
|
29
|
+
}, zod.z.core.$strict>>;
|
|
30
|
+
credit_applied: zod.ZodString;
|
|
31
|
+
amount_paid: zod.ZodString;
|
|
32
|
+
amount_due: zod.ZodString;
|
|
33
|
+
amount_refunded: zod.ZodString;
|
|
34
|
+
}, zod.z.core.$strict>;
|
|
35
|
+
export type MonthlyStatement = zod.input<typeof MonthlyStatement>;
|
|
36
|
+
export type MonthlyStatementOutput = zod.output<typeof MonthlyStatement>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Membership API
|
|
5
|
+
* Membership tiers and account memberships. Catalog queries support any configured currency; purchases use the billing account currency.
|
|
6
|
+
* OpenAPI spec version: 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
import * as zod from "zod";
|
|
9
|
+
import { Money } from "./money.zod.js";
|
|
10
|
+
import { StatementAmounts } from "./statementAmounts.zod.js";
|
|
11
|
+
export const MonthlyStatement = zod
|
|
12
|
+
.strictObject({
|
|
13
|
+
billing_account_id: zod.int(),
|
|
14
|
+
currency: zod.string(),
|
|
15
|
+
period_start: zod.iso.datetime({ offset: true }),
|
|
16
|
+
period_end: zod.iso.datetime({ offset: true }),
|
|
17
|
+
finalized: zod
|
|
18
|
+
.boolean()
|
|
19
|
+
.describe("True after the period's final closing, which applies minimum charges for the whole month. Usage priced later is still billed in supplement statements and added here."),
|
|
20
|
+
finalized_at: zod.iso.datetime({ offset: true }).optional(),
|
|
21
|
+
statement_count: zod.int().describe("Statements of the period, including the open one."),
|
|
22
|
+
billed: StatementAmounts,
|
|
23
|
+
credited_amount: Money,
|
|
24
|
+
unbilled: StatementAmounts.optional(),
|
|
25
|
+
credit_applied: Money,
|
|
26
|
+
amount_paid: Money,
|
|
27
|
+
amount_due: Money,
|
|
28
|
+
amount_refunded: Money,
|
|
29
|
+
})
|
|
30
|
+
.describe("One billing account's usage billing for one UTC calendar month, summed over the month's statements. It is a summary, not something to pay; each closing's invoice is collected on its own.");
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Membership API
|
|
5
|
+
* Membership tiers and account memberships. Catalog queries support any configured currency; purchases use the billing account currency.
|
|
6
|
+
* OpenAPI spec version: 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
import * as zod from "zod";
|
|
9
|
+
export declare const MonthlyStatementList: zod.ZodObject<{
|
|
10
|
+
items: zod.ZodArray<zod.ZodObject<{
|
|
11
|
+
billing_account_id: zod.ZodInt;
|
|
12
|
+
currency: zod.ZodString;
|
|
13
|
+
period_start: zod.z.ZodISODateTime;
|
|
14
|
+
period_end: zod.z.ZodISODateTime;
|
|
15
|
+
finalized: zod.ZodBoolean;
|
|
16
|
+
finalized_at: zod.ZodOptional<zod.z.ZodISODateTime>;
|
|
17
|
+
statement_count: zod.ZodInt;
|
|
18
|
+
billed: zod.ZodObject<{
|
|
19
|
+
subtotal: zod.ZodString;
|
|
20
|
+
discount_amount: zod.ZodString;
|
|
21
|
+
tax_amount: zod.ZodString;
|
|
22
|
+
total: zod.ZodString;
|
|
23
|
+
}, zod.z.core.$strict>;
|
|
24
|
+
credited_amount: zod.ZodString;
|
|
25
|
+
unbilled: zod.ZodOptional<zod.ZodObject<{
|
|
26
|
+
subtotal: zod.ZodString;
|
|
27
|
+
discount_amount: zod.ZodString;
|
|
28
|
+
tax_amount: zod.ZodString;
|
|
29
|
+
total: zod.ZodString;
|
|
30
|
+
}, zod.z.core.$strict>>;
|
|
31
|
+
credit_applied: zod.ZodString;
|
|
32
|
+
amount_paid: zod.ZodString;
|
|
33
|
+
amount_due: zod.ZodString;
|
|
34
|
+
amount_refunded: zod.ZodString;
|
|
35
|
+
}, zod.z.core.$strict>>;
|
|
36
|
+
pagination: zod.ZodObject<{
|
|
37
|
+
page: zod.ZodInt;
|
|
38
|
+
page_size: zod.ZodInt;
|
|
39
|
+
total_count: zod.ZodOptional<zod.ZodInt>;
|
|
40
|
+
}, zod.z.core.$strict>;
|
|
41
|
+
}, zod.z.core.$strict>;
|
|
42
|
+
export type MonthlyStatementList = zod.input<typeof MonthlyStatementList>;
|
|
43
|
+
export type MonthlyStatementListOutput = zod.output<typeof MonthlyStatementList>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generated by orval 🍺
|
|
3
|
+
* Do not edit manually.
|
|
4
|
+
* Leaflow Membership API
|
|
5
|
+
* Membership tiers and account memberships. Catalog queries support any configured currency; purchases use the billing account currency.
|
|
6
|
+
* OpenAPI spec version: 1.0.0
|
|
7
|
+
*/
|
|
8
|
+
import * as zod from "zod";
|
|
9
|
+
import { MonthlyStatement } from "./monthlyStatement.zod.js";
|
|
10
|
+
import { OffsetPagination } from "./offsetPagination.zod.js";
|
|
11
|
+
export const MonthlyStatementList = zod.strictObject({
|
|
12
|
+
items: zod.array(MonthlyStatement),
|
|
13
|
+
pagination: OffsetPagination,
|
|
14
|
+
});
|
package/dist/routes.d.ts
CHANGED
|
@@ -1038,6 +1038,14 @@ export declare const routes: readonly [{
|
|
|
1038
1038
|
readonly operationId: "list-spend";
|
|
1039
1039
|
readonly securityScheme: "AccessToken";
|
|
1040
1040
|
readonly upstreamUrl: "https://billing.leaflow.cloud";
|
|
1041
|
+
}, {
|
|
1042
|
+
readonly service: "billing";
|
|
1043
|
+
readonly contract: "billing";
|
|
1044
|
+
readonly method: "GET";
|
|
1045
|
+
readonly path: "/api/v1/monthly-statements";
|
|
1046
|
+
readonly operationId: "list-monthly-statements";
|
|
1047
|
+
readonly securityScheme: "AccessToken";
|
|
1048
|
+
readonly upstreamUrl: "https://billing.leaflow.cloud";
|
|
1041
1049
|
}, {
|
|
1042
1050
|
readonly service: "billing";
|
|
1043
1051
|
readonly contract: "billing";
|
package/dist/routes.js
CHANGED
|
@@ -1170,6 +1170,15 @@ export const routes = [
|
|
|
1170
1170
|
securityScheme: "AccessToken",
|
|
1171
1171
|
upstreamUrl: "https://billing.leaflow.cloud",
|
|
1172
1172
|
},
|
|
1173
|
+
{
|
|
1174
|
+
service: "billing",
|
|
1175
|
+
contract: "billing",
|
|
1176
|
+
method: "GET",
|
|
1177
|
+
path: "/api/v1/monthly-statements",
|
|
1178
|
+
operationId: "list-monthly-statements",
|
|
1179
|
+
securityScheme: "AccessToken",
|
|
1180
|
+
upstreamUrl: "https://billing.leaflow.cloud",
|
|
1181
|
+
},
|
|
1173
1182
|
{
|
|
1174
1183
|
service: "billing",
|
|
1175
1184
|
contract: "billing",
|