@leaflow/sdk 0.0.0-dev.399.g3371eb3 → 0.0.0-dev.401.gdfcdac0

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.
@@ -82,7 +82,7 @@ export const createWithdrawal = async (withdrawalCreate, options, fetchFn) => {
82
82
  return { data, status: res.status, headers: res.headers };
83
83
  };
84
84
  export const getPreviewWithdrawalUrl = () => {
85
- return `https://billing.leaflow.cloud/api/v1/withdrawals/preview`;
85
+ return `https://billing.leaflow.cloud/api/v1/withdrawals:preview`;
86
86
  };
87
87
  /**
88
88
  * Previews the balance deduction, fees and refund split by original top-up. Omit amount to preview all available balance. Nothing is created or reserved. Fails when a selected source has no refund route or its original processing cost is not yet known.
@@ -386,7 +386,7 @@ export const updateBillingAccount = async (accountId, billingAccountUpdate, opti
386
386
  return { data, status: res.status, headers: res.headers };
387
387
  };
388
388
  export const getSuspendBillingAccountUrl = (accountId) => {
389
- return `https://billing.leaflow.cloud/api/v1/billing-accounts/${encodeURIComponent(String(accountId))}/suspend`;
389
+ return `https://billing.leaflow.cloud/api/v1/billing-accounts/${encodeURIComponent(String(accountId))}:suspend`;
390
390
  };
391
391
  /**
392
392
  * Suspends your active billing account without closing it, also while it is in arrears. While suspended, it
@@ -406,7 +406,7 @@ export const suspendBillingAccount = async (accountId, options, fetchFn) => {
406
406
  return { data, status: res.status, headers: res.headers };
407
407
  };
408
408
  export const getResumeBillingAccountUrl = (accountId) => {
409
- return `https://billing.leaflow.cloud/api/v1/billing-accounts/${encodeURIComponent(String(accountId))}/resume`;
409
+ return `https://billing.leaflow.cloud/api/v1/billing-accounts/${encodeURIComponent(String(accountId))}:resume`;
410
410
  };
411
411
  /**
412
412
  * Resumes a billing account you suspended. Refused with `BILLING_ACCOUNT_SUSPENDED_BY_OPERATOR` when Leaflow
@@ -656,7 +656,7 @@ export const getTopUp = async (topUpId, options, fetchFn) => {
656
656
  return { data, status: res.status, headers: res.headers };
657
657
  };
658
658
  export const getCancelTopUpUrl = (topUpId) => {
659
- return `https://billing.leaflow.cloud/api/v1/top-ups/${encodeURIComponent(String(topUpId))}/cancel`;
659
+ return `https://billing.leaflow.cloud/api/v1/top-ups/${encodeURIComponent(String(topUpId))}:cancel`;
660
660
  };
661
661
  /**
662
662
  * Withdraws a pending top-up of the authenticated user at the payment gateway. It becomes `canceled` with
@@ -769,7 +769,7 @@ export const deletePaymentMethod = async (paymentMethodId, options, fetchFn) =>
769
769
  return { data, status: res.status, headers: res.headers };
770
770
  };
771
771
  export const getPayInvoiceUrl = (invoiceId) => {
772
- return `https://billing.leaflow.cloud/api/v1/invoices/${encodeURIComponent(String(invoiceId))}/pay`;
772
+ return `https://billing.leaflow.cloud/api/v1/invoices/${encodeURIComponent(String(invoiceId))}:pay`;
773
773
  };
774
774
  /**
775
775
  * Pays the invoice from eligible credit grants and balance as requested, and collects the remainder through the
@@ -831,8 +831,8 @@ export const getPreviewInvoicePaymentUrl = (invoiceId, params) => {
831
831
  });
832
832
  const stringifiedParams = normalizedParams.toString();
833
833
  return stringifiedParams.length > 0
834
- ? `https://billing.leaflow.cloud/api/v1/invoices/${encodeURIComponent(String(invoiceId))}/payment-preview?${stringifiedParams}`
835
- : `https://billing.leaflow.cloud/api/v1/invoices/${encodeURIComponent(String(invoiceId))}/payment-preview`;
834
+ ? `https://billing.leaflow.cloud/api/v1/invoices/${encodeURIComponent(String(invoiceId))}:previewPayment?${stringifiedParams}`
835
+ : `https://billing.leaflow.cloud/api/v1/invoices/${encodeURIComponent(String(invoiceId))}:previewPayment`;
836
836
  };
837
837
  /**
838
838
  * What paying this invoice now would take from credit grants, from the balance and, for the rest,
@@ -897,7 +897,7 @@ export const payTogether = async (payTogetherRequest, options, fetchFn) => {
897
897
  return { data, status: res.status, headers: res.headers };
898
898
  };
899
899
  export const getPreviewPayTogetherUrl = () => {
900
- return `https://billing.leaflow.cloud/api/v1/payments/preview`;
900
+ return `https://billing.leaflow.cloud/api/v1/payments:preview`;
901
901
  };
902
902
  /**
903
903
  * What paying these invoices together now would take from credit grants and from the balance, per invoice in payment order, calculated as paying together does. Nothing is charged, reserved or created. Refused with the same errors as paying together, except that insufficient funds show as a `gateway_amount` above zero instead of an error.
@@ -1244,7 +1244,7 @@ export const deleteSubscription = async (subscriptionId, options, fetchFn) => {
1244
1244
  return { data, status: res.status, headers: res.headers };
1245
1245
  };
1246
1246
  export const getCancelSubscriptionUrl = (subscriptionId) => {
1247
- return `https://billing.leaflow.cloud/api/v1/subscriptions/${encodeURIComponent(String(subscriptionId))}/cancel`;
1247
+ return `https://billing.leaflow.cloud/api/v1/subscriptions/${encodeURIComponent(String(subscriptionId))}:cancel`;
1248
1248
  };
1249
1249
  /**
1250
1250
  * Requests cancellation on the purchase's agreed terms, with the same rules as creating a cancellation. Give the
@@ -1475,7 +1475,7 @@ export const getCancellation = async (cancellationId, options, fetchFn) => {
1475
1475
  return { data, status: res.status, headers: res.headers };
1476
1476
  };
1477
1477
  export const getWithdrawCancellationUrl = (cancellationId) => {
1478
- return `https://billing.leaflow.cloud/api/v1/cancellations/${encodeURIComponent(String(cancellationId))}/withdraw`;
1478
+ return `https://billing.leaflow.cloud/api/v1/cancellations/${encodeURIComponent(String(cancellationId))}:withdraw`;
1479
1479
  };
1480
1480
  /**
1481
1481
  * Withdraws the whole cancellation while no resource has begun to be released; afterwards it is refused with 409 `BILLING_CANCELLATION_CONFLICT`. The subscriptions continue, but automatic renewal, turned off when the cancellation was created, stays off until it is turned on again. Withdrawing a withdrawn cancellation returns it unchanged. Open to the owner of the subscriptions' current billing account and to members of their project with the project permission `billing:finance.manage`.
@@ -1516,7 +1516,7 @@ export const listRenewalPrices = async (subscriptionId, params, options, fetchFn
1516
1516
  return { data, status: res.status, headers: res.headers };
1517
1517
  };
1518
1518
  export const getRenewSubscriptionUrl = (subscriptionId) => {
1519
- return `https://billing.leaflow.cloud/api/v1/subscriptions/${encodeURIComponent(String(subscriptionId))}/renew`;
1519
+ return `https://billing.leaflow.cloud/api/v1/subscriptions/${encodeURIComponent(String(subscriptionId))}:renew`;
1520
1520
  };
1521
1521
  /**
1522
1522
  * Buys licensed periods from current_term_end at the agreed recurring amount and pays for them at once. A
@@ -1759,7 +1759,7 @@ export const getCheckoutSessionQuote = async (checkoutSessionId, params, options
1759
1759
  return { data, status: res.status, headers: res.headers };
1760
1760
  };
1761
1761
  export const getConfirmCheckoutSessionUrl = (checkoutSessionId) => {
1762
- return `https://billing.leaflow.cloud/api/v1/checkout-sessions/${encodeURIComponent(String(checkoutSessionId))}/confirm`;
1762
+ return `https://billing.leaflow.cloud/api/v1/checkout-sessions/${encodeURIComponent(String(checkoutSessionId))}:confirm`;
1763
1763
  };
1764
1764
  /**
1765
1765
  * Completes an open session: applies `promotion_code`, or otherwise the best applicable account discount, checks
@@ -1802,7 +1802,7 @@ export const confirmCheckoutSession = async (checkoutSessionId, checkoutSessionC
1802
1802
  return { data, status: res.status, headers: res.headers };
1803
1803
  };
1804
1804
  export const getExpireCheckoutSessionUrl = (checkoutSessionId) => {
1805
- return `https://billing.leaflow.cloud/api/v1/checkout-sessions/${encodeURIComponent(String(checkoutSessionId))}/expire`;
1805
+ return `https://billing.leaflow.cloud/api/v1/checkout-sessions/${encodeURIComponent(String(checkoutSessionId))}:expire`;
1806
1806
  };
1807
1807
  /**
1808
1808
  * Ends an open session without an order; the service that created it releases what it was holding for the purchase. An expired session is returned unchanged. Open to the owner of the session's billing account and to members of its project.
@@ -1867,8 +1867,8 @@ export const getPreviewOrderRefundUrl = (orderId, params) => {
1867
1867
  });
1868
1868
  const stringifiedParams = normalizedParams.toString();
1869
1869
  return stringifiedParams.length > 0
1870
- ? `https://billing.leaflow.cloud/api/v1/orders/${encodeURIComponent(String(orderId))}/refund-preview?${stringifiedParams}`
1871
- : `https://billing.leaflow.cloud/api/v1/orders/${encodeURIComponent(String(orderId))}/refund-preview`;
1870
+ ? `https://billing.leaflow.cloud/api/v1/orders/${encodeURIComponent(String(orderId))}:previewRefund?${stringifiedParams}`
1871
+ : `https://billing.leaflow.cloud/api/v1/orders/${encodeURIComponent(String(orderId))}:previewRefund`;
1872
1872
  };
1873
1873
  /**
1874
1874
  * What canceling the listed items, or the whole order, would refund to the original payment sources. Nothing is canceled or refunded. Open to the owner of the order's billing account and to members of its project.
@@ -1884,7 +1884,7 @@ export const previewOrderRefund = async (orderId, params, options, fetchFn) => {
1884
1884
  return { data, status: res.status, headers: res.headers };
1885
1885
  };
1886
1886
  export const getCancelOrderUrl = (orderId) => {
1887
- return `https://billing.leaflow.cloud/api/v1/orders/${encodeURIComponent(String(orderId))}/cancel`;
1887
+ return `https://billing.leaflow.cloud/api/v1/orders/${encodeURIComponent(String(orderId))}:cancel`;
1888
1888
  };
1889
1889
  /**
1890
1890
  * Cancels the selected undelivered items of an order that has not been accepted, without recording a delivery
@@ -381,7 +381,7 @@ export const updateApiKey = async (keyId, updateAPIKeyRequestBody, options, fetc
381
381
  return { data, status: res.status, headers: res.headers };
382
382
  };
383
383
  export const getDisableApiKeyUrl = (keyId) => {
384
- return `https://canopy.leaflow.cloud/api/v1/keys/${encodeURIComponent(String(keyId))}/disable`;
384
+ return `https://canopy.leaflow.cloud/api/v1/keys/${encodeURIComponent(String(keyId))}:disable`;
385
385
  };
386
386
  /**
387
387
  * A temporary measure; the key may be enabled again at any time. Use revocation to invalidate it permanently.
@@ -397,7 +397,7 @@ export const disableApiKey = async (keyId, options, fetchFn) => {
397
397
  return { data, status: res.status, headers: res.headers };
398
398
  };
399
399
  export const getEnableApiKeyUrl = (keyId) => {
400
- return `https://canopy.leaflow.cloud/api/v1/keys/${encodeURIComponent(String(keyId))}/enable`;
400
+ return `https://canopy.leaflow.cloud/api/v1/keys/${encodeURIComponent(String(keyId))}:enable`;
401
401
  };
402
402
  /**
403
403
  * Two cases cannot be enabled again. A revoked key answers `API_KEY_REVOKED`, and a key disabled because its project is suspended answers `API_KEY_PROJECT_SUSPENDED` with `suspended` set to true; the latter requires the project to be restored first.
@@ -413,7 +413,7 @@ export const enableApiKey = async (keyId, options, fetchFn) => {
413
413
  return { data, status: res.status, headers: res.headers };
414
414
  };
415
415
  export const getRevokeApiKeyUrl = (keyId) => {
416
- return `https://canopy.leaflow.cloud/api/v1/keys/${encodeURIComponent(String(keyId))}/revoke`;
416
+ return `https://canopy.leaflow.cloud/api/v1/keys/${encodeURIComponent(String(keyId))}:revoke`;
417
417
  };
418
418
  /**
419
419
  * **Irreversible.** It is intended for a key that has been exposed, such as one committed to a repository.
@@ -126,7 +126,7 @@ export const deleteBackup = async (backupId, options, fetchFn) => {
126
126
  return { data, status: res.status, headers: res.headers };
127
127
  };
128
128
  export const getRestoreBackupUrl = (backupId) => {
129
- return `https://compute.leaflow.cloud/api/v1/backups/${encodeURIComponent(String(backupId))}/restore`;
129
+ return `https://compute.leaflow.cloud/api/v1/backups/${encodeURIComponent(String(backupId))}:restore`;
130
130
  };
131
131
  /**
132
132
  * Restores onto a **newly created** disk. The source disk is unaffected and need not still exist.
@@ -569,7 +569,7 @@ export const deleteDisk = async (diskId, params, options, fetchFn) => {
569
569
  return { data, status: res.status, headers: res.headers };
570
570
  };
571
571
  export const getResizeDiskUrl = (diskId) => {
572
- return `https://compute.leaflow.cloud/api/v1/disks/${encodeURIComponent(String(diskId))}/resize`;
572
+ return `https://compute.leaflow.cloud/api/v1/disks/${encodeURIComponent(String(diskId))}:resize`;
573
573
  };
574
574
  /**
575
575
  * Capacity can only be increased; shrinking is not supported. Returns the disk with the Checkout Session for the resize, which keeps the disk's usage type and period. The disk shows the `resize` operation until the resize is applied, its Checkout Session expires or its order is canceled, so other operations and a second resize are refused with `COMPUTE_RESOURCE_BUSY` meanwhile. The disk keeps its current size until the resize is applied; once `size_gb` shows the new size, extend the file system inside the instance. If checkout is not completed, the order is not accepted or the resize fails, the disk keeps its size and Billing shows the outcome.
@@ -608,7 +608,7 @@ export const resizeDisk = async (diskId, resizeDiskRequestBody, options, fetchFn
608
608
  return { data, status: res.status, headers: res.headers };
609
609
  };
610
610
  export const getRevertDiskUrl = (diskId) => {
611
- return `https://compute.leaflow.cloud/api/v1/disks/${encodeURIComponent(String(diskId))}/revert`;
611
+ return `https://compute.leaflow.cloud/api/v1/disks/${encodeURIComponent(String(diskId))}:revert`;
612
612
  };
613
613
  /**
614
614
  * Restores the contents of the disk to the moment the snapshot was taken. **All data written after that moment is lost and cannot be recovered.**
@@ -785,7 +785,7 @@ export const setFloatingIpBandwidth = async (floatingIpId, setFloatingIPBandwidt
785
785
  return { data, status: res.status, headers: res.headers };
786
786
  };
787
787
  export const getBindFloatingIpUrl = (floatingIpId) => {
788
- return `https://compute.leaflow.cloud/api/v1/floating-ips/${encodeURIComponent(String(floatingIpId))}/binding`;
788
+ return `https://compute.leaflow.cloud/api/v1/floating-ips/${encodeURIComponent(String(floatingIpId))}:bind`;
789
789
  };
790
790
  /**
791
791
  * The floating IP shows the `bind` operation until the binding is confirmed.
@@ -809,7 +809,7 @@ export const bindFloatingIp = async (floatingIpId, bindFloatingIPRequestBody, op
809
809
  };
810
810
  const res = await (fetchFn ?? fetch)(getBindFloatingIpUrl(floatingIpId), {
811
811
  ...options,
812
- method: "PUT",
812
+ method: "POST",
813
813
  headers: { "Content-Type": "application/json", ...getHeaders(options?.headers) },
814
814
  body: JSON.stringify(bindFloatingIPRequestBody),
815
815
  });
@@ -818,7 +818,7 @@ export const bindFloatingIp = async (floatingIpId, bindFloatingIPRequestBody, op
818
818
  return { data, status: res.status, headers: res.headers };
819
819
  };
820
820
  export const getUnbindFloatingIpUrl = (floatingIpId) => {
821
- return `https://compute.leaflow.cloud/api/v1/floating-ips/${encodeURIComponent(String(floatingIpId))}/binding`;
821
+ return `https://compute.leaflow.cloud/api/v1/floating-ips/${encodeURIComponent(String(floatingIpId))}:unbind`;
822
822
  };
823
823
  /**
824
824
  * The address remains held by the project and simply no longer points at any network interface. The floating IP shows the `unbind` operation until the change is confirmed.
@@ -827,7 +827,7 @@ export const getUnbindFloatingIpUrl = (floatingIpId) => {
827
827
  export const unbindFloatingIp = async (floatingIpId, options, fetchFn) => {
828
828
  const res = await (fetchFn ?? fetch)(getUnbindFloatingIpUrl(floatingIpId), {
829
829
  ...options,
830
- method: "DELETE",
830
+ method: "POST",
831
831
  });
832
832
  const body = [204, 205, 304].includes(res.status) ? null : await res.text();
833
833
  const data = body ? JSON.parse(body) : {};
@@ -1183,7 +1183,7 @@ export const resetInstancePassword = async (instanceId, resetPasswordRequestBody
1183
1183
  return { data, status: res.status, headers: res.headers };
1184
1184
  };
1185
1185
  export const getRebootInstanceUrl = (instanceId) => {
1186
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/reboot`;
1186
+ return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}:reboot`;
1187
1187
  };
1188
1188
  /**
1189
1189
  * A reboot defaults to soft, in which the operating system shuts down normally before starting again.
@@ -1224,7 +1224,7 @@ export const rebootInstance = async (instanceId, rebootInstanceRequestBody, opti
1224
1224
  return { data, status: res.status, headers: res.headers };
1225
1225
  };
1226
1226
  export const getRebuildInstanceUrl = (instanceId) => {
1227
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/rebuild`;
1227
+ return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}:rebuild`;
1228
1228
  };
1229
1229
  /**
1230
1230
  * **All data on the system disk is erased and cannot be recovered.** Attached data disks are unaffected.
@@ -1261,7 +1261,7 @@ export const rebuildInstance = async (instanceId, rebuildInstanceRequestBody, op
1261
1261
  return { data, status: res.status, headers: res.headers };
1262
1262
  };
1263
1263
  export const getResizeInstanceUrl = (instanceId) => {
1264
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/resize`;
1264
+ return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}:resize`;
1265
1265
  };
1266
1266
  /**
1267
1267
  * Creates a Billing Checkout Session for the change, including for metered pricing, and returns the instance with it. The instance keeps its usage type and period, priced with the target type's matching option; a target type without that option is refused with 409 `BILLING_OPTION_UNAVAILABLE`. Do not submit a new purchase after paying. After an uncertain response, look the Checkout Session up in Billing before submitting again.
@@ -1296,7 +1296,7 @@ export const resizeInstance = async (instanceId, resizeInstanceRequestBody, opti
1296
1296
  return { data, status: res.status, headers: res.headers };
1297
1297
  };
1298
1298
  export const getStartInstanceUrl = (instanceId) => {
1299
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/start`;
1299
+ return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}:start`;
1300
1300
  };
1301
1301
  /**
1302
1302
  * Outstanding restrictions can prevent starting. The instance shows the `start` operation until it is running or the start has failed.
@@ -1329,7 +1329,7 @@ export const startInstance = async (instanceId, powerRequest, options, fetchFn)
1329
1329
  return { data, status: res.status, headers: res.headers };
1330
1330
  };
1331
1331
  export const getStopInstanceUrl = (instanceId) => {
1332
- return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}/stop`;
1332
+ return `https://compute.leaflow.cloud/api/v1/instances/${encodeURIComponent(String(instanceId))}:stop`;
1333
1333
  };
1334
1334
  /**
1335
1335
  * A stopped instance keeps its disks, network attachments and sellable quota. The instance shows the `stop` operation until it is stopped or the stop has failed.
@@ -2705,7 +2705,7 @@ export const deletePeering = async (peeringId, options, fetchFn) => {
2705
2705
  return { data, status: res.status, headers: res.headers };
2706
2706
  };
2707
2707
  export const getAcceptPeeringUrl = (peeringId) => {
2708
- return `https://compute.leaflow.cloud/api/v1/peerings/${encodeURIComponent(String(peeringId))}/accept`;
2708
+ return `https://compute.leaflow.cloud/api/v1/peerings/${encodeURIComponent(String(peeringId))}:accept`;
2709
2709
  };
2710
2710
  /**
2711
2711
  * @summary Accept peering
@@ -2720,7 +2720,7 @@ export const acceptPeering = async (peeringId, options, fetchFn) => {
2720
2720
  return { data, status: res.status, headers: res.headers };
2721
2721
  };
2722
2722
  export const getRejectPeeringUrl = (peeringId) => {
2723
- return `https://compute.leaflow.cloud/api/v1/peerings/${encodeURIComponent(String(peeringId))}/reject`;
2723
+ return `https://compute.leaflow.cloud/api/v1/peerings/${encodeURIComponent(String(peeringId))}:reject`;
2724
2724
  };
2725
2725
  /**
2726
2726
  * @summary Reject peering
@@ -493,7 +493,7 @@ export const detachPolicy = async (policyId, options, fetchFn) => {
493
493
  return { data, status: res.status, headers: res.headers };
494
494
  };
495
495
  export const getTransferProjectOwnershipUrl = () => {
496
- return `https://iam.leaflow.cloud/api/v1/transfer-ownership`;
496
+ return `https://iam.leaflow.cloud/api/v1/project:transferOwnership`;
497
497
  };
498
498
  /**
499
499
  * The only way `OWNER` moves, and only the owner can initiate it.
@@ -172,7 +172,7 @@ export const listMembershipUpgradeOptions = async (membershipId, params, options
172
172
  return { data, status: res.status, headers: res.headers };
173
173
  };
174
174
  export const getUpgradeMembershipUrl = (membershipId) => {
175
- return `https://membership.leaflow.cloud/api/v1/memberships/${encodeURIComponent(String(membershipId))}/upgrade`;
175
+ return `https://membership.leaflow.cloud/api/v1/memberships/${encodeURIComponent(String(membershipId))}:upgrade`;
176
176
  };
177
177
  /**
178
178
  * Creates a Billing Checkout Session for the full-period price difference. The upgrade takes effect after payment, benefit issuance and delivery confirmation; renewal uses the target tier. Returns 409 MEMBERSHIP_NOT_ACTIVE or MEMBERSHIP_CHANGE_PENDING, or 422 MEMBERSHIP_UPGRADE_UNAVAILABLE. Returns 403 MEMBERSHIP_ACCOUNT_DELETING while the caller's account deletion is pending, or 403 MEMBERSHIP_ACCOUNT_UNUSABLE when the account is deleted, suspended or banned.
@@ -205,7 +205,7 @@ export const upgradeMembership = async (membershipId, membershipUpgrade, options
205
205
  return { data, status: res.status, headers: res.headers };
206
206
  };
207
207
  export const getScheduleMembershipDowngradeUrl = (membershipId) => {
208
- return `https://membership.leaflow.cloud/api/v1/memberships/${encodeURIComponent(String(membershipId))}/downgrade`;
208
+ return `https://membership.leaflow.cloud/api/v1/memberships/${encodeURIComponent(String(membershipId))}:scheduleDowngrade`;
209
209
  };
210
210
  /**
211
211
  * Schedules a lower tier for the next period. Current benefits remain valid. Returns 409 MEMBERSHIP_NOT_ACTIVE or MEMBERSHIP_CHANGE_PENDING, or 422 MEMBERSHIP_DOWNGRADE_INVALID. Returns 403 MEMBERSHIP_ACCOUNT_DELETING while the caller's account deletion is pending, or 403 MEMBERSHIP_ACCOUNT_UNUSABLE when the account is deleted, suspended or banned.
@@ -238,7 +238,7 @@ export const scheduleMembershipDowngrade = async (membershipId, membershipDowngr
238
238
  return { data, status: res.status, headers: res.headers };
239
239
  };
240
240
  export const getCancelMembershipDowngradeUrl = (membershipId) => {
241
- return `https://membership.leaflow.cloud/api/v1/memberships/${encodeURIComponent(String(membershipId))}/downgrade`;
241
+ return `https://membership.leaflow.cloud/api/v1/memberships/${encodeURIComponent(String(membershipId))}:cancelDowngrade`;
242
242
  };
243
243
  /**
244
244
  * Cancels the scheduled downgrade. Returns 409 MEMBERSHIP_CHANGE_PENDING if none is scheduled.
@@ -247,7 +247,7 @@ export const getCancelMembershipDowngradeUrl = (membershipId) => {
247
247
  export const cancelMembershipDowngrade = async (membershipId, options, fetchFn) => {
248
248
  const res = await (fetchFn ?? fetch)(getCancelMembershipDowngradeUrl(membershipId), {
249
249
  ...options,
250
- method: "DELETE",
250
+ method: "POST",
251
251
  });
252
252
  const body = [204, 205, 304].includes(res.status) ? null : await res.text();
253
253
  const data = body ? JSON.parse(body) : {};
@@ -39,7 +39,7 @@ export const getIncident = async (incidentId, options, fetchFn) => {
39
39
  return { data, status: res.status, headers: res.headers };
40
40
  };
41
41
  export const getAcknowledgeIncidentUrl = (incidentId) => {
42
- return `https://monitoring.leaflow.cloud/api/v1/incidents/${encodeURIComponent(String(incidentId))}/acknowledge`;
42
+ return `https://monitoring.leaflow.cloud/api/v1/incidents/${encodeURIComponent(String(incidentId))}:acknowledge`;
43
43
  };
44
44
  /**
45
45
  * The incident is also marked as acknowledged in the monitoring system, so that other channels can see it already has an owner.
@@ -107,7 +107,7 @@ export const assignIncident = async (incidentId, assignIncidentRequestBody, opti
107
107
  return { data, status: res.status, headers: res.headers };
108
108
  };
109
109
  export const getCloseIncidentUrl = (incidentId) => {
110
- return `https://monitoring.leaflow.cloud/api/v1/incidents/${encodeURIComponent(String(incidentId))}/close`;
110
+ return `https://monitoring.leaflow.cloud/api/v1/incidents/${encodeURIComponent(String(incidentId))}:close`;
111
111
  };
112
112
  /**
113
113
  * Closing records **that the handling process is finished on this platform**; it does not change the state of the incident itself. An incident that has not recovered may still be closed as an accepted risk, and remains unrecovered in the monitoring system.
@@ -205,7 +205,7 @@ export const setIncidentFollowing = async (incidentId, setFollowingRequestBody,
205
205
  return { data, status: res.status, headers: res.headers };
206
206
  };
207
207
  export const getReopenIncidentUrl = (incidentId) => {
208
- return `https://monitoring.leaflow.cloud/api/v1/incidents/${encodeURIComponent(String(incidentId))}/reopen`;
208
+ return `https://monitoring.leaflow.cloud/api/v1/incidents/${encodeURIComponent(String(incidentId))}:reopen`;
209
209
  };
210
210
  /**
211
211
  * @summary Reopen a closed incident
@@ -593,7 +593,7 @@ export const deleteServer = async (serverId, options, fetchFn) => {
593
593
  return { data, status: res.status, headers: res.headers };
594
594
  };
595
595
  export const getDisableServerMonitoringUrl = (serverId) => {
596
- return `https://monitoring.leaflow.cloud/api/v1/servers/${encodeURIComponent(String(serverId))}/disable`;
596
+ return `https://monitoring.leaflow.cloud/api/v1/servers/${encodeURIComponent(String(serverId))}:disable`;
597
597
  };
598
598
  /**
599
599
  * Reversible: the monitored host is retained, only collection stops, and history is unaffected. Enrolling again resumes collection. To remove the history as well, use DELETE.
@@ -1407,7 +1407,7 @@ export const getStatusPageMaintenance = async (maintenanceId, options, fetchFn)
1407
1407
  return { data, status: res.status, headers: res.headers };
1408
1408
  };
1409
1409
  export const getCancelStatusPageMaintenanceUrl = (maintenanceId) => {
1410
- return `https://monitoring.leaflow.cloud/api/v1/status-page/maintenances/${encodeURIComponent(String(maintenanceId))}/cancel`;
1410
+ return `https://monitoring.leaflow.cloud/api/v1/status-page/maintenances/${encodeURIComponent(String(maintenanceId))}:cancel`;
1411
1411
  };
1412
1412
  /**
1413
1413
  * Cancelled rather than deleted, so that readers who saw the announcement have an explanation. Maintenance that has already started cannot be cancelled; finish it early instead.
@@ -1423,7 +1423,7 @@ export const cancelStatusPageMaintenance = async (maintenanceId, options, fetchF
1423
1423
  return { data, status: res.status, headers: res.headers };
1424
1424
  };
1425
1425
  export const getCompleteStatusPageMaintenanceUrl = (maintenanceId) => {
1426
- return `https://monitoring.leaflow.cloud/api/v1/status-page/maintenances/${encodeURIComponent(String(maintenanceId))}/complete`;
1426
+ return `https://monitoring.leaflow.cloud/api/v1/status-page/maintenances/${encodeURIComponent(String(maintenanceId))}:complete`;
1427
1427
  };
1428
1428
  /**
1429
1429
  * Optional: maintenance finishes on its own at the scheduled end time. Use this endpoint when the work is done ahead of schedule; the affected components return to operational immediately.
@@ -29,7 +29,7 @@ export const listNotifications = async (params, options, fetchFn) => {
29
29
  return { data, status: res.status, headers: res.headers };
30
30
  };
31
31
  export const getMarkNotificationsReadUrl = () => {
32
- return `https://notification.leaflow.cloud/api/v1/notifications/read`;
32
+ return `https://notification.leaflow.cloud/api/v1/notifications:batchMarkRead`;
33
33
  };
34
34
  /**
35
35
  * Marks every listed notification as read. Notifications already read are left alone, and the
@@ -109,7 +109,7 @@ export const getNotification = async (notificationId, options, fetchFn) => {
109
109
  return { data, status: res.status, headers: res.headers };
110
110
  };
111
111
  export const getMarkNotificationReadUrl = (notificationId) => {
112
- return `https://notification.leaflow.cloud/api/v1/notifications/${encodeURIComponent(String(notificationId))}/read`;
112
+ return `https://notification.leaflow.cloud/api/v1/notifications/${encodeURIComponent(String(notificationId))}:markRead`;
113
113
  };
114
114
  /**
115
115
  * Marking a notification that is already read succeeds and changes nothing.
@@ -125,7 +125,7 @@ export const markNotificationRead = async (notificationId, options, fetchFn) =>
125
125
  return { data, status: res.status, headers: res.headers };
126
126
  };
127
127
  export const getMarkNotificationUnreadUrl = (notificationId) => {
128
- return `https://notification.leaflow.cloud/api/v1/notifications/${encodeURIComponent(String(notificationId))}/read`;
128
+ return `https://notification.leaflow.cloud/api/v1/notifications/${encodeURIComponent(String(notificationId))}:markUnread`;
129
129
  };
130
130
  /**
131
131
  * Puts it back in the unread count, which is what somebody wants after opening a thing by
@@ -137,14 +137,14 @@ export const getMarkNotificationUnreadUrl = (notificationId) => {
137
137
  export const markNotificationUnread = async (notificationId, options, fetchFn) => {
138
138
  const res = await (fetchFn ?? fetch)(getMarkNotificationUnreadUrl(notificationId), {
139
139
  ...options,
140
- method: "DELETE",
140
+ method: "POST",
141
141
  });
142
142
  const body = [204, 205, 304].includes(res.status) ? null : await res.text();
143
143
  const data = body ? JSON.parse(body) : {};
144
144
  return { data, status: res.status, headers: res.headers };
145
145
  };
146
146
  export const getArchiveNotificationUrl = (notificationId) => {
147
- return `https://notification.leaflow.cloud/api/v1/notifications/${encodeURIComponent(String(notificationId))}/archive`;
147
+ return `https://notification.leaflow.cloud/api/v1/notifications/${encodeURIComponent(String(notificationId))}:archive`;
148
148
  };
149
149
  /**
150
150
  * Archiving removes a notification from the default listing without deleting it; pass
@@ -161,7 +161,7 @@ export const archiveNotification = async (notificationId, options, fetchFn) => {
161
161
  return { data, status: res.status, headers: res.headers };
162
162
  };
163
163
  export const getUnarchiveNotificationUrl = (notificationId) => {
164
- return `https://notification.leaflow.cloud/api/v1/notifications/${encodeURIComponent(String(notificationId))}/archive`;
164
+ return `https://notification.leaflow.cloud/api/v1/notifications/${encodeURIComponent(String(notificationId))}:unarchive`;
165
165
  };
166
166
  /**
167
167
  * Returns it to the default listing. Archiving is one click away from anything in the list,
@@ -177,7 +177,7 @@ export const getUnarchiveNotificationUrl = (notificationId) => {
177
177
  export const unarchiveNotification = async (notificationId, options, fetchFn) => {
178
178
  const res = await (fetchFn ?? fetch)(getUnarchiveNotificationUrl(notificationId), {
179
179
  ...options,
180
- method: "DELETE",
180
+ method: "POST",
181
181
  });
182
182
  const body = [204, 205, 304].includes(res.status) ? null : await res.text();
183
183
  const data = body ? JSON.parse(body) : {};
@@ -213,7 +213,7 @@ export const listAnnouncements = async (options, fetchFn) => {
213
213
  return { data, status: res.status, headers: res.headers };
214
214
  };
215
215
  export const getReadAllAnnouncementsUrl = () => {
216
- return `https://notification.leaflow.cloud/api/v1/announcements/read`;
216
+ return `https://notification.leaflow.cloud/api/v1/announcements:markAllRead`;
217
217
  };
218
218
  /**
219
219
  * Idempotent. Announcements you had already read stay read, and the count only covers the ones this call changed.
@@ -229,7 +229,7 @@ export const readAllAnnouncements = async (options, fetchFn) => {
229
229
  return { data, status: res.status, headers: res.headers };
230
230
  };
231
231
  export const getReadAnnouncementUrl = (announcementId) => {
232
- return `https://notification.leaflow.cloud/api/v1/announcements/${encodeURIComponent(String(announcementId))}/read`;
232
+ return `https://notification.leaflow.cloud/api/v1/announcements/${encodeURIComponent(String(announcementId))}:markRead`;
233
233
  };
234
234
  /**
235
235
  * Idempotent: marking one twice is the same as marking it once. There is no way to mark it
@@ -376,7 +376,7 @@ export const cancelEmailOverride = async (options, fetchFn) => {
376
376
  return { data, status: res.status, headers: res.headers };
377
377
  };
378
378
  export const getConfirmEmailOverrideUrl = () => {
379
- return `https://notification.leaflow.cloud/api/v1/preferences/email-override/code/confirm`;
379
+ return `https://notification.leaflow.cloud/api/v1/preferences/email-override/code:confirm`;
380
380
  };
381
381
  /**
382
382
  * A correct code moves the pending address into use: email starts going there instead of the
@@ -651,7 +651,7 @@ export const deleteUserChannel = async (channelId, options, fetchFn) => {
651
651
  return { data, status: res.status, headers: res.headers };
652
652
  };
653
653
  export const getVerifyUserChannelUrl = (channelId) => {
654
- return `https://notification.leaflow.cloud/api/v1/channels/${encodeURIComponent(String(channelId))}/verify`;
654
+ return `https://notification.leaflow.cloud/api/v1/channels/${encodeURIComponent(String(channelId))}:verify`;
655
655
  };
656
656
  /**
657
657
  * Sends one message to the channel and marks it verified if the endpoint accepted it.
@@ -694,7 +694,7 @@ export const describeCredentialTicket = async (ticketId, options, fetchFn) => {
694
694
  return { data, status: res.status, headers: res.headers };
695
695
  };
696
696
  export const getRevealCredentialUrl = (ticketId) => {
697
- return `https://notification.leaflow.cloud/api/v1/credentials/${encodeURIComponent(String(ticketId))}/reveal`;
697
+ return `https://notification.leaflow.cloud/api/v1/credentials/${encodeURIComponent(String(ticketId))}:reveal`;
698
698
  };
699
699
  /**
700
700
  * Returns the credential and destroys it in the same step. **This is the only operation that