@indigoai-us/hq-cloud 5.1.10 → 5.1.12

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.
@@ -109,6 +109,7 @@ export interface EntityInfo {
109
109
  name?: string;
110
110
  bucketName?: string;
111
111
  status: string;
112
+ createdAt: string;
112
113
  }
113
114
 
114
115
  export interface PendingInviteByEmail {
@@ -343,7 +344,13 @@ export class VaultClient {
343
344
  displayName: string;
344
345
  }): Promise<EntityInfo> {
345
346
  const existing = await this.entity.listByType("person");
346
- if (existing.length > 0) return existing[0];
347
+ const sorted = [...existing].sort((a, b) => {
348
+ const ac = (a.createdAt as string | undefined) ?? "";
349
+ const bc = (b.createdAt as string | undefined) ?? "";
350
+ if (ac !== bc) return ac < bc ? -1 : 1;
351
+ return a.uid < b.uid ? -1 : 1;
352
+ });
353
+ if (sorted.length > 0) return sorted[0];
347
354
 
348
355
  const slug =
349
356
  hints.displayName
@@ -389,6 +396,12 @@ export class VaultClient {
389
396
  const data = await this.post<VendChildResult>("/sts/vend-child", input);
390
397
  return data;
391
398
  },
399
+ vendSelf: async (input: { personUid: string; durationSeconds?: number }): Promise<{
400
+ credentials: { accessKeyId: string; secretAccessKey: string; sessionToken: string };
401
+ expiresAt: string;
402
+ }> => {
403
+ return this.post("/sts/vend-self", input);
404
+ },
392
405
  };
393
406
 
394
407
  // -- HTTP primitives with retry -------------------------------------------