@leaflow/sdk 0.118.0 → 0.120.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 +10 -12
  4. package/dist/billing/v1/generated/models.js +3 -3
  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/listActiveResourcesParams.zod.d.ts +1 -1
  11. package/dist/billing/v1/generated/validators/listActiveResourcesParams.zod.js +1 -1
  12. package/dist/billing/v1/generated/validators/listOrdersParams.zod.d.ts +1 -1
  13. package/dist/billing/v1/generated/validators/order.zod.d.ts +1 -1
  14. package/dist/billing/v1/generated/validators/orderList.zod.d.ts +1 -1
  15. package/dist/billing/v1/generated/validators/orderStatus.zod.d.ts +1 -1
  16. package/dist/billing/v1/generated/validators/orderStatus.zod.js +2 -2
  17. package/dist/billing/v1/generated/validators/statementItem.zod.d.ts +0 -1
  18. package/dist/billing/v1/generated/validators/statementItem.zod.js +0 -4
  19. package/dist/billing/v1/generated/validators/statementSummary.zod.d.ts +0 -1
  20. package/dist/billing/v1/generated/validators/usageCharge.zod.d.ts +2 -2
  21. package/dist/billing/v1/generated/validators/usageCharge.zod.js +4 -4
  22. package/dist/billing/v1/generated/validators/usageChargeList.zod.d.ts +2 -2
  23. package/dist/compute/v1/generated/models.d.ts +10 -11
  24. package/dist/compute/v1/generated/models.js +0 -5
  25. package/dist/compute/v1/generated/validators/allocateFloatingIPResponseBody.zod.d.ts +2 -0
  26. package/dist/compute/v1/generated/validators/floatingIPListResponseBody.zod.d.ts +2 -0
  27. package/dist/compute/v1/generated/validators/floatingIPResource.zod.d.ts +2 -0
  28. package/dist/compute/v1/generated/validators/floatingIPResource.zod.js +8 -0
  29. package/dist/compute/v1/generated/validators/iPv6ResponseBody.zod.d.ts +0 -5
  30. package/dist/compute/v1/generated/validators/iPv6ResponseBody.zod.js +0 -3
  31. package/dist/compute/v1/generated/validators/setFloatingIPBandwidthResponseBody.zod.d.ts +2 -0
  32. package/dist/iam/v1/generated/functions.d.ts +22 -1
  33. package/dist/iam/v1/generated/functions.js +16 -0
  34. package/dist/iam/v1/generated/models.d.ts +11 -0
  35. package/dist/iam/v1/generated/validators/quotaListResponseBody.zod.d.ts +25 -0
  36. package/dist/iam/v1/generated/validators/quotaListResponseBody.zod.js +19 -0
  37. package/dist/iam/v1/generated/validators/quotaResource.zod.d.ts +23 -0
  38. package/dist/iam/v1/generated/validators/quotaResource.zod.js +21 -0
  39. package/dist/routes.d.ts +8 -0
  40. package/dist/routes.js +9 -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) => {
@@ -1522,7 +1522,7 @@ export type UsageChargeDimensions = {
1522
1522
  [key: string]: string;
1523
1523
  };
1524
1524
  export interface UsageCharge {
1525
- subscription_id?: string;
1525
+ subscription_id: string;
1526
1526
  id: string;
1527
1527
  project_id?: string;
1528
1528
  /**
@@ -1547,15 +1547,15 @@ export interface UsageCharge {
1547
1547
  /** What was charged for — the gross quantity less the part covered. */
1548
1548
  quantity: string;
1549
1549
  unit_amount?: Money;
1550
- amount?: Money;
1550
+ amount: Money;
1551
1551
  currency: string;
1552
1552
  /**
1553
- * The usage invoice this charge was added to. Absent until its statement closes and always absent for unrated charges.
1553
+ * Present after the statement is closed and its invoice is issued.
1554
1554
  * @nullable
1555
1555
  */
1556
1556
  invoice_id?: string | null;
1557
1557
  /**
1558
- * The usage invoice line this charge was summed into. Absent until its statement closes and always absent for unrated charges.
1558
+ * Present after the statement is closed and its invoice is issued.
1559
1559
  * @nullable
1560
1560
  */
1561
1561
  invoice_item_id?: string | null;
@@ -1825,7 +1825,7 @@ export interface AutoRenewSet {
1825
1825
  * Confirmation moves it to pending. Both pending_checkout
1826
1826
  * and pending can expire or be canceled; neither establishes service delivery.
1827
1827
  *
1828
- * Follows the items. `pending` has confirmed checkout, is not yet accepted and may be paid or unpaid. `active` is
1828
+ * Follows the items. `pending` has confirmed checkout, is not yet accepted and may be paid or unpaid. `accepted` is
1829
1829
  * accepted with items still being set up. `completed` means every item was set up.
1830
1830
  * `partially_completed` means some items were set up and the others failed or were canceled and were
1831
1831
  * refunded to their original payment sources. `failed` means no item was delivered and at least one failed; collected amounts for the
@@ -1836,7 +1836,7 @@ export type OrderStatus = (typeof OrderStatus)[keyof typeof OrderStatus];
1836
1836
  export declare const OrderStatus: {
1837
1837
  readonly pending_checkout: "pending_checkout";
1838
1838
  readonly pending: "pending";
1839
- readonly active: "active";
1839
+ readonly accepted: "accepted";
1840
1840
  readonly completed: "completed";
1841
1841
  readonly partially_completed: "partially_completed";
1842
1842
  readonly failed: "failed";
@@ -2490,7 +2490,7 @@ export declare const ActiveResourceStatus: {
2490
2490
  readonly active: "active";
2491
2491
  readonly suspended: "suspended";
2492
2492
  readonly closing: "closing";
2493
- readonly completed: "completed";
2493
+ readonly closed: "closed";
2494
2494
  };
2495
2495
  /**
2496
2496
  * A resource currently accruing charges by the second.
@@ -2513,9 +2513,9 @@ export interface ActiveResource {
2513
2513
  dimensions?: ActiveResourceDimensions;
2514
2514
  status: ActiveResourceStatus;
2515
2515
  started_at: string;
2516
- /** Usage has been generated up to this boundary; it does not imply invoicing or payment. */
2517
- metered_until: string;
2518
2516
  project_id?: string;
2517
+ /** Usage has been generated up to this boundary; it does not imply invoicing or payment. */
2518
+ usage_generated_until: string;
2519
2519
  }
2520
2520
  export interface ActiveResourceList {
2521
2521
  items: ActiveResource[];
@@ -2724,8 +2724,6 @@ export interface StatementItem {
2724
2724
  /** Net usage quantity. Included only when grouping by meter. */
2725
2725
  quantity?: string;
2726
2726
  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
2727
  amount: Money;
2730
2728
  }
2731
2729
  export type StatementSummaryGroupBy = (typeof StatementSummaryGroupBy)[keyof typeof StatementSummaryGroupBy];
@@ -3494,7 +3492,7 @@ export declare const ListActiveResourcesStatus: {
3494
3492
  readonly active: "active";
3495
3493
  readonly suspended: "suspended";
3496
3494
  readonly closing: "closing";
3497
- readonly completed: "completed";
3495
+ readonly closed: "closed";
3498
3496
  };
3499
3497
  export type ListSpendParams = {
3500
3498
  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",
@@ -313,7 +313,7 @@ export const ActiveResourceStatus = {
313
313
  active: "active",
314
314
  suspended: "suspended",
315
315
  closing: "closing",
316
- completed: "completed",
316
+ closed: "closed",
317
317
  };
318
318
  export const StatementStatus = {
319
319
  open: "open",
@@ -354,7 +354,7 @@ export const ListActiveResourcesStatus = {
354
354
  active: "active",
355
355
  suspended: "suspended",
356
356
  closing: "closing",
357
- completed: "completed",
357
+ closed: "closed",
358
358
  };
359
359
  export const ListSpendGroupBy = {
360
360
  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,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;
@@ -12,7 +12,7 @@
12
12
  * project. It does not state whether a given operation is allowed; each service declares which permission its own operations require.
13
13
  * OpenAPI spec version: 1.0.0
14
14
  */
15
- import type { AttachPolicyRequestBody, BatchGetMembersRequestBody, BatchGetMembersResponseBody, CatalogListResponseBody, CreateRoleRequestBody, CreateSSHKeyRequestBody, Error, IssueInvitationRequestBody, IssuedInvitationResponseBody, LengthAwarePageInvitationResource, LengthAwarePageMemberResource, LengthAwarePageSSHKeyResource, ListMembersParams, ListPoliciesParams, ListProjectInvitationsParams, ListSshKeysParams, MemberResource, MembershipResource, OwnershipTransferResponseBody, PolicyListResponseBody, PolicyResource, ProjectAccessResource, RenameSSHKeyRequestBody, RoleListResponseBody, RoleResource, SSHKeyResource, SetMemberPermissionsRequestBody, SetMemberRolesRequestBody, TransferOwnershipRequestBody, UpdatePolicyRequestBody, UpdateProjectRequestBody, UpdateRoleRequestBody } from "./models.js";
15
+ import type { AttachPolicyRequestBody, BatchGetMembersRequestBody, BatchGetMembersResponseBody, CatalogListResponseBody, CreateRoleRequestBody, CreateSSHKeyRequestBody, Error, IssueInvitationRequestBody, IssuedInvitationResponseBody, LengthAwarePageInvitationResource, LengthAwarePageMemberResource, LengthAwarePageSSHKeyResource, ListMembersParams, ListPoliciesParams, ListProjectInvitationsParams, ListSshKeysParams, MemberResource, MembershipResource, OwnershipTransferResponseBody, PolicyListResponseBody, PolicyResource, ProjectAccessResource, QuotaListResponseBody, RenameSSHKeyRequestBody, RoleListResponseBody, RoleResource, SSHKeyResource, SetMemberPermissionsRequestBody, SetMemberRolesRequestBody, TransferOwnershipRequestBody, UpdatePolicyRequestBody, UpdateProjectRequestBody, UpdateRoleRequestBody } from "./models.js";
16
16
  export type HTTPStatusCode1xx = 100 | 101 | 102 | 103;
17
17
  export type HTTPStatusCode2xx = 200 | 201 | 202 | 203 | 204 | 205 | 206 | 207;
18
18
  export type HTTPStatusCode3xx = 300 | 301 | 302 | 303 | 304 | 305 | 307 | 308;
@@ -123,6 +123,27 @@ export declare const getGetProjectMembershipUrl: () => string;
123
123
  * @summary Get the caller's standing in this project
124
124
  */
125
125
  export declare const getProjectMembership: (options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<getProjectMembershipResponse>;
126
+ export type listQuotasResponse200 = {
127
+ data: QuotaListResponseBody;
128
+ status: 200;
129
+ };
130
+ export type listQuotasResponseDefault = {
131
+ data: Error;
132
+ status: Exclude<HTTPStatusCodes, 200>;
133
+ };
134
+ export type listQuotasResponseSuccess = listQuotasResponse200 & {
135
+ headers: Headers;
136
+ };
137
+ export type listQuotasResponseError = listQuotasResponseDefault & {
138
+ headers: Headers;
139
+ };
140
+ export type listQuotasResponse = listQuotasResponseSuccess | listQuotasResponseError;
141
+ export declare const getListQuotasUrl: () => string;
142
+ /**
143
+ * How much of something this project may have in each service, such as instances or VPCs, with the limit in effect for it. A request that would exceed a limit is refused by the service concerned. Each service shows what the project currently has.
144
+ * @summary List this project's quotas
145
+ */
146
+ export declare const listQuotas: (options?: RequestInit, fetchFn?: typeof globalThis.fetch) => Promise<listQuotasResponse>;
126
147
  export type listProjectInvitationsResponse200 = {
127
148
  data: LengthAwarePageInvitationResource;
128
149
  status: 200;
@@ -94,6 +94,22 @@ export const getProjectMembership = async (options, fetchFn) => {
94
94
  const data = body ? JSON.parse(body) : {};
95
95
  return { data, status: res.status, headers: res.headers };
96
96
  };
97
+ export const getListQuotasUrl = () => {
98
+ return `https://iam.leaflow.cloud/api/v1/quotas`;
99
+ };
100
+ /**
101
+ * How much of something this project may have in each service, such as instances or VPCs, with the limit in effect for it. A request that would exceed a limit is refused by the service concerned. Each service shows what the project currently has.
102
+ * @summary List this project's quotas
103
+ */
104
+ export const listQuotas = async (options, fetchFn) => {
105
+ const res = await (fetchFn ?? fetch)(getListQuotasUrl(), {
106
+ ...options,
107
+ method: "GET",
108
+ });
109
+ const body = [204, 205, 304].includes(res.status) ? null : await res.text();
110
+ const data = body ? JSON.parse(body) : {};
111
+ return { data, status: res.status, headers: res.headers };
112
+ };
97
113
  export const getListProjectInvitationsUrl = (params) => {
98
114
  const normalizedParams = new URLSearchParams();
99
115
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -130,6 +130,17 @@ export interface UpdateProjectRequestBody {
130
130
  /** @maxLength 128 */
131
131
  name?: string;
132
132
  }
133
+ export interface QuotaResource {
134
+ /** The service enforcing the quota. */
135
+ service: string;
136
+ name: string;
137
+ description: string;
138
+ /** The most this project may have. */
139
+ limit: number;
140
+ }
141
+ export interface QuotaListResponseBody {
142
+ items: QuotaResource[];
143
+ }
133
144
  export interface MembershipResource {
134
145
  traits: ProjectTraitResource[];
135
146
  /** @nullable */
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow IAM API
5
+ * What happens inside a project: members, roles, invitations and SSH keys.
6
+ *
7
+ * Every request carries a scoped token; see the `bearerAuth` security scheme. No path carries a
8
+ * `projectId`, and the current project is the one the token states. Tokens are obtained from the
9
+ * account API.
10
+ *
11
+ * `GET /api/v1/membership` returns the roles and permissions the caller holds in the current
12
+ * project. It does not state whether a given operation is allowed; each service declares which permission its own operations require.
13
+ * OpenAPI spec version: 1.0.0
14
+ */
15
+ import * as zod from "zod";
16
+ export declare const QuotaListResponseBody: zod.ZodObject<{
17
+ items: zod.ZodArray<zod.ZodObject<{
18
+ service: zod.ZodString;
19
+ name: zod.ZodString;
20
+ description: zod.ZodString;
21
+ limit: zod.ZodInt;
22
+ }, zod.z.core.$strict>>;
23
+ }, zod.z.core.$strict>;
24
+ export type QuotaListResponseBody = zod.input<typeof QuotaListResponseBody>;
25
+ export type QuotaListResponseBodyOutput = zod.output<typeof QuotaListResponseBody>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow IAM API
5
+ * What happens inside a project: members, roles, invitations and SSH keys.
6
+ *
7
+ * Every request carries a scoped token; see the `bearerAuth` security scheme. No path carries a
8
+ * `projectId`, and the current project is the one the token states. Tokens are obtained from the
9
+ * account API.
10
+ *
11
+ * `GET /api/v1/membership` returns the roles and permissions the caller holds in the current
12
+ * project. It does not state whether a given operation is allowed; each service declares which permission its own operations require.
13
+ * OpenAPI spec version: 1.0.0
14
+ */
15
+ import * as zod from "zod";
16
+ import { QuotaResource } from "./quotaResource.zod.js";
17
+ export const QuotaListResponseBody = zod.strictObject({
18
+ items: zod.array(QuotaResource),
19
+ });
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow IAM API
5
+ * What happens inside a project: members, roles, invitations and SSH keys.
6
+ *
7
+ * Every request carries a scoped token; see the `bearerAuth` security scheme. No path carries a
8
+ * `projectId`, and the current project is the one the token states. Tokens are obtained from the
9
+ * account API.
10
+ *
11
+ * `GET /api/v1/membership` returns the roles and permissions the caller holds in the current
12
+ * project. It does not state whether a given operation is allowed; each service declares which permission its own operations require.
13
+ * OpenAPI spec version: 1.0.0
14
+ */
15
+ import * as zod from "zod";
16
+ export declare const QuotaResource: zod.ZodObject<{
17
+ service: zod.ZodString;
18
+ name: zod.ZodString;
19
+ description: zod.ZodString;
20
+ limit: zod.ZodInt;
21
+ }, zod.z.core.$strict>;
22
+ export type QuotaResource = zod.input<typeof QuotaResource>;
23
+ export type QuotaResourceOutput = zod.output<typeof QuotaResource>;
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Generated by orval 🍺
3
+ * Do not edit manually.
4
+ * Leaflow IAM API
5
+ * What happens inside a project: members, roles, invitations and SSH keys.
6
+ *
7
+ * Every request carries a scoped token; see the `bearerAuth` security scheme. No path carries a
8
+ * `projectId`, and the current project is the one the token states. Tokens are obtained from the
9
+ * account API.
10
+ *
11
+ * `GET /api/v1/membership` returns the roles and permissions the caller holds in the current
12
+ * project. It does not state whether a given operation is allowed; each service declares which permission its own operations require.
13
+ * OpenAPI spec version: 1.0.0
14
+ */
15
+ import * as zod from "zod";
16
+ export const QuotaResource = zod.strictObject({
17
+ service: zod.string().describe("The service enforcing the quota."),
18
+ name: zod.string(),
19
+ description: zod.string(),
20
+ limit: zod.int().describe("The most this project may have."),
21
+ });
package/dist/routes.d.ts CHANGED
@@ -2222,6 +2222,14 @@ export declare const routes: readonly [{
2222
2222
  readonly operationId: "get-project-membership";
2223
2223
  readonly securityScheme: "ScopedToken";
2224
2224
  readonly upstreamUrl: "https://iam.leaflow.cloud";
2225
+ }, {
2226
+ readonly service: "iam";
2227
+ readonly contract: "iam";
2228
+ readonly method: "GET";
2229
+ readonly path: "/api/v1/quotas";
2230
+ readonly operationId: "list-quotas";
2231
+ readonly securityScheme: "ScopedToken";
2232
+ readonly upstreamUrl: "https://iam.leaflow.cloud";
2225
2233
  }, {
2226
2234
  readonly service: "iam";
2227
2235
  readonly contract: "iam";
package/dist/routes.js CHANGED
@@ -2502,6 +2502,15 @@ export const routes = [
2502
2502
  securityScheme: "ScopedToken",
2503
2503
  upstreamUrl: "https://iam.leaflow.cloud",
2504
2504
  },
2505
+ {
2506
+ service: "iam",
2507
+ contract: "iam",
2508
+ method: "GET",
2509
+ path: "/api/v1/quotas",
2510
+ operationId: "list-quotas",
2511
+ securityScheme: "ScopedToken",
2512
+ upstreamUrl: "https://iam.leaflow.cloud",
2513
+ },
2505
2514
  {
2506
2515
  service: "iam",
2507
2516
  contract: "iam",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leaflow/sdk",
3
- "version": "0.118.0",
3
+ "version": "0.120.0",
4
4
  "description": "Leaflow 平台 API 的 TypeScript SDK",
5
5
  "license": "MIT",
6
6
  "repository": {