claudemesh-cli 1.0.0-alpha.24 → 1.0.0-alpha.25
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/entrypoints/cli.js +21 -3
- package/dist/entrypoints/cli.js.map +3 -3
- package/package.json +21 -20
- package/LICENSE.md +0 -37
package/dist/entrypoints/cli.js
CHANGED
|
@@ -908,6 +908,24 @@ var init_facade6 = __esm(() => {
|
|
|
908
908
|
});
|
|
909
909
|
|
|
910
910
|
// src/services/invite/generate.ts
|
|
911
|
+
async function generateInvite(meshSlug, opts) {
|
|
912
|
+
const auth = getStoredToken();
|
|
913
|
+
if (!auth)
|
|
914
|
+
throw new Error("Not signed in");
|
|
915
|
+
let userId = "";
|
|
916
|
+
try {
|
|
917
|
+
const payload = JSON.parse(Buffer.from(auth.session_token.split(".")[1], "base64url").toString());
|
|
918
|
+
userId = payload.sub ?? "";
|
|
919
|
+
} catch {}
|
|
920
|
+
if (!userId)
|
|
921
|
+
throw new Error("Invalid token");
|
|
922
|
+
return request({
|
|
923
|
+
path: `/cli/mesh/${meshSlug}/invite`,
|
|
924
|
+
method: "POST",
|
|
925
|
+
body: { user_id: userId, email: opts?.email, role: opts?.role },
|
|
926
|
+
baseUrl: BROKER_HTTP2
|
|
927
|
+
});
|
|
928
|
+
}
|
|
911
929
|
var BROKER_HTTP2;
|
|
912
930
|
var init_generate = __esm(() => {
|
|
913
931
|
init_facade2();
|
|
@@ -4869,7 +4887,7 @@ async function invite(email, opts = {}) {
|
|
|
4869
4887
|
}
|
|
4870
4888
|
}
|
|
4871
4889
|
try {
|
|
4872
|
-
const result = await
|
|
4890
|
+
const result = await generateInvite(meshSlug, {
|
|
4873
4891
|
email,
|
|
4874
4892
|
expires_in: opts.expires ?? "7d",
|
|
4875
4893
|
max_uses: opts.uses,
|
|
@@ -4907,7 +4925,7 @@ async function invite(email, opts = {}) {
|
|
|
4907
4925
|
}
|
|
4908
4926
|
var init_invite = __esm(() => {
|
|
4909
4927
|
init_facade6();
|
|
4910
|
-
|
|
4928
|
+
init_generate();
|
|
4911
4929
|
init_facade5();
|
|
4912
4930
|
init_facade12();
|
|
4913
4931
|
init_styles();
|
|
@@ -10251,4 +10269,4 @@ main().catch((err) => {
|
|
|
10251
10269
|
process.exit(EXIT.INTERNAL_ERROR);
|
|
10252
10270
|
});
|
|
10253
10271
|
|
|
10254
|
-
//# debugId=
|
|
10272
|
+
//# debugId=1610C6DD0978105264756E2164756E21
|