@leaflow/sdk 0.119.0 → 0.121.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/dist/billing/v1/generated/functions.d.ts +1 -3
  2. package/dist/billing/v1/generated/functions.js +1 -3
  3. package/dist/billing/v1/generated/models.d.ts +56 -23
  4. package/dist/billing/v1/generated/models.js +10 -5
  5. package/dist/billing/v1/generated/schemas.zod.d.ts +3 -5
  6. package/dist/billing/v1/generated/schemas.zod.js +4 -6
  7. package/dist/billing/v1/generated/validators/activeResource.zod.d.ts +2 -2
  8. package/dist/billing/v1/generated/validators/activeResource.zod.js +3 -3
  9. package/dist/billing/v1/generated/validators/activeResourceList.zod.d.ts +2 -2
  10. package/dist/billing/v1/generated/validators/allowance.zod.d.ts +3 -2
  11. package/dist/billing/v1/generated/validators/allowance.zod.js +6 -3
  12. package/dist/billing/v1/generated/validators/allowanceList.zod.d.ts +3 -2
  13. package/dist/billing/v1/generated/validators/discount.zod.d.ts +6 -2
  14. package/dist/billing/v1/generated/validators/discount.zod.js +6 -3
  15. package/dist/billing/v1/generated/validators/discountList.zod.d.ts +6 -2
  16. package/dist/billing/v1/generated/validators/invoiceItem.zod.d.ts +2 -0
  17. package/dist/billing/v1/generated/validators/invoiceItem.zod.js +2 -0
  18. package/dist/billing/v1/generated/validators/invoiceItemList.zod.d.ts +2 -0
  19. package/dist/billing/v1/generated/validators/listActiveResourcesParams.zod.d.ts +1 -1
  20. package/dist/billing/v1/generated/validators/listActiveResourcesParams.zod.js +1 -1
  21. package/dist/billing/v1/generated/validators/listOrdersParams.zod.d.ts +1 -1
  22. package/dist/billing/v1/generated/validators/order.zod.d.ts +1 -1
  23. package/dist/billing/v1/generated/validators/orderList.zod.d.ts +1 -1
  24. package/dist/billing/v1/generated/validators/orderStatus.zod.d.ts +1 -1
  25. package/dist/billing/v1/generated/validators/orderStatus.zod.js +2 -2
  26. package/dist/billing/v1/generated/validators/statementItem.zod.d.ts +0 -1
  27. package/dist/billing/v1/generated/validators/statementItem.zod.js +0 -4
  28. package/dist/billing/v1/generated/validators/statementSummary.zod.d.ts +0 -1
  29. package/dist/billing/v1/generated/validators/usageCharge.zod.d.ts +2 -2
  30. package/dist/billing/v1/generated/validators/usageCharge.zod.js +4 -4
  31. package/dist/billing/v1/generated/validators/usageChargeList.zod.d.ts +2 -2
  32. package/dist/compute/v1/generated/models.d.ts +10 -11
  33. package/dist/compute/v1/generated/models.js +0 -5
  34. package/dist/compute/v1/generated/validators/allocateFloatingIPResponseBody.zod.d.ts +2 -0
  35. package/dist/compute/v1/generated/validators/floatingIPListResponseBody.zod.d.ts +2 -0
  36. package/dist/compute/v1/generated/validators/floatingIPResource.zod.d.ts +2 -0
  37. package/dist/compute/v1/generated/validators/floatingIPResource.zod.js +8 -0
  38. package/dist/compute/v1/generated/validators/iPv6ResponseBody.zod.d.ts +0 -5
  39. package/dist/compute/v1/generated/validators/iPv6ResponseBody.zod.js +0 -3
  40. package/dist/compute/v1/generated/validators/setFloatingIPBandwidthResponseBody.zod.d.ts +2 -0
  41. package/package.json +1 -1
@@ -921,9 +921,7 @@ export type listUsageChargesResponseError = listUsageChargesResponseDefault & {
921
921
  export type listUsageChargesResponse = listUsageChargesResponseSuccess | listUsageChargesResponseError;
922
922
  export declare const getListUsageChargesUrl: (params?: ListUsageChargesParams) => string;
923
923
  /**
924
- * Lists priced and unrated usage charges. Requires `statement_id`, `invoice_item_id`, or both `from` and `to` spanning at most 31 days; use the statement summary or spend report for longer periods. Charges are summed into one line per subscription, project, resource, meter and rate when their statement closes; filter by `invoice_item_id` to see the charges behind a line. Unrated charges had no applicable price when the usage occurred and are not billed.
925
- *
926
- * Only charges recorded against your billing accounts are included, before filtering, counting and pagination. Reassigning a project does not move previously recorded charges to its new account.
924
+ * Lists priced usage charges in the requested financial scope. Usage without a price at occurrence time is never charged retrospectively.
927
925
  * @summary List usage charges
928
926
  */
929
927
  export declare const listUsageCharges: (params?: ListUsageChargesParams, options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<listUsageChargesResponse>;
@@ -1023,9 +1023,7 @@ export const getListUsageChargesUrl = (params) => {
1023
1023
  : `https://billing.leaflow.cloud/api/v1/usage-charges`;
1024
1024
  };
1025
1025
  /**
1026
- * Lists priced and unrated usage charges. Requires `statement_id`, `invoice_item_id`, or both `from` and `to` spanning at most 31 days; use the statement summary or spend report for longer periods. Charges are summed into one line per subscription, project, resource, meter and rate when their statement closes; filter by `invoice_item_id` to see the charges behind a line. Unrated charges had no applicable price when the usage occurred and are not billed.
1027
- *
1028
- * Only charges recorded against your billing accounts are included, before filtering, counting and pagination. Reassigning a project does not move previously recorded charges to its new account.
1026
+ * Lists priced usage charges in the requested financial scope. Usage without a price at occurrence time is never charged retrospectively.
1029
1027
  * @summary List usage charges
1030
1028
  */
1031
1029
  export const listUsageCharges = async (params, options, fetchFn) => {
@@ -1288,6 +1288,16 @@ export interface InvoiceItem {
1288
1288
  taxable?: boolean;
1289
1289
  /** Discount applied to this line before tax. */
1290
1290
  discount_amount?: string;
1291
+ /**
1292
+ * The account discount applied to this line.
1293
+ * @nullable
1294
+ */
1295
+ discount_id?: string | null;
1296
+ /**
1297
+ * The coupon applied to this line.
1298
+ * @nullable
1299
+ */
1300
+ coupon_id?: string | null;
1291
1301
  /** Tax on the discounted line, including tax already included in the price. */
1292
1302
  tax_amount?: string;
1293
1303
  /** The part of tax_amount already included in amount. */
@@ -1522,7 +1532,7 @@ export type UsageChargeDimensions = {
1522
1532
  [key: string]: string;
1523
1533
  };
1524
1534
  export interface UsageCharge {
1525
- subscription_id?: string;
1535
+ subscription_id: string;
1526
1536
  id: string;
1527
1537
  project_id?: string;
1528
1538
  /**
@@ -1547,15 +1557,15 @@ export interface UsageCharge {
1547
1557
  /** What was charged for — the gross quantity less the part covered. */
1548
1558
  quantity: string;
1549
1559
  unit_amount?: Money;
1550
- amount?: Money;
1560
+ amount: Money;
1551
1561
  currency: string;
1552
1562
  /**
1553
- * The usage invoice this charge was added to. Absent until its statement closes and always absent for unrated charges.
1563
+ * Present after the statement is closed and its invoice is issued.
1554
1564
  * @nullable
1555
1565
  */
1556
1566
  invoice_id?: string | null;
1557
1567
  /**
1558
- * The usage invoice line this charge was summed into. Absent until its statement closes and always absent for unrated charges.
1568
+ * Present after the statement is closed and its invoice is issued.
1559
1569
  * @nullable
1560
1570
  */
1561
1571
  invoice_item_id?: string | null;
@@ -1825,7 +1835,7 @@ export interface AutoRenewSet {
1825
1835
  * Confirmation moves it to pending. Both pending_checkout
1826
1836
  * and pending can expire or be canceled; neither establishes service delivery.
1827
1837
  *
1828
- * Follows the items. `pending` has confirmed checkout, is not yet accepted and may be paid or unpaid. `active` is
1838
+ * Follows the items. `pending` has confirmed checkout, is not yet accepted and may be paid or unpaid. `accepted` is
1829
1839
  * accepted with items still being set up. `completed` means every item was set up.
1830
1840
  * `partially_completed` means some items were set up and the others failed or were canceled and were
1831
1841
  * refunded to their original payment sources. `failed` means no item was delivered and at least one failed; collected amounts for the
@@ -1836,7 +1846,7 @@ export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus];
1836
1846
  export declare const OrderStatus: {
1837
1847
  readonly pending_checkout: "pending_checkout";
1838
1848
  readonly pending: "pending";
1839
- readonly active: "active";
1849
+ readonly accepted: "accepted";
1840
1850
  readonly completed: "completed";
1841
1851
  readonly partially_completed: "partially_completed";
1842
1852
  readonly failed: "failed";
@@ -2108,7 +2118,19 @@ export declare const DiscountType: {
2108
2118
  readonly free_setup: "free_setup";
2109
2119
  };
2110
2120
  /**
2111
- * A coupon held on this account. It applies at checkout without a code.
2121
+ * Whether the discount continues on renewals of the purchased item. `once` applies only to the
2122
+ * purchase or renewal that uses the coupon, `recurring` continues for `frequency_duration` billing
2123
+ * periods including the first, and `forever` continues on every renewal.
2124
+ */
2125
+ export type DiscountFrequency = (typeof DiscountFrequency)[keyof typeof DiscountFrequency];
2126
+ export declare const DiscountFrequency: {
2127
+ readonly once: "once";
2128
+ readonly recurring: "recurring";
2129
+ readonly forever: "forever";
2130
+ };
2131
+ /**
2132
+ * A coupon held on this account for a period. Within the period it applies without a code to purchases and
2133
+ * to metered usage that the coupon covers.
2112
2134
  */
2113
2135
  export interface Discount {
2114
2136
  min_amount?: string;
@@ -2118,9 +2140,14 @@ export interface Discount {
2118
2140
  status: DiscountStatus;
2119
2141
  revoked_at?: string;
2120
2142
  type: DiscountType;
2121
- recurring?: boolean;
2143
+ /**
2144
+ * Whether the discount continues on renewals of the purchased item. `once` applies only to the
2145
+ * purchase or renewal that uses the coupon, `recurring` continues for `frequency_duration` billing
2146
+ * periods including the first, and `forever` continues on every renewal.
2147
+ */
2148
+ frequency?: DiscountFrequency;
2122
2149
  /** @minimum 1 */
2123
- recurring_cycles?: number;
2150
+ frequency_duration?: number;
2124
2151
  id: string;
2125
2152
  name?: string;
2126
2153
  /** For a percentage discount, out of one hundred. */
@@ -2149,14 +2176,20 @@ export interface OrderItemList {
2149
2176
  pagination: OffsetPagination;
2150
2177
  }
2151
2178
  /**
2152
- * `included` came with a recurring purchase and ends with its subscription, `promotional` was
2153
- * granted.
2179
+ * Whether the quantity was paid for or granted free of charge. Both are consumed the same way.
2154
2180
  */
2155
- export type AllowanceSourceType = (typeof AllowanceSourceType)[keyof typeof AllowanceSourceType];
2156
- export declare const AllowanceSourceType: {
2157
- readonly included: "included";
2181
+ export type AllowanceCategory = (typeof AllowanceCategory)[keyof typeof AllowanceCategory];
2182
+ export declare const AllowanceCategory: {
2183
+ readonly paid: "paid";
2158
2184
  readonly promotional: "promotional";
2159
2185
  };
2186
+ /**
2187
+ * Exact values for a subset of the meter's dimensions. Only usage with these values is deducted;
2188
+ * omitted dimensions are not restricted.
2189
+ */
2190
+ export type AllowanceDimensions = {
2191
+ [key: string]: string;
2192
+ };
2160
2193
  export type AllowanceStatus = (typeof AllowanceStatus)[keyof typeof AllowanceStatus];
2161
2194
  export declare const AllowanceStatus: {
2162
2195
  readonly active: "active";
@@ -2174,11 +2207,13 @@ export interface Allowance {
2174
2207
  meter: ObjectIdentity;
2175
2208
  /** The unit it is counted in, such as `MiB`. */
2176
2209
  unit?: string;
2210
+ /** Whether the quantity was paid for or granted free of charge. Both are consumed the same way. */
2211
+ category: AllowanceCategory;
2177
2212
  /**
2178
- * `included` came with a recurring purchase and ends with its subscription, `promotional` was
2179
- * granted.
2213
+ * Exact values for a subset of the meter's dimensions. Only usage with these values is deducted;
2214
+ * omitted dimensions are not restricted.
2180
2215
  */
2181
- source_type: AllowanceSourceType;
2216
+ dimensions: AllowanceDimensions;
2182
2217
  name: string;
2183
2218
  /** How much was granted. */
2184
2219
  quantity: string;
@@ -2490,7 +2525,7 @@ export declare const ActiveResourceStatus: {
2490
2525
  readonly active: "active";
2491
2526
  readonly suspended: "suspended";
2492
2527
  readonly closing: "closing";
2493
- readonly completed: "completed";
2528
+ readonly closed: "closed";
2494
2529
  };
2495
2530
  /**
2496
2531
  * A resource currently accruing charges by the second.
@@ -2513,9 +2548,9 @@ export interface ActiveResource {
2513
2548
  dimensions?: ActiveResourceDimensions;
2514
2549
  status: ActiveResourceStatus;
2515
2550
  started_at: string;
2516
- /** Usage has been generated up to this boundary; it does not imply invoicing or payment. */
2517
- metered_until: string;
2518
2551
  project_id?: string;
2552
+ /** Usage has been generated up to this boundary; it does not imply invoicing or payment. */
2553
+ usage_generated_until: string;
2519
2554
  }
2520
2555
  export interface ActiveResourceList {
2521
2556
  items: ActiveResource[];
@@ -2724,8 +2759,6 @@ export interface StatementItem {
2724
2759
  /** Net usage quantity. Included only when grouping by meter. */
2725
2760
  quantity?: string;
2726
2761
  deducted_quantity?: string;
2727
- /** Usage that had no applicable price when it occurred. It is not charged, either now or later. */
2728
- unrated_quantity?: string;
2729
2762
  amount: Money;
2730
2763
  }
2731
2764
  export type StatementSummaryGroupBy = (typeof StatementSummaryGroupBy)[keyof typeof StatementSummaryGroupBy];
@@ -3494,7 +3527,7 @@ export declare const ListActiveResourcesStatus: {
3494
3527
  readonly active: "active";
3495
3528
  readonly suspended: "suspended";
3496
3529
  readonly closing: "closing";
3497
- readonly completed: "completed";
3530
+ readonly closed: "closed";
3498
3531
  };
3499
3532
  export type ListSpendParams = {
3500
3533
  from: FromRequiredParameter;
@@ -218,7 +218,7 @@ export const RenewalOrderRequestInterval = {
218
218
  export const OrderStatus = {
219
219
  pending_checkout: "pending_checkout",
220
220
  pending: "pending",
221
- active: "active",
221
+ accepted: "accepted",
222
222
  completed: "completed",
223
223
  partially_completed: "partially_completed",
224
224
  failed: "failed",
@@ -262,8 +262,13 @@ export const DiscountType = {
262
262
  price_override: "price_override",
263
263
  free_setup: "free_setup",
264
264
  };
265
- export const AllowanceSourceType = {
266
- included: "included",
265
+ export const DiscountFrequency = {
266
+ once: "once",
267
+ recurring: "recurring",
268
+ forever: "forever",
269
+ };
270
+ export const AllowanceCategory = {
271
+ paid: "paid",
267
272
  promotional: "promotional",
268
273
  };
269
274
  export const AllowanceStatus = {
@@ -313,7 +318,7 @@ export const ActiveResourceStatus = {
313
318
  active: "active",
314
319
  suspended: "suspended",
315
320
  closing: "closing",
316
- completed: "completed",
321
+ closed: "closed",
317
322
  };
318
323
  export const StatementStatus = {
319
324
  open: "open",
@@ -354,7 +359,7 @@ export const ListActiveResourcesStatus = {
354
359
  active: "active",
355
360
  suspended: "suspended",
356
361
  closing: "closing",
357
- completed: "completed",
362
+ closed: "closed",
358
363
  };
359
364
  export const ListSpendGroupBy = {
360
365
  product: "product",
@@ -541,9 +541,7 @@ export declare const ListRefundsQueryParams: zod.ZodObject<{
541
541
  order_id: zod.ZodOptional<zod.ZodUUID>;
542
542
  }, zod.z.core.$strict>;
543
543
  /**
544
- * Lists priced and unrated usage charges. Requires `statement_id`, `invoice_item_id`, or both `from` and `to` spanning at most 31 days; use the statement summary or spend report for longer periods. Charges are summed into one line per subscription, project, resource, meter and rate when their statement closes; filter by `invoice_item_id` to see the charges behind a line. Unrated charges had no applicable price when the usage occurred and are not billed.
545
- *
546
- * Only charges recorded against your billing accounts are included, before filtering, counting and pagination. Reassigning a project does not move previously recorded charges to its new account.
544
+ * Lists priced usage charges in the requested financial scope. Usage without a price at occurrence time is never charged retrospectively.
547
545
  * @summary List usage charges
548
546
  */
549
547
  export declare const listUsageChargesQueryPageDefault = 1;
@@ -933,11 +931,11 @@ export declare const ListOrdersQueryParams: zod.ZodObject<{
933
931
  billing_account_id: zod.ZodOptional<zod.ZodInt>;
934
932
  status: zod.ZodOptional<zod.ZodEnum<{
935
933
  pending: "pending";
936
- active: "active";
937
934
  completed: "completed";
938
935
  failed: "failed";
939
936
  canceled: "canceled";
940
937
  pending_checkout: "pending_checkout";
938
+ accepted: "accepted";
941
939
  partially_completed: "partially_completed";
942
940
  }>>;
943
941
  from: zod.ZodOptional<zod.z.ZodISODateTime>;
@@ -1218,7 +1216,7 @@ export declare const ListActiveResourcesQueryParams: zod.ZodObject<{
1218
1216
  status: zod.ZodOptional<zod.ZodEnum<{
1219
1217
  active: "active";
1220
1218
  suspended: "suspended";
1221
- completed: "completed";
1219
+ closed: "closed";
1222
1220
  closing: "closing";
1223
1221
  }>>;
1224
1222
  }, zod.z.core.$strict>;
@@ -682,9 +682,7 @@ export const ListRefundsQueryParams = zod.strictObject({
682
682
  .describe("Only the refunds that belong to this order: those of its invoice, such as the refund of a\npurchase that could not be delivered, and those it caused on an earlier invoice, such as\nthe difference returned after a downgrade."),
683
683
  });
684
684
  /**
685
- * Lists priced and unrated usage charges. Requires `statement_id`, `invoice_item_id`, or both `from` and `to` spanning at most 31 days; use the statement summary or spend report for longer periods. Charges are summed into one line per subscription, project, resource, meter and rate when their statement closes; filter by `invoice_item_id` to see the charges behind a line. Unrated charges had no applicable price when the usage occurred and are not billed.
686
- *
687
- * Only charges recorded against your billing accounts are included, before filtering, counting and pagination. Reassigning a project does not move previously recorded charges to its new account.
685
+ * Lists priced usage charges in the requested financial scope. Usage without a price at occurrence time is never charged retrospectively.
688
686
  * @summary List usage charges
689
687
  */
690
688
  export const listUsageChargesQueryPageDefault = 1;
@@ -1076,14 +1074,14 @@ export const ListOrdersQueryParams = zod.strictObject({
1076
1074
  .enum([
1077
1075
  "pending_checkout",
1078
1076
  "pending",
1079
- "active",
1077
+ "accepted",
1080
1078
  "completed",
1081
1079
  "partially_completed",
1082
1080
  "failed",
1083
1081
  "canceled",
1084
1082
  ])
1085
1083
  .optional()
1086
- .describe("pending_checkout has recorded purchase terms but no confirmed checkout; only a deferred order\nwith an amount due reaches it, since a zero-total order completes checkout at placement.\nConfirmation moves it to pending. Both pending_checkout\nand pending can expire or be canceled; neither establishes service delivery.\n\nFollows the items. `pending` has confirmed checkout, is not yet accepted and may be paid or unpaid. `active` is\naccepted with items still being set up. `completed` means every item was set up.\n`partially_completed` means some items were set up and the others failed or were canceled and were\nrefunded to their original payment sources. `failed` means no item was delivered and at least one failed; collected amounts for the\nundelivered items are refunded. `canceled` means every item was withdrawn without delivery; collected amounts are\nreturned to their original payment sources."),
1084
+ .describe("pending_checkout has recorded purchase terms but no confirmed checkout; only a deferred order\nwith an amount due reaches it, since a zero-total order completes checkout at placement.\nConfirmation moves it to pending. Both pending_checkout\nand pending can expire or be canceled; neither establishes service delivery.\n\nFollows the items. `pending` has confirmed checkout, is not yet accepted and may be paid or unpaid. `accepted` is\naccepted with items still being set up. `completed` means every item was set up.\n`partially_completed` means some items were set up and the others failed or were canceled and were\nrefunded to their original payment sources. `failed` means no item was delivered and at least one failed; collected amounts for the\nundelivered items are refunded. `canceled` means every item was withdrawn without delivery; collected amounts are\nreturned to their original payment sources."),
1087
1085
  from: zod.iso.datetime({ offset: true }).optional(),
1088
1086
  to: zod.iso.datetime({ offset: true }).optional().describe("Exclusive."),
1089
1087
  project_ids: zod
@@ -1513,7 +1511,7 @@ export const ListActiveResourcesQueryParams = zod.strictObject({
1513
1511
  .regex(listActiveResourcesQueryProductIdRegExp)
1514
1512
  .optional()
1515
1513
  .describe("Immutable platform service identifier, such as compute, canopy or assistant."),
1516
- status: zod.enum(["active", "suspended", "closing", "completed"]).optional(),
1514
+ status: zod.enum(["active", "suspended", "closing", "closed"]).optional(),
1517
1515
  });
1518
1516
  /**
1519
1517
  * Sums priced usage for one billing account by UTC day, including usage not yet invoiced. Amounts are
@@ -30,12 +30,12 @@ export declare const ActiveResource: zod.ZodObject<{
30
30
  status: zod.ZodEnum<{
31
31
  active: "active";
32
32
  suspended: "suspended";
33
- completed: "completed";
33
+ closed: "closed";
34
34
  closing: "closing";
35
35
  }>;
36
36
  started_at: zod.z.ZodISODateTime;
37
- metered_until: zod.z.ZodISODateTime;
38
37
  project_id: zod.ZodOptional<zod.ZodUUID>;
38
+ usage_generated_until: zod.z.ZodISODateTime;
39
39
  }, zod.z.core.$strict>;
40
40
  export type ActiveResource = zod.input<typeof ActiveResource>;
41
41
  export type ActiveResourceOutput = zod.output<typeof ActiveResource>;
@@ -26,11 +26,11 @@ export const ActiveResource = zod
26
26
  .string()
27
27
  .describe("How much is held — cores, MiB, cards. Not how much has been used."),
28
28
  dimensions: zod.record(zod.string(), zod.string()).optional(),
29
- status: zod.enum(["active", "suspended", "closing", "completed"]),
29
+ status: zod.enum(["active", "suspended", "closing", "closed"]),
30
30
  started_at: zod.iso.datetime({ offset: true }),
31
- metered_until: zod.iso
31
+ project_id: zod.uuid().optional(),
32
+ usage_generated_until: zod.iso
32
33
  .datetime({ offset: true })
33
34
  .describe("Usage has been generated up to this boundary; it does not imply invoicing or payment."),
34
- project_id: zod.uuid().optional(),
35
35
  })
36
36
  .describe("A resource currently accruing charges by the second.");
@@ -31,12 +31,12 @@ export declare const ActiveResourceList: zod.ZodObject<{
31
31
  status: zod.ZodEnum<{
32
32
  active: "active";
33
33
  suspended: "suspended";
34
- completed: "completed";
34
+ closed: "closed";
35
35
  closing: "closing";
36
36
  }>;
37
37
  started_at: zod.z.ZodISODateTime;
38
- metered_until: zod.z.ZodISODateTime;
39
38
  project_id: zod.ZodOptional<zod.ZodUUID>;
39
+ usage_generated_until: zod.z.ZodISODateTime;
40
40
  }, zod.z.core.$strict>>;
41
41
  pagination: zod.ZodObject<{
42
42
  page: zod.ZodInt;
@@ -22,10 +22,11 @@ export declare const Allowance: zod.ZodObject<{
22
22
  name: zod.ZodString;
23
23
  }, zod.z.core.$strict>;
24
24
  unit: zod.ZodOptional<zod.ZodString>;
25
- source_type: zod.ZodEnum<{
26
- included: "included";
25
+ category: zod.ZodEnum<{
26
+ paid: "paid";
27
27
  promotional: "promotional";
28
28
  }>;
29
+ dimensions: zod.ZodRecord<zod.ZodString, zod.ZodString>;
29
30
  name: zod.ZodString;
30
31
  quantity: zod.ZodString;
31
32
  remaining_quantity: zod.ZodString;
@@ -19,9 +19,12 @@ export const Allowance = zod.strictObject({
19
19
  product: Product,
20
20
  meter: ObjectIdentity,
21
21
  unit: zod.string().optional().describe("The unit it is counted in, such as `MiB`."),
22
- source_type: zod
23
- .enum(["included", "promotional"])
24
- .describe("`included` came with a recurring purchase and ends with its subscription, `promotional` was\ngranted."),
22
+ category: zod
23
+ .enum(["paid", "promotional"])
24
+ .describe("Whether the quantity was paid for or granted free of charge. Both are consumed the same way."),
25
+ dimensions: zod
26
+ .record(zod.string(), zod.string())
27
+ .describe("Exact values for a subset of the meter's dimensions. Only usage with these values is deducted;\nomitted dimensions are not restricted."),
25
28
  name: zod.string(),
26
29
  quantity: zod.string().describe("How much was granted."),
27
30
  remaining_quantity: zod.string().describe("How much is left."),
@@ -23,10 +23,11 @@ export declare const AllowanceList: zod.ZodObject<{
23
23
  name: zod.ZodString;
24
24
  }, zod.z.core.$strict>;
25
25
  unit: zod.ZodOptional<zod.ZodString>;
26
- source_type: zod.ZodEnum<{
27
- included: "included";
26
+ category: zod.ZodEnum<{
27
+ paid: "paid";
28
28
  promotional: "promotional";
29
29
  }>;
30
+ dimensions: zod.ZodRecord<zod.ZodString, zod.ZodString>;
30
31
  name: zod.ZodString;
31
32
  quantity: zod.ZodString;
32
33
  remaining_quantity: zod.ZodString;
@@ -22,8 +22,12 @@ export declare const Discount: zod.ZodObject<{
22
22
  price_override: "price_override";
23
23
  free_setup: "free_setup";
24
24
  }>;
25
- recurring: zod.ZodOptional<zod.ZodBoolean>;
26
- recurring_cycles: zod.ZodOptional<zod.ZodInt>;
25
+ frequency: zod.ZodOptional<zod.ZodEnum<{
26
+ once: "once";
27
+ recurring: "recurring";
28
+ forever: "forever";
29
+ }>>;
30
+ frequency_duration: zod.ZodOptional<zod.ZodInt>;
27
31
  id: zod.ZodUUID;
28
32
  name: zod.ZodOptional<zod.ZodString>;
29
33
  percent_off: zod.ZodOptional<zod.ZodString>;
@@ -17,8 +17,11 @@ export const Discount = zod
17
17
  status: zod.enum(["active", "revoked"]),
18
18
  revoked_at: zod.iso.datetime({ offset: true }).optional(),
19
19
  type: zod.enum(["percentage", "fixed_amount", "price_override", "free_setup"]),
20
- recurring: zod.boolean().optional(),
21
- recurring_cycles: zod.int().min(1).optional(),
20
+ frequency: zod
21
+ .enum(["once", "recurring", "forever"])
22
+ .optional()
23
+ .describe("Whether the discount continues on renewals of the purchased item. `once` applies only to the\npurchase or renewal that uses the coupon, `recurring` continues for `frequency_duration` billing\nperiods including the first, and `forever` continues on every renewal."),
24
+ frequency_duration: zod.int().min(1).optional(),
22
25
  id: zod.uuid(),
23
26
  name: zod.string().optional(),
24
27
  percent_off: zod.string().optional().describe("For a percentage discount, out of one hundred."),
@@ -33,4 +36,4 @@ export const Discount = zod
33
36
  started_at: zod.iso.datetime({ offset: true }).optional(),
34
37
  ended_at: zod.iso.datetime({ offset: true }).nullish(),
35
38
  })
36
- .describe("A coupon held on this account. It applies at checkout without a code.");
39
+ .describe("A coupon held on this account for a period. Within the period it applies without a code to purchases and\nto metered usage that the coupon covers.");
@@ -23,8 +23,12 @@ export declare const DiscountList: zod.ZodObject<{
23
23
  price_override: "price_override";
24
24
  free_setup: "free_setup";
25
25
  }>;
26
- recurring: zod.ZodOptional<zod.ZodBoolean>;
27
- recurring_cycles: zod.ZodOptional<zod.ZodInt>;
26
+ frequency: zod.ZodOptional<zod.ZodEnum<{
27
+ once: "once";
28
+ recurring: "recurring";
29
+ forever: "forever";
30
+ }>>;
31
+ frequency_duration: zod.ZodOptional<zod.ZodInt>;
28
32
  id: zod.ZodUUID;
29
33
  name: zod.ZodOptional<zod.ZodString>;
30
34
  percent_off: zod.ZodOptional<zod.ZodString>;
@@ -9,6 +9,8 @@ import * as zod from "zod";
9
9
  export declare const InvoiceItem: zod.ZodObject<{
10
10
  taxable: zod.ZodOptional<zod.ZodBoolean>;
11
11
  discount_amount: zod.ZodOptional<zod.ZodString>;
12
+ discount_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
13
+ coupon_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
12
14
  tax_amount: zod.ZodOptional<zod.ZodString>;
13
15
  tax_included_amount: zod.ZodOptional<zod.ZodString>;
14
16
  id: zod.ZodUUID;
@@ -11,6 +11,8 @@ import { NamedIdentity } from "./namedIdentity.zod.js";
11
11
  export const InvoiceItem = zod.strictObject({
12
12
  taxable: zod.boolean().optional(),
13
13
  discount_amount: zod.string().optional().describe("Discount applied to this line before tax."),
14
+ discount_id: zod.uuid().nullish().describe("The account discount applied to this line."),
15
+ coupon_id: zod.uuid().nullish().describe("The coupon applied to this line."),
14
16
  tax_amount: zod
15
17
  .string()
16
18
  .optional()
@@ -10,6 +10,8 @@ export declare const InvoiceItemList: zod.ZodObject<{
10
10
  items: zod.ZodArray<zod.ZodObject<{
11
11
  taxable: zod.ZodOptional<zod.ZodBoolean>;
12
12
  discount_amount: zod.ZodOptional<zod.ZodString>;
13
+ discount_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
14
+ coupon_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
13
15
  tax_amount: zod.ZodOptional<zod.ZodString>;
14
16
  tax_included_amount: zod.ZodOptional<zod.ZodString>;
15
17
  id: zod.ZodUUID;
@@ -22,7 +22,7 @@ export declare const ListActiveResourcesParams: zod.ZodObject<{
22
22
  status: zod.ZodOptional<zod.ZodEnum<{
23
23
  active: "active";
24
24
  suspended: "suspended";
25
- completed: "completed";
25
+ closed: "closed";
26
26
  closing: "closing";
27
27
  }>>;
28
28
  }, zod.z.core.$strict>;
@@ -28,5 +28,5 @@ export const ListActiveResourcesParams = zod.strictObject({
28
28
  project_ids: zod.array(zod.uuid()).min(1).max(listActiveResourcesParamsProjectIdsMax).optional(),
29
29
  meter_id: zod.uuid().optional(),
30
30
  product_id: ProductID.optional(),
31
- status: zod.enum(["active", "suspended", "closing", "completed"]).optional(),
31
+ status: zod.enum(["active", "suspended", "closing", "closed"]).optional(),
32
32
  });
@@ -17,11 +17,11 @@ export declare const ListOrdersParams: zod.ZodObject<{
17
17
  billing_account_id: zod.ZodOptional<zod.ZodInt>;
18
18
  status: zod.ZodOptional<zod.ZodEnum<{
19
19
  pending: "pending";
20
- active: "active";
21
20
  completed: "completed";
22
21
  failed: "failed";
23
22
  canceled: "canceled";
24
23
  pending_checkout: "pending_checkout";
24
+ accepted: "accepted";
25
25
  partially_completed: "partially_completed";
26
26
  }>>;
27
27
  from: zod.ZodOptional<zod.z.ZodISODateTime>;
@@ -67,11 +67,11 @@ export declare const Order: zod.ZodObject<{
67
67
  }>;
68
68
  status: zod.ZodEnum<{
69
69
  pending: "pending";
70
- active: "active";
71
70
  completed: "completed";
72
71
  failed: "failed";
73
72
  canceled: "canceled";
74
73
  pending_checkout: "pending_checkout";
74
+ accepted: "accepted";
75
75
  partially_completed: "partially_completed";
76
76
  }>;
77
77
  change_effective: zod.ZodOptional<zod.ZodEnum<{
@@ -68,11 +68,11 @@ export declare const OrderList: zod.ZodObject<{
68
68
  }>;
69
69
  status: zod.ZodEnum<{
70
70
  pending: "pending";
71
- active: "active";
72
71
  completed: "completed";
73
72
  failed: "failed";
74
73
  canceled: "canceled";
75
74
  pending_checkout: "pending_checkout";
75
+ accepted: "accepted";
76
76
  partially_completed: "partially_completed";
77
77
  }>;
78
78
  change_effective: zod.ZodOptional<zod.ZodEnum<{
@@ -8,11 +8,11 @@
8
8
  import * as zod from "zod";
9
9
  export declare const OrderStatus: zod.ZodEnum<{
10
10
  pending: "pending";
11
- active: "active";
12
11
  completed: "completed";
13
12
  failed: "failed";
14
13
  canceled: "canceled";
15
14
  pending_checkout: "pending_checkout";
15
+ accepted: "accepted";
16
16
  partially_completed: "partially_completed";
17
17
  }>;
18
18
  export type OrderStatus = zod.input<typeof OrderStatus>;
@@ -10,10 +10,10 @@ export const OrderStatus = zod
10
10
  .enum([
11
11
  "pending_checkout",
12
12
  "pending",
13
- "active",
13
+ "accepted",
14
14
  "completed",
15
15
  "partially_completed",
16
16
  "failed",
17
17
  "canceled",
18
18
  ])
19
- .describe("pending_checkout has recorded purchase terms but no confirmed checkout; only a deferred order\nwith an amount due reaches it, since a zero-total order completes checkout at placement.\nConfirmation moves it to pending. Both pending_checkout\nand pending can expire or be canceled; neither establishes service delivery.\n\nFollows the items. `pending` has confirmed checkout, is not yet accepted and may be paid or unpaid. `active` is\naccepted with items still being set up. `completed` means every item was set up.\n`partially_completed` means some items were set up and the others failed or were canceled and were\nrefunded to their original payment sources. `failed` means no item was delivered and at least one failed; collected amounts for the\nundelivered items are refunded. `canceled` means every item was withdrawn without delivery; collected amounts are\nreturned to their original payment sources.");
19
+ .describe("pending_checkout has recorded purchase terms but no confirmed checkout; only a deferred order\nwith an amount due reaches it, since a zero-total order completes checkout at placement.\nConfirmation moves it to pending. Both pending_checkout\nand pending can expire or be canceled; neither establishes service delivery.\n\nFollows the items. `pending` has confirmed checkout, is not yet accepted and may be paid or unpaid. `accepted` is\naccepted with items still being set up. `completed` means every item was set up.\n`partially_completed` means some items were set up and the others failed or were canceled and were\nrefunded to their original payment sources. `failed` means no item was delivered and at least one failed; collected amounts for the\nundelivered items are refunded. `canceled` means every item was withdrawn without delivery; collected amounts are\nreturned to their original payment sources.");
@@ -13,7 +13,6 @@ export declare const StatementItem: zod.ZodObject<{
13
13
  unit: zod.ZodOptional<zod.ZodString>;
14
14
  quantity: zod.ZodOptional<zod.ZodString>;
15
15
  deducted_quantity: zod.ZodOptional<zod.ZodString>;
16
- unrated_quantity: zod.ZodOptional<zod.ZodString>;
17
16
  amount: zod.ZodString;
18
17
  }, zod.z.core.$strict>;
19
18
  export type StatementItem = zod.input<typeof StatementItem>;
@@ -17,9 +17,5 @@ export const StatementItem = zod.strictObject({
17
17
  .optional()
18
18
  .describe("Net usage quantity. Included only when grouping by meter."),
19
19
  deducted_quantity: zod.string().optional(),
20
- unrated_quantity: zod
21
- .string()
22
- .optional()
23
- .describe("Usage that had no applicable price when it occurred. It is not charged, either now or later."),
24
20
  amount: Money,
25
21
  });
@@ -23,7 +23,6 @@ export declare const StatementSummary: zod.ZodObject<{
23
23
  unit: zod.ZodOptional<zod.ZodString>;
24
24
  quantity: zod.ZodOptional<zod.ZodString>;
25
25
  deducted_quantity: zod.ZodOptional<zod.ZodString>;
26
- unrated_quantity: zod.ZodOptional<zod.ZodString>;
27
26
  amount: zod.ZodString;
28
27
  }, zod.z.core.$strict>>;
29
28
  pagination: zod.ZodObject<{
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import * as zod from "zod";
9
9
  export declare const UsageCharge: zod.ZodObject<{
10
- subscription_id: zod.ZodOptional<zod.ZodUUID>;
10
+ subscription_id: zod.ZodUUID;
11
11
  id: zod.ZodUUID;
12
12
  project_id: zod.ZodOptional<zod.ZodUUID>;
13
13
  project: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
@@ -33,7 +33,7 @@ export declare const UsageCharge: zod.ZodObject<{
33
33
  deducted_quantity: zod.ZodOptional<zod.ZodString>;
34
34
  quantity: zod.ZodString;
35
35
  unit_amount: zod.ZodOptional<zod.ZodString>;
36
- amount: zod.ZodOptional<zod.ZodString>;
36
+ amount: zod.ZodString;
37
37
  currency: zod.ZodString;
38
38
  invoice_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
39
39
  invoice_item_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
@@ -11,7 +11,7 @@ import { NamedIdentity } from "./namedIdentity.zod.js";
11
11
  import { ObjectIdentity } from "./objectIdentity.zod.js";
12
12
  import { Product } from "./product.zod.js";
13
13
  export const UsageCharge = zod.strictObject({
14
- subscription_id: zod.uuid().optional(),
14
+ subscription_id: zod.uuid(),
15
15
  id: zod.uuid(),
16
16
  project_id: zod.uuid().optional(),
17
17
  project: zod
@@ -43,15 +43,15 @@ export const UsageCharge = zod.strictObject({
43
43
  .string()
44
44
  .describe("What was charged for — the gross quantity less the part covered."),
45
45
  unit_amount: Money.optional(),
46
- amount: Money.optional(),
46
+ amount: Money,
47
47
  currency: zod.string(),
48
48
  invoice_id: zod
49
49
  .uuid()
50
50
  .nullish()
51
- .describe("The usage invoice this charge was added to. Absent until its statement closes and always absent for unrated charges."),
51
+ .describe("Present after the statement is closed and its invoice is issued."),
52
52
  invoice_item_id: zod
53
53
  .uuid()
54
54
  .nullish()
55
- .describe("The usage invoice line this charge was summed into. Absent until its statement closes and always absent for unrated charges."),
55
+ .describe("Present after the statement is closed and its invoice is issued."),
56
56
  statement_id: zod.uuid().optional().describe("The statement this charge was collected into."),
57
57
  });
@@ -8,7 +8,7 @@
8
8
  import * as zod from "zod";
9
9
  export declare const UsageChargeList: zod.ZodObject<{
10
10
  items: zod.ZodArray<zod.ZodObject<{
11
- subscription_id: zod.ZodOptional<zod.ZodUUID>;
11
+ subscription_id: zod.ZodUUID;
12
12
  id: zod.ZodUUID;
13
13
  project_id: zod.ZodOptional<zod.ZodUUID>;
14
14
  project: zod.ZodOptional<zod.ZodUnion<readonly [zod.ZodObject<{
@@ -34,7 +34,7 @@ export declare const UsageChargeList: zod.ZodObject<{
34
34
  deducted_quantity: zod.ZodOptional<zod.ZodString>;
35
35
  quantity: zod.ZodString;
36
36
  unit_amount: zod.ZodOptional<zod.ZodString>;
37
- amount: zod.ZodOptional<zod.ZodString>;
37
+ amount: zod.ZodString;
38
38
  currency: zod.ZodString;
39
39
  invoice_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
40
40
  invoice_item_id: zod.ZodOptional<zod.ZodNullable<zod.ZodUUID>>;
@@ -900,6 +900,16 @@ export interface IPv4Binding {
900
900
  * Changing bandwidth updates this same resource, not another allocation.
901
901
  */
902
902
  export interface FloatingIPResource {
903
+ /**
904
+ * When the current or most recent address holding was allocated; null before an address is claimed.
905
+ * @nullable
906
+ */
907
+ allocated_at: string | null;
908
+ /**
909
+ * When that address holding was released; null while held or before allocation.
910
+ * @nullable
911
+ */
912
+ released_at: string | null;
903
913
  /**
904
914
  * The allocated public address. Null until the address is allocated.
905
915
  * @nullable
@@ -1622,21 +1632,10 @@ export interface RenamePrivateNetworkRequestBody {
1622
1632
  */
1623
1633
  name: string;
1624
1634
  }
1625
- /**
1626
- * `active` means IPv6 is fully available
1627
- */
1628
- export type IPv6ResponseBodyStatus = (typeof IPv6ResponseBodyStatus)[keyof typeof IPv6ResponseBodyStatus];
1629
- export declare const IPv6ResponseBodyStatus: {
1630
- readonly pending: "pending";
1631
- readonly active: "active";
1632
- readonly draining: "draining";
1633
- };
1634
1635
  export interface IPv6ResponseBody {
1635
1636
  /** The allocated /64 prefix; empty while IPv6 is disabled */
1636
1637
  cidr: string;
1637
1638
  enabled: boolean;
1638
- /** `active` means IPv6 is fully available */
1639
- status: IPv6ResponseBodyStatus;
1640
1639
  }
1641
1640
  export interface RouteResource {
1642
1641
  /** System-owned peering route. Delete the peering to remove this route. */
@@ -270,11 +270,6 @@ export const PortOperationType = {
270
270
  detach: "detach",
271
271
  delete: "delete",
272
272
  };
273
- export const IPv6ResponseBodyStatus = {
274
- pending: "pending",
275
- active: "active",
276
- draining: "draining",
277
- };
278
273
  export const SubnetResourceIpVersion = {
279
274
  NUMBER_4: 4,
280
275
  NUMBER_6: 6,
@@ -24,6 +24,8 @@
24
24
  import * as zod from "zod";
25
25
  export declare const AllocateFloatingIPResponseBody: zod.ZodObject<{
26
26
  floating_ip: zod.ZodObject<{
27
+ allocated_at: zod.ZodNullable<zod.z.ZodISODateTime>;
28
+ released_at: zod.ZodNullable<zod.z.ZodISODateTime>;
27
29
  address: zod.ZodNullable<zod.ZodString>;
28
30
  bandwidth_mbps: zod.ZodNullable<zod.ZodInt>;
29
31
  created_at: zod.z.ZodISODateTime;
@@ -24,6 +24,8 @@
24
24
  import * as zod from "zod";
25
25
  export declare const FloatingIPListResponseBody: zod.ZodObject<{
26
26
  items: zod.ZodNullable<zod.ZodArray<zod.ZodObject<{
27
+ allocated_at: zod.ZodNullable<zod.z.ZodISODateTime>;
28
+ released_at: zod.ZodNullable<zod.z.ZodISODateTime>;
27
29
  address: zod.ZodNullable<zod.ZodString>;
28
30
  bandwidth_mbps: zod.ZodNullable<zod.ZodInt>;
29
31
  created_at: zod.z.ZodISODateTime;
@@ -23,6 +23,8 @@
23
23
  */
24
24
  import * as zod from "zod";
25
25
  export declare const FloatingIPResource: zod.ZodObject<{
26
+ allocated_at: zod.ZodNullable<zod.z.ZodISODateTime>;
27
+ released_at: zod.ZodNullable<zod.z.ZodISODateTime>;
26
28
  address: zod.ZodNullable<zod.ZodString>;
27
29
  bandwidth_mbps: zod.ZodNullable<zod.ZodInt>;
28
30
  created_at: zod.z.ZodISODateTime;
@@ -27,6 +27,14 @@ import { IPv4Binding } from "./iPv4Binding.zod.js";
27
27
  import { ReleaseSetItem } from "./releaseSetItem.zod.js";
28
28
  export const FloatingIPResource = zod
29
29
  .strictObject({
30
+ allocated_at: zod.iso
31
+ .datetime({ offset: true })
32
+ .nullable()
33
+ .describe("When the current or most recent address holding was allocated; null before an address is claimed."),
34
+ released_at: zod.iso
35
+ .datetime({ offset: true })
36
+ .nullable()
37
+ .describe("When that address holding was released; null while held or before allocation."),
30
38
  address: zod
31
39
  .string()
32
40
  .nullable()
@@ -25,11 +25,6 @@ import * as zod from "zod";
25
25
  export declare const IPv6ResponseBody: zod.ZodObject<{
26
26
  cidr: zod.ZodString;
27
27
  enabled: zod.ZodBoolean;
28
- status: zod.ZodEnum<{
29
- pending: "pending";
30
- active: "active";
31
- draining: "draining";
32
- }>;
33
28
  }, zod.z.core.$strict>;
34
29
  export type IPv6ResponseBody = zod.input<typeof IPv6ResponseBody>;
35
30
  export type IPv6ResponseBodyOutput = zod.output<typeof IPv6ResponseBody>;
@@ -25,7 +25,4 @@ import * as zod from "zod";
25
25
  export const IPv6ResponseBody = zod.strictObject({
26
26
  cidr: zod.string().describe("The allocated /64 prefix; empty while IPv6 is disabled"),
27
27
  enabled: zod.boolean(),
28
- status: zod
29
- .enum(["pending", "active", "draining"])
30
- .describe("`active` means IPv6 is fully available"),
31
28
  });
@@ -24,6 +24,8 @@
24
24
  import * as zod from "zod";
25
25
  export declare const SetFloatingIPBandwidthResponseBody: zod.ZodObject<{
26
26
  floating_ip: zod.ZodObject<{
27
+ allocated_at: zod.ZodNullable<zod.z.ZodISODateTime>;
28
+ released_at: zod.ZodNullable<zod.z.ZodISODateTime>;
27
29
  address: zod.ZodNullable<zod.ZodString>;
28
30
  bandwidth_mbps: zod.ZodNullable<zod.ZodInt>;
29
31
  created_at: zod.z.ZodISODateTime;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.119.0",
3
+ "version": "0.121.0",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {