@hcmai/sdk 0.4.1 → 0.4.2
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/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -5211,9 +5211,11 @@ async function bootstrapTenant(http, bootstrapKey, req) {
|
|
|
5211
5211
|
// src/meta/tenant-meta.ts
|
|
5212
5212
|
async function listTenantMeta(http, opts = {}) {
|
|
5213
5213
|
const resp = await http.get("/api/tenant-meta/list", { params: opts });
|
|
5214
|
-
const
|
|
5215
|
-
const
|
|
5216
|
-
|
|
5214
|
+
const body = resp.data;
|
|
5215
|
+
const payload = body?.data ?? body;
|
|
5216
|
+
const items = Array.isArray(payload) ? payload : payload?.items ?? payload?.list ?? payload?.records ?? [];
|
|
5217
|
+
const total = typeof body?.total === "number" ? body.total : payload?.total;
|
|
5218
|
+
return { items, total, raw: payload };
|
|
5217
5219
|
}
|
|
5218
5220
|
async function getTenantMeta(http, path24) {
|
|
5219
5221
|
const resp = await http.get("/api/tenant-meta/meta", { params: { path: path24 } });
|