oblien 2.3.2 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -0
- package/dist/access.d.ts +79 -0
- package/dist/access.d.ts.map +1 -0
- package/dist/access.js +42 -0
- package/dist/access.js.map +1 -0
- package/dist/billing.d.ts +19 -10
- package/dist/billing.d.ts.map +1 -1
- package/dist/billing.js +22 -9
- package/dist/billing.js.map +1 -1
- package/dist/cli/commands/desktop.d.ts.map +1 -1
- package/dist/cli/commands/desktop.js +6 -2
- package/dist/cli/commands/desktop.js.map +1 -1
- package/dist/cli/commands/lifecycle.d.ts.map +1 -1
- package/dist/cli/commands/lifecycle.js +22 -0
- package/dist/cli/commands/lifecycle.js.map +1 -1
- package/dist/cli/commands/scp.js +9 -2
- package/dist/cli/commands/scp.js.map +1 -1
- package/dist/cli/commands/ssh.d.ts.map +1 -1
- package/dist/cli/commands/ssh.js +12 -0
- package/dist/cli/commands/ssh.js.map +1 -1
- package/dist/cli/commands/workloads.d.ts.map +1 -1
- package/dist/cli/commands/workloads.js +26 -2
- package/dist/cli/commands/workloads.js.map +1 -1
- package/dist/cli/commands/workspaces.d.ts.map +1 -1
- package/dist/cli/commands/workspaces.js +11 -0
- package/dist/cli/commands/workspaces.js.map +1 -1
- package/dist/client.d.ts +8 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +12 -0
- package/dist/client.js.map +1 -1
- package/dist/disks.d.ts +49 -0
- package/dist/disks.d.ts.map +1 -0
- package/dist/disks.js +143 -0
- package/dist/disks.js.map +1 -0
- package/dist/http.d.ts +2 -0
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +12 -0
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +7 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/namespace.d.ts +14 -11
- package/dist/namespace.d.ts.map +1 -1
- package/dist/namespace.js +10 -9
- package/dist/namespace.js.map +1 -1
- package/dist/resources/desktop.d.ts +27 -1
- package/dist/resources/desktop.d.ts.map +1 -1
- package/dist/resources/desktop.js +22 -1
- package/dist/resources/desktop.js.map +1 -1
- package/dist/resources/images.d.ts +70 -1
- package/dist/resources/images.d.ts.map +1 -1
- package/dist/resources/images.js.map +1 -1
- package/dist/resources/lifecycle.d.ts +11 -2
- package/dist/resources/lifecycle.d.ts.map +1 -1
- package/dist/resources/lifecycle.js +7 -2
- package/dist/resources/lifecycle.js.map +1 -1
- package/dist/resources/ssh.d.ts +3 -0
- package/dist/resources/ssh.d.ts.map +1 -1
- package/dist/resources/ssh.js +4 -0
- package/dist/resources/ssh.js.map +1 -1
- package/dist/resources/workloads.d.ts +8 -2
- package/dist/resources/workloads.d.ts.map +1 -1
- package/dist/resources/workloads.js +13 -2
- package/dist/resources/workloads.js.map +1 -1
- package/dist/runtime/terminal.d.ts +10 -0
- package/dist/runtime/terminal.d.ts.map +1 -1
- package/dist/runtime/terminal.js +19 -0
- package/dist/runtime/terminal.js.map +1 -1
- package/dist/runtime/ws.d.ts.map +1 -1
- package/dist/runtime/ws.js +6 -2
- package/dist/runtime/ws.js.map +1 -1
- package/dist/types/access.d.ts +65 -0
- package/dist/types/access.d.ts.map +1 -0
- package/dist/types/access.js +2 -0
- package/dist/types/access.js.map +1 -0
- package/dist/types/billing.d.ts +96 -10
- package/dist/types/billing.d.ts.map +1 -1
- package/dist/types/billing.js +0 -8
- package/dist/types/billing.js.map +1 -1
- package/dist/types/client.d.ts +4 -0
- package/dist/types/client.d.ts.map +1 -1
- package/dist/types/disks.d.ts +153 -0
- package/dist/types/disks.d.ts.map +1 -0
- package/dist/types/disks.js +2 -0
- package/dist/types/disks.js.map +1 -0
- package/dist/types/index.d.ts +7 -4
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/namespace.d.ts +31 -3
- package/dist/types/namespace.d.ts.map +1 -1
- package/dist/types/runtime.d.ts +3 -1
- package/dist/types/runtime.d.ts.map +1 -1
- package/dist/types/workspace-resources.d.ts +33 -0
- package/dist/types/workspace-resources.d.ts.map +1 -1
- package/dist/types/workspace.d.ts +41 -3
- package/dist/types/workspace.d.ts.map +1 -1
- package/dist/workspace-handle.d.ts +2 -0
- package/dist/workspace-handle.d.ts.map +1 -1
- package/dist/workspace-handle.js +2 -0
- package/dist/workspace-handle.js.map +1 -1
- package/dist/workspace.d.ts +2 -0
- package/dist/workspace.d.ts.map +1 -1
- package/dist/workspace.js +23 -7
- package/dist/workspace.js.map +1 -1
- package/docs/billing.md +241 -5
- package/docs/desktop.md +32 -0
- package/docs/namespaces.md +62 -1
- package/docs/on-demand.md +43 -0
- package/docs/runtime.md +2 -0
- package/docs/webhooks.md +42 -0
- package/docs/workspace-limit-report.md +6 -0
- package/package.json +1 -1
package/docs/webhooks.md
CHANGED
|
@@ -40,3 +40,45 @@ await wh.delete(webhook.id);
|
|
|
40
40
|
`credits.usage` is emitted per billing cycle with `{ namespace, workspace_id, usage: { cpu_time_minutes, memory_gb_minutes, disk_io_gb, network_gb } }` — a push alternative to polling [`namespaces.usageUnits`](./namespaces.md). Idempotent per event.
|
|
41
41
|
|
|
42
42
|
**Full reference:** [Webhooks concept](https://oblien.com/docs/concepts/webhooks)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
## Namespace credit alerts and customer recovery
|
|
46
|
+
|
|
47
|
+
Oblien computes the warning state from the same quota row that enforces spending.
|
|
48
|
+
Read `quota.alert` from `GET /billing/entitlement?namespace=...`, or `alert` from
|
|
49
|
+
`GET /billing/balance?namespace=...`. Namespace quota rows also include `alert`.
|
|
50
|
+
Its `state` is `ok`, `low`, `grace`, `depleted`, `unlimited`, or `disabled`.
|
|
51
|
+
`percent` uses **included allowance + purchased top-ups**, excluding grace.
|
|
52
|
+
`remaining` is paid allowance left; `balance` also includes configured grace.
|
|
53
|
+
All amounts are JSON numbers in Oblien credits. Never add grace to `balance` again.
|
|
54
|
+
|
|
55
|
+
Subscribe to `namespace.quota.threshold`, `credits.low`, and `credits.depleted`:
|
|
56
|
+
|
|
57
|
+
- Warning percentages default to **80% and 95%** and can be configured per service.
|
|
58
|
+
`notificationThresholds: []` disables percentage warnings, not enforcement or
|
|
59
|
+
exhaustion alerts. A large usage window reports the most urgent crossed state.
|
|
60
|
+
- `credits.low` reports entry into configured grace. Zero grace remains the default.
|
|
61
|
+
`credits.depleted` reports exhaustion at `balance <= 0`.
|
|
62
|
+
- The usage debit, threshold marker and outgoing alert commit in **one payments
|
|
63
|
+
transaction**. Delivery retries after failures and API restarts, retaining its
|
|
64
|
+
signed body and event ID. Metering does not wait for your webhook or email server.
|
|
65
|
+
- Each event identifies `data.namespace`, `data.service`, `data.transaction_id`
|
|
66
|
+
and a numeric `data.alert` snapshot. Resolve the customer from your saved namespace
|
|
67
|
+
mapping, verify the signature, and durably save the event and notification job
|
|
68
|
+
before acknowledging. Deduplicate event IDs, then re-read current entitlement;
|
|
69
|
+
an old alert may arrive after a top-up or renewal. Do not use event amounts to
|
|
70
|
+
grant credits or override the current quota.
|
|
71
|
+
- Show a warning banner and a billing action. Use your server-defined top-up offer
|
|
72
|
+
to create a namespace-bound checkout after the customer chooses to buy. Payment
|
|
73
|
+
fulfillment increases purchased allowance once; your next entitlement read
|
|
74
|
+
clears the warning when funded. Workspaces stopped for billing can then be
|
|
75
|
+
restarted. A top-up does not change the plan's resource caps or grace policy.
|
|
76
|
+
- Paid renewals re-arm warnings and preserve custom notification percentages.
|
|
77
|
+
A top-up or usage refund that lowers usage below a warning band re-arms that
|
|
78
|
+
band for the larger remaining budget. Mode A cycles must still be reset by
|
|
79
|
+
your backend; Mode B cycles renew after verified paid invoices.
|
|
80
|
+
|
|
81
|
+
External email delivery is asynchronous and can repeat after a lost acknowledgment.
|
|
82
|
+
Use a durable notification queue, honor verified recipient preferences, recheck
|
|
83
|
+
organization membership before delivery, and bind billing links to the intended
|
|
84
|
+
organization. Keep a read-only dashboard warning while email is unavailable.
|
|
@@ -29,6 +29,12 @@ Verification: `npm test` passes all 19 SDK tests, including
|
|
|
29
29
|
`tests/http-errors.test.mjs` for legacy 200, current 409, uppercase error-only codes,
|
|
30
30
|
403/500 JSON responses, and successful asynchronous creation.
|
|
31
31
|
|
|
32
|
+
The 2026-09-17 live account/namespace billing canary also verified that a second
|
|
33
|
+
workspace in a namespace capped at one workspace returns HTTP 409 with
|
|
34
|
+
`NAMESPACE_LIMIT_REACHED`, through the SDK. See the API repository's
|
|
35
|
+
`docs/ACCOUNT_WORKSPACE_BILLING_FIX_20260917.md` for that run and the broader
|
|
36
|
+
190-check API regression suite.
|
|
37
|
+
|
|
32
38
|
This report and patch are recorded in the SDK repository for maintainers. No external
|
|
33
39
|
issue or team message has been sent from this environment. The public npm version
|
|
34
40
|
checked during this work is 2.3.0; these SDK changes require the next SDK release.
|