@frostbridge/imdl 0.1.1 → 0.1.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 +9 -7
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1285,6 +1285,8 @@ async function initCommand(options) {
|
|
|
1285
1285
|
const joinData = await joinRes.json();
|
|
1286
1286
|
config.teamId = joinData.teamId;
|
|
1287
1287
|
if (joinData.teamName) config.teamName = joinData.teamName;
|
|
1288
|
+
if (joinData.apiKey) config.authToken = joinData.apiKey;
|
|
1289
|
+
if (joinData.developerId) config.developerId = joinData.developerId;
|
|
1288
1290
|
console.log(pc2.green(` \u2713 Joined team: ${config.teamName || config.teamId}`));
|
|
1289
1291
|
} else {
|
|
1290
1292
|
console.log(pc2.yellow(` \u26A0 Could not validate team token (API returned ${joinRes.status})`));
|
|
@@ -2722,7 +2724,7 @@ async function sendBatch(apiUrl, sessionId, events, developerId) {
|
|
|
2722
2724
|
const config = loadConfig();
|
|
2723
2725
|
const headers = { "Content-Type": "application/json" };
|
|
2724
2726
|
if (config.authToken) {
|
|
2725
|
-
headers["
|
|
2727
|
+
headers["X-IMDL-Key"] = config.authToken;
|
|
2726
2728
|
}
|
|
2727
2729
|
try {
|
|
2728
2730
|
const res = await fetch(`${apiUrl}/api/sessions/${sessionId}/events`, {
|
|
@@ -3535,7 +3537,7 @@ async function collectPrompts() {
|
|
|
3535
3537
|
collected++;
|
|
3536
3538
|
}
|
|
3537
3539
|
const usageHeaders = { "Content-Type": "application/json" };
|
|
3538
|
-
if (config.authToken) usageHeaders["
|
|
3540
|
+
if (config.authToken) usageHeaders["X-IMDL-Key"] = config.authToken;
|
|
3539
3541
|
for (const [sessionId, usage] of usageBySession) {
|
|
3540
3542
|
try {
|
|
3541
3543
|
await fetch(`${config.apiUrl}/api/sessions/${sessionId}/usage`, {
|
|
@@ -3614,7 +3616,7 @@ async function requestCommand(options) {
|
|
|
3614
3616
|
method: "POST",
|
|
3615
3617
|
headers: {
|
|
3616
3618
|
"Content-Type": "application/json",
|
|
3617
|
-
...config.authToken ? { "
|
|
3619
|
+
...config.authToken ? { "X-IMDL-Key": config.authToken } : {}
|
|
3618
3620
|
},
|
|
3619
3621
|
body: JSON.stringify({
|
|
3620
3622
|
serverName: options.server,
|
|
@@ -4131,7 +4133,7 @@ async function reportPermissions(report) {
|
|
|
4131
4133
|
method: "POST",
|
|
4132
4134
|
headers: {
|
|
4133
4135
|
"Content-Type": "application/json",
|
|
4134
|
-
"
|
|
4136
|
+
"X-IMDL-Key": config.authToken
|
|
4135
4137
|
},
|
|
4136
4138
|
body: JSON.stringify(report)
|
|
4137
4139
|
});
|
|
@@ -4149,7 +4151,7 @@ async function checkCompliance(developerId) {
|
|
|
4149
4151
|
try {
|
|
4150
4152
|
const res = await fetch(`${config.apiUrl}/api/permissions/check?developerId=${encodeURIComponent(developerId)}`, {
|
|
4151
4153
|
headers: {
|
|
4152
|
-
"
|
|
4154
|
+
"X-IMDL-Key": config.authToken
|
|
4153
4155
|
}
|
|
4154
4156
|
});
|
|
4155
4157
|
if (!res.ok) return { ok: false };
|
|
@@ -4440,7 +4442,7 @@ async function permissionsToggleCommand(enable) {
|
|
|
4440
4442
|
method: "POST",
|
|
4441
4443
|
headers: {
|
|
4442
4444
|
"Content-Type": "application/json",
|
|
4443
|
-
"
|
|
4445
|
+
"X-IMDL-Key": config.authToken
|
|
4444
4446
|
},
|
|
4445
4447
|
body: JSON.stringify({
|
|
4446
4448
|
developerId: config.developerId,
|
|
@@ -5252,7 +5254,7 @@ async function trySyncPolicies() {
|
|
|
5252
5254
|
const config = loadConfig();
|
|
5253
5255
|
const authHeaders = {};
|
|
5254
5256
|
if (config.authToken) {
|
|
5255
|
-
authHeaders["
|
|
5257
|
+
authHeaders["X-IMDL-Key"] = config.authToken;
|
|
5256
5258
|
}
|
|
5257
5259
|
try {
|
|
5258
5260
|
const controller = new AbortController();
|