@myapihq/sdk 2.25.1 → 2.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/hq.d.ts CHANGED
@@ -135,7 +135,18 @@ export declare function confirmOrgImport(apiKey: string, jobId: string, override
135
135
  export declare function listOrgs(apiKey: string): Promise<Org[]>;
136
136
  export declare function getOrg(apiKey: string, orgId: string): Promise<Org>;
137
137
  export declare function updateOrg(apiKey: string, orgId: string, payload: Partial<OrgPayload>): Promise<Org>;
138
- export declare function deleteOrg(apiKey: string, orgId: string): Promise<void>;
138
+ /**
139
+ * Deletes an org. Hard delete, cascading 36 tables, no undo.
140
+ *
141
+ * An org that still owns anything is refused with CONFIRM_REQUIRED unless
142
+ * `confirm` is set, which sends `?confirm=<org_id>` — the API's way of making
143
+ * the caller name what it is destroying. Creating an org provisions a funnel,
144
+ * so in practice every org is non-empty from birth and this is not an edge
145
+ * case: without it, `deleteOrg` cannot delete anything.
146
+ */
147
+ export declare function deleteOrg(apiKey: string, orgId: string, opts?: {
148
+ confirm?: boolean;
149
+ }): Promise<void>;
139
150
  export declare function getBalance(apiKey: string): Promise<{
140
151
  balance_display: string;
141
152
  credits_display: string;
package/dist/hq.js CHANGED
@@ -168,8 +168,18 @@ async function getOrg(apiKey, orgId) {
168
168
  async function updateOrg(apiKey, orgId, payload) {
169
169
  return (0, client_1.request)('PATCH', `${config_1.HQ_BASE}/hq/orgs/${encodeURIComponent(orgId)}`, apiKey, payload);
170
170
  }
171
- async function deleteOrg(apiKey, orgId) {
172
- return (0, client_1.request)('DELETE', `${config_1.HQ_BASE}/hq/orgs/${encodeURIComponent(orgId)}`, apiKey);
171
+ /**
172
+ * Deletes an org. Hard delete, cascading 36 tables, no undo.
173
+ *
174
+ * An org that still owns anything is refused with CONFIRM_REQUIRED unless
175
+ * `confirm` is set, which sends `?confirm=<org_id>` — the API's way of making
176
+ * the caller name what it is destroying. Creating an org provisions a funnel,
177
+ * so in practice every org is non-empty from birth and this is not an edge
178
+ * case: without it, `deleteOrg` cannot delete anything.
179
+ */
180
+ async function deleteOrg(apiKey, orgId, opts) {
181
+ const q = opts?.confirm ? `?confirm=${encodeURIComponent(orgId)}` : '';
182
+ return (0, client_1.request)('DELETE', `${config_1.HQ_BASE}/hq/orgs/${encodeURIComponent(orgId)}${q}`, apiKey);
173
183
  }
174
184
  async function getBalance(apiKey) {
175
185
  return (0, client_1.request)('GET', `${config_1.HQ_BASE}/hq/billing/balance`, apiKey);
package/dist/version.d.ts CHANGED
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "2.25.1";
1
+ export declare const SDK_VERSION = "2.26.0";
package/dist/version.js CHANGED
@@ -8,4 +8,4 @@ exports.SDK_VERSION = void 0;
8
8
  // Why a constant and not a package.json read: the SDK runs inside edge
9
9
  // functions (Cloudflare Workers), so it must not import node:fs. A literal
10
10
  // is the only version source that works in every runtime we ship to.
11
- exports.SDK_VERSION = '2.25.1';
11
+ exports.SDK_VERSION = '2.26.0';
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@myapihq/sdk",
3
3
  "license": "Apache-2.0",
4
- "version": "2.25.1",
4
+ "version": "2.26.0",
5
5
  "description": "TypeScript SDK for the MyAPI ecosystem",
6
6
  "repository": {
7
7
  "type": "git",