@flashbacktech/tsclient 0.4.56 → 0.4.58
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.cjs +29 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +50 -1
- package/dist/index.d.ts +50 -1
- package/dist/index.js +29 -0
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -300,6 +300,18 @@ var OrganizationClient = class {
|
|
|
300
300
|
const res = await this.http.get("/orgs/list-all");
|
|
301
301
|
return res.data ?? [];
|
|
302
302
|
}
|
|
303
|
+
/**
|
|
304
|
+
* Platform-admin only: typeahead org search. Returns up to `limit` matches
|
|
305
|
+
* (id+name) for the case-insensitive name substring `q` (or the first
|
|
306
|
+
* `limit` orgs when `q` is empty) plus the total match count, so a picker
|
|
307
|
+
* can show "N more — refine your search". Returns 403 unless platform admin.
|
|
308
|
+
*/
|
|
309
|
+
async searchOrgs(q = "", limit = 10) {
|
|
310
|
+
const res = await this.http.get("/orgs/search", {
|
|
311
|
+
query: { q, limit }
|
|
312
|
+
});
|
|
313
|
+
return unwrapData(res);
|
|
314
|
+
}
|
|
303
315
|
/**
|
|
304
316
|
* Platform-admin only: provision a new organization + founding owner and
|
|
305
317
|
* email the owner an invite link. The invite-only counterpart to public
|
|
@@ -1284,6 +1296,23 @@ var ReferralsClient = class {
|
|
|
1284
1296
|
);
|
|
1285
1297
|
return unwrapData(res);
|
|
1286
1298
|
}
|
|
1299
|
+
// --- Platform-admin only ---
|
|
1300
|
+
/**
|
|
1301
|
+
* Platform-wide referral monitor: rollup stats + every redemption (with the
|
|
1302
|
+
* code string and both org names). Returns 403 unless platform admin.
|
|
1303
|
+
*/
|
|
1304
|
+
async adminOverview() {
|
|
1305
|
+
const res = await this.http.get("/admin/referrals");
|
|
1306
|
+
return unwrapData(res);
|
|
1307
|
+
}
|
|
1308
|
+
/**
|
|
1309
|
+
* Void a PENDING redemption (abuse control) so it can never qualify. Fails
|
|
1310
|
+
* with 409 `not_pending` if the redemption is missing, already qualified, or
|
|
1311
|
+
* already void. Platform-admin only.
|
|
1312
|
+
*/
|
|
1313
|
+
async voidRedemption(redemptionId) {
|
|
1314
|
+
await this.http.post(`/admin/referrals/${redemptionId}/void`, { body: {} });
|
|
1315
|
+
}
|
|
1287
1316
|
};
|
|
1288
1317
|
|
|
1289
1318
|
// src/modules/reseller/ResellerClient.ts
|