@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.
Files changed (30) hide show
  1. package/dist/auth/auth-manager.d.ts +8 -0
  2. package/dist/auth/auth-manager.d.ts.map +1 -1
  3. package/dist/builtins/local-auth/local-auth.addon.d.ts.map +1 -1
  4. package/dist/builtins/local-auth/local-auth.addon.js +26 -5
  5. package/dist/builtins/local-auth/local-auth.addon.js.map +1 -1
  6. package/dist/builtins/local-auth/local-auth.addon.mjs +26 -5
  7. package/dist/builtins/local-auth/local-auth.addon.mjs.map +1 -1
  8. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.d.ts.map +1 -1
  9. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.js +32 -1
  10. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.js.map +1 -1
  11. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.mjs +32 -1
  12. package/dist/builtins/mesh-orchestrator/mesh-orchestrator.addon.mjs.map +1 -1
  13. package/dist/builtins/platform-probe/hardware-encoder-probe.d.ts +14 -0
  14. package/dist/builtins/platform-probe/hardware-encoder-probe.d.ts.map +1 -0
  15. package/dist/builtins/platform-probe/index.d.ts +2 -0
  16. package/dist/builtins/platform-probe/index.d.ts.map +1 -1
  17. package/dist/builtins/platform-probe/index.js +198 -5
  18. package/dist/builtins/platform-probe/index.js.map +1 -1
  19. package/dist/builtins/platform-probe/index.mjs +198 -6
  20. package/dist/builtins/platform-probe/index.mjs.map +1 -1
  21. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.d.ts.map +1 -1
  22. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js +16 -0
  23. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.js.map +1 -1
  24. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs +16 -0
  25. package/dist/builtins/remote-access-orchestrator/remote-access-orchestrator.addon.mjs.map +1 -1
  26. package/dist/index.js +373 -181
  27. package/dist/index.js.map +1 -1
  28. package/dist/index.mjs +373 -181
  29. package/dist/index.mjs.map +1 -1
  30. package/package.json +1 -1
@@ -82,6 +82,14 @@ export interface SsoBridgeClaims {
82
82
  readonly provider: string;
83
83
  readonly email?: string;
84
84
  readonly displayName?: string;
85
+ /**
86
+ * Public HTTPS URL of the hub that minted the token. Carried verbatim
87
+ * through sign/verify; consumed by cloud-mode OAuth proxies (e.g. the
88
+ * Alexa Lambda) which need to know which hub to forward to without
89
+ * keeping per-user routing state. Optional — only the cloud-mode
90
+ * issuers set it.
91
+ */
92
+ readonly hubUrl?: string;
85
93
  }
86
94
  export interface TotpChallengeClaims {
87
95
  readonly userId: string;
@@ -1 +1 @@
1
- {"version":3,"file":"auth-manager.d.ts","sourceRoot":"","sources":["../../src/auth/auth-manager.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAA;AAYlE,YAAY,EAAE,YAAY,EAAE,CAAA;AAE5B,MAAM,MAAM,gBAAgB,GAAG;IAC7B,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,CAAC,CAAA;IACvB,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAA;CAC7D,CAAA;AAED,qBAAa,WAAW;IAIV,OAAO,CAAC,QAAQ,CAAC,MAAM;IAHnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAQ;IAClC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAe;gBAET,MAAM,EAAE,gBAAgB,EAAE,MAAM,GAAE,aAA0B;IAczF,SAAS,CAAC,OAAO,EAAE,IAAI,CAAC,YAAY,EAAE,KAAK,GAAG,KAAK,CAAC,GAAG,MAAM;IAI7D,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,YAAY;IAIl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c,CAAA"}
@@ -6242,7 +6242,8 @@ var AuthManager = class {
6242
6242
  isAdmin: payload.isAdmin,
6243
6243
  provider: payload.provider,
6244
6244
  ...payload.email !== void 0 ? { email: payload.email } : {},
6245
- ...payload.displayName !== void 0 ? { displayName: payload.displayName } : {}
6245
+ ...payload.displayName !== void 0 ? { displayName: payload.displayName } : {},
6246
+ ...payload.hubUrl !== void 0 ? { hubUrl: payload.hubUrl } : {}
6246
6247
  };
6247
6248
  return import_jsonwebtoken.sign(body, this.jwtSecret, { expiresIn: ttlSec });
6248
6249
  }
@@ -6263,13 +6264,15 @@ var AuthManager = class {
6263
6264
  if (typeof userId !== "string" || typeof username !== "string" || typeof isAdmin !== "boolean" || typeof provider !== "string") return null;
6264
6265
  const email = typeof decoded["email"] === "string" ? decoded["email"] : void 0;
6265
6266
  const displayName = typeof decoded["displayName"] === "string" ? decoded["displayName"] : void 0;
6267
+ const hubUrl = typeof decoded["hubUrl"] === "string" ? decoded["hubUrl"] : void 0;
6266
6268
  return {
6267
6269
  userId,
6268
6270
  username,
6269
6271
  isAdmin,
6270
6272
  provider,
6271
6273
  ...email !== void 0 ? { email } : {},
6272
- ...displayName !== void 0 ? { displayName } : {}
6274
+ ...displayName !== void 0 ? { displayName } : {},
6275
+ ...hubUrl !== void 0 ? { hubUrl } : {}
6273
6276
  };
6274
6277
  } catch {
6275
6278
  return null;
@@ -7780,12 +7783,24 @@ var LocalAuthAddon = class extends _camstack_types.BaseAddon {
7780
7783
  const userMgmt = {
7781
7784
  listUsers: async () => {
7782
7785
  if (!this.userManager) return [];
7783
- return this.userManager.listAll();
7786
+ const users = await this.userManager.listAll();
7787
+ if (!this.totpManager) return users.map((u) => ({
7788
+ ...u,
7789
+ totpEnabled: false
7790
+ }));
7791
+ const statuses = await Promise.all(users.map((u) => this.totpManager.getStatus(u.id).catch(() => ({ enabled: false }))));
7792
+ return users.map((u, i) => ({
7793
+ ...u,
7794
+ totpEnabled: statuses[i]?.enabled ?? false
7795
+ }));
7784
7796
  },
7785
7797
  createUser: async (input) => {
7786
7798
  if (!this.userManager) throw new Error("User management not available");
7787
7799
  const { passwordHash: _, ...summary } = await this.userManager.create(input);
7788
- return summary;
7800
+ return {
7801
+ ...summary,
7802
+ totpEnabled: false
7803
+ };
7789
7804
  },
7790
7805
  updateUser: async (input) => {
7791
7806
  if (!this.userManager) throw new Error("User management not available");
@@ -7810,7 +7825,13 @@ var LocalAuthAddon = class extends _camstack_types.BaseAddon {
7810
7825
  },
7811
7826
  validateCredentials: async (input) => {
7812
7827
  if (!this.userManager) return null;
7813
- return await this.userManager.validateCredentials(input.username, input.password) ?? null;
7828
+ const user = await this.userManager.validateCredentials(input.username, input.password);
7829
+ if (!user) return null;
7830
+ const totpEnabled = this.totpManager ? (await this.totpManager.getStatus(user.id).catch(() => ({ enabled: false }))).enabled : false;
7831
+ return {
7832
+ ...user,
7833
+ totpEnabled
7834
+ };
7814
7835
  },
7815
7836
  listApiKeys: async () => {
7816
7837
  if (!this.apiKeyManager) return [];