@camstack/core 0.1.34 → 0.1.36
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/auth/auth-manager.d.ts +8 -0
- package/dist/auth/auth-manager.d.ts.map +1 -1
- package/dist/builtins/local-auth/local-auth.addon.d.ts.map +1 -1
- package/dist/builtins/local-auth/local-auth.addon.js +26 -5
- package/dist/builtins/local-auth/local-auth.addon.js.map +1 -1
- package/dist/builtins/local-auth/local-auth.addon.mjs +26 -5
- package/dist/builtins/local-auth/local-auth.addon.mjs.map +1 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.d.ts.map +1 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.js +32 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.js.map +1 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.mjs +32 -1
- package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.mjs.map +1 -1
- package/dist/builtins/platform-probe/hardware-encoder-probe.d.ts +14 -0
- package/dist/builtins/platform-probe/hardware-encoder-probe.d.ts.map +1 -0
- package/dist/builtins/platform-probe/index.d.ts +2 -0
- package/dist/builtins/platform-probe/index.d.ts.map +1 -1
- package/dist/builtins/platform-probe/index.js +198 -5
- package/dist/builtins/platform-probe/index.js.map +1 -1
- package/dist/builtins/platform-probe/index.mjs +198 -6
- package/dist/builtins/platform-probe/index.mjs.map +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.d.ts.map +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +16 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js.map +1 -1
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +16 -0
- package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs.map +1 -1
- package/dist/index.js +373 -181
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +373 -181
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -6237,7 +6237,8 @@ var AuthManager = class {
|
|
|
6237
6237
|
isAdmin: payload.isAdmin,
|
|
6238
6238
|
provider: payload.provider,
|
|
6239
6239
|
...payload.email !== void 0 ? { email: payload.email } : {},
|
|
6240
|
-
...payload.displayName !== void 0 ? { displayName: payload.displayName } : {}
|
|
6240
|
+
...payload.displayName !== void 0 ? { displayName: payload.displayName } : {},
|
|
6241
|
+
...payload.hubUrl !== void 0 ? { hubUrl: payload.hubUrl } : {}
|
|
6241
6242
|
};
|
|
6242
6243
|
return import_jsonwebtoken.sign(body, this.jwtSecret, { expiresIn: ttlSec });
|
|
6243
6244
|
}
|
|
@@ -6258,13 +6259,15 @@ var AuthManager = class {
|
|
|
6258
6259
|
if (typeof userId !== "string" || typeof username !== "string" || typeof isAdmin !== "boolean" || typeof provider !== "string") return null;
|
|
6259
6260
|
const email = typeof decoded["email"] === "string" ? decoded["email"] : void 0;
|
|
6260
6261
|
const displayName = typeof decoded["displayName"] === "string" ? decoded["displayName"] : void 0;
|
|
6262
|
+
const hubUrl = typeof decoded["hubUrl"] === "string" ? decoded["hubUrl"] : void 0;
|
|
6261
6263
|
return {
|
|
6262
6264
|
userId,
|
|
6263
6265
|
username,
|
|
6264
6266
|
isAdmin,
|
|
6265
6267
|
provider,
|
|
6266
6268
|
...email !== void 0 ? { email } : {},
|
|
6267
|
-
...displayName !== void 0 ? { displayName } : {}
|
|
6269
|
+
...displayName !== void 0 ? { displayName } : {},
|
|
6270
|
+
...hubUrl !== void 0 ? { hubUrl } : {}
|
|
6268
6271
|
};
|
|
6269
6272
|
} catch {
|
|
6270
6273
|
return null;
|
|
@@ -7775,12 +7778,24 @@ var LocalAuthAddon = class extends BaseAddon {
|
|
|
7775
7778
|
const userMgmt = {
|
|
7776
7779
|
listUsers: async () => {
|
|
7777
7780
|
if (!this.userManager) return [];
|
|
7778
|
-
|
|
7781
|
+
const users = await this.userManager.listAll();
|
|
7782
|
+
if (!this.totpManager) return users.map((u) => ({
|
|
7783
|
+
...u,
|
|
7784
|
+
totpEnabled: false
|
|
7785
|
+
}));
|
|
7786
|
+
const statuses = await Promise.all(users.map((u) => this.totpManager.getStatus(u.id).catch(() => ({ enabled: false }))));
|
|
7787
|
+
return users.map((u, i) => ({
|
|
7788
|
+
...u,
|
|
7789
|
+
totpEnabled: statuses[i]?.enabled ?? false
|
|
7790
|
+
}));
|
|
7779
7791
|
},
|
|
7780
7792
|
createUser: async (input) => {
|
|
7781
7793
|
if (!this.userManager) throw new Error("User management not available");
|
|
7782
7794
|
const { passwordHash: _, ...summary } = await this.userManager.create(input);
|
|
7783
|
-
return
|
|
7795
|
+
return {
|
|
7796
|
+
...summary,
|
|
7797
|
+
totpEnabled: false
|
|
7798
|
+
};
|
|
7784
7799
|
},
|
|
7785
7800
|
updateUser: async (input) => {
|
|
7786
7801
|
if (!this.userManager) throw new Error("User management not available");
|
|
@@ -7805,7 +7820,13 @@ var LocalAuthAddon = class extends BaseAddon {
|
|
|
7805
7820
|
},
|
|
7806
7821
|
validateCredentials: async (input) => {
|
|
7807
7822
|
if (!this.userManager) return null;
|
|
7808
|
-
|
|
7823
|
+
const user = await this.userManager.validateCredentials(input.username, input.password);
|
|
7824
|
+
if (!user) return null;
|
|
7825
|
+
const totpEnabled = this.totpManager ? (await this.totpManager.getStatus(user.id).catch(() => ({ enabled: false }))).enabled : false;
|
|
7826
|
+
return {
|
|
7827
|
+
...user,
|
|
7828
|
+
totpEnabled
|
|
7829
|
+
};
|
|
7809
7830
|
},
|
|
7810
7831
|
listApiKeys: async () => {
|
|
7811
7832
|
if (!this.apiKeyManager) return [];
|