@indigoai-us/hq-cli 5.6.1 → 5.6.3

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.
@@ -25,7 +25,7 @@
25
25
  * `initial_sync.ok=false`). Manifest + config may have been written.
26
26
  */
27
27
 
28
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="325d7bbf-c44d-5bba-a156-072302ab1536")}catch(e){}}();
28
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="aacb5bf2-8362-5336-b864-43296c30a1d6")}catch(e){}}();
29
29
  import chalk from "chalk";
30
30
  import * as fs from "node:fs";
31
31
  import * as path from "node:path";
@@ -180,7 +180,7 @@ export function createDefaultVaultClient(apiUrl, accessToken) {
180
180
  };
181
181
  return {
182
182
  async findCompanyBySlug(slug) {
183
- const url = `${apiUrl.replace(/\/$/, "")}/v1/entities/by-slug/company/${encodeURIComponent(slug)}`;
183
+ const url = `${apiUrl.replace(/\/$/, "")}/entity/by-slug/company/${encodeURIComponent(slug)}`;
184
184
  const res = await fetch(url, { method: "GET", headers });
185
185
  if (res.status === 404)
186
186
  return null;
@@ -195,7 +195,7 @@ export function createDefaultVaultClient(apiUrl, accessToken) {
195
195
  return data.entity;
196
196
  },
197
197
  async createCompanyEntity(input) {
198
- const url = `${apiUrl.replace(/\/$/, "")}/v1/entities`;
198
+ const url = `${apiUrl.replace(/\/$/, "")}/entity`;
199
199
  const body = {
200
200
  type: "company",
201
201
  slug: input.slug,
@@ -213,11 +213,11 @@ export function createDefaultVaultClient(apiUrl, accessToken) {
213
213
  // 409 means a concurrent client created it between our GET and POST —
214
214
  // surface it as a vault error. The orchestrator is responsible for
215
215
  // retrying GET if it wants idempotency on collisions.
216
- throw new ProvisionError(1, `Vault POST /v1/entities failed: ${res.status} ${res.statusText} — ${text}`);
216
+ throw new ProvisionError(1, `Vault POST /entity failed: ${res.status} ${res.statusText} — ${text}`);
217
217
  }
218
218
  const data = (await res.json());
219
219
  if (!data.entity) {
220
- throw new ProvisionError(1, `Vault POST /v1/entities returned ${res.status} with no entity body`);
220
+ throw new ProvisionError(1, `Vault POST /entity returned ${res.status} with no entity body`);
221
221
  }
222
222
  return data.entity;
223
223
  },
@@ -426,4 +426,4 @@ export function registerCloudProvisionCommands(program) {
426
426
  });
427
427
  }
428
428
  //# sourceMappingURL=cloud-provision.js.map
429
- //# debugId=325d7bbf-c44d-5bba-a156-072302ab1536
429
+ //# debugId=aacb5bf2-8362-5336-b864-43296c30a1d6
@@ -19,7 +19,7 @@
19
19
  * HQ_VAULT_API_URL — vault-service API Gateway URL
20
20
  */
21
21
 
22
- !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="5a05b8ed-8366-55d1-8a6a-5d145646e527")}catch(e){}}();
22
+ !function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="147a783f-029d-547f-ba36-a1dbf8ed0f65")}catch(e){}}();
23
23
  import * as os from "os";
24
24
  import * as path from "path";
25
25
  import chalk from "chalk";
@@ -31,6 +31,14 @@ export const DEFAULT_COGNITO = {
31
31
  port: process.env.HQ_COGNITO_CALLBACK_PORT
32
32
  ? Number(process.env.HQ_COGNITO_CALLBACK_PORT)
33
33
  : 8765,
34
+ // Skip Cognito's Hosted UI — go straight to Google OAuth. The Cognito
35
+ // /oauth2/authorize endpoint honors `identity_provider` and performs an
36
+ // internal redirect, so the user never sees the (un-styleable) Hosted UI.
37
+ // Set HQ_COGNITO_IDENTITY_PROVIDER="" to fall back to the IdP picker for
38
+ // accounts that use email+password (admin-created users without Google).
39
+ identityProvider: process.env.HQ_COGNITO_IDENTITY_PROVIDER !== undefined
40
+ ? process.env.HQ_COGNITO_IDENTITY_PROVIDER || undefined
41
+ : "Google",
34
42
  };
35
43
  export const DEFAULT_VAULT_API_URL = process.env.HQ_VAULT_API_URL ??
36
44
  "https://4nfy67z28h.execute-api.us-east-1.amazonaws.com";
@@ -101,4 +109,4 @@ export async function refreshCachedSession() {
101
109
  }
102
110
  }
103
111
  //# sourceMappingURL=cognito-session.js.map
104
- //# debugId=5a05b8ed-8366-55d1-8a6a-5d145646e527
112
+ //# debugId=147a783f-029d-547f-ba36-a1dbf8ed0f65
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cli",
3
- "version": "5.6.1",
3
+ "version": "5.6.3",
4
4
  "description": "HQ by Indigo management CLI — modules and cloud sync",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -374,7 +374,7 @@ describe("createDefaultVaultClient", () => {
374
374
  expect(out).toEqual(entity);
375
375
  // Verify request shape
376
376
  const call = fetchSpy.mock.calls[0];
377
- expect(call[0]).toBe(`${apiUrl}/v1/entities`);
377
+ expect(call[0]).toBe(`${apiUrl}/entity`);
378
378
  expect((call[1] as RequestInit)?.method).toBe("POST");
379
379
  const body = JSON.parse(((call[1] as RequestInit)?.body as string) ?? "{}");
380
380
  expect(body).toEqual({ type: "company", slug: "indigo", name: "Indigo" });
@@ -346,7 +346,7 @@ export function createDefaultVaultClient(
346
346
  };
347
347
  return {
348
348
  async findCompanyBySlug(slug: string): Promise<VaultEntity | null> {
349
- const url = `${apiUrl.replace(/\/$/, "")}/v1/entities/by-slug/company/${encodeURIComponent(
349
+ const url = `${apiUrl.replace(/\/$/, "")}/entity/by-slug/company/${encodeURIComponent(
350
350
  slug,
351
351
  )}`;
352
352
  const res = await fetch(url, { method: "GET", headers });
@@ -372,7 +372,7 @@ export function createDefaultVaultClient(
372
372
  name: string;
373
373
  ownerUid?: string;
374
374
  }): Promise<VaultEntity> {
375
- const url = `${apiUrl.replace(/\/$/, "")}/v1/entities`;
375
+ const url = `${apiUrl.replace(/\/$/, "")}/entity`;
376
376
  const body: Record<string, unknown> = {
377
377
  type: "company",
378
378
  slug: input.slug,
@@ -391,14 +391,14 @@ export function createDefaultVaultClient(
391
391
  // retrying GET if it wants idempotency on collisions.
392
392
  throw new ProvisionError(
393
393
  1,
394
- `Vault POST /v1/entities failed: ${res.status} ${res.statusText} — ${text}`,
394
+ `Vault POST /entity failed: ${res.status} ${res.statusText} — ${text}`,
395
395
  );
396
396
  }
397
397
  const data = (await res.json()) as { entity?: VaultEntity };
398
398
  if (!data.entity) {
399
399
  throw new ProvisionError(
400
400
  1,
401
- `Vault POST /v1/entities returned ${res.status} with no entity body`,
401
+ `Vault POST /entity returned ${res.status} with no entity body`,
402
402
  );
403
403
  }
404
404
  return data.entity;
@@ -38,6 +38,15 @@ export const DEFAULT_COGNITO: CognitoAuthConfig = {
38
38
  port: process.env.HQ_COGNITO_CALLBACK_PORT
39
39
  ? Number(process.env.HQ_COGNITO_CALLBACK_PORT)
40
40
  : 8765,
41
+ // Skip Cognito's Hosted UI — go straight to Google OAuth. The Cognito
42
+ // /oauth2/authorize endpoint honors `identity_provider` and performs an
43
+ // internal redirect, so the user never sees the (un-styleable) Hosted UI.
44
+ // Set HQ_COGNITO_IDENTITY_PROVIDER="" to fall back to the IdP picker for
45
+ // accounts that use email+password (admin-created users without Google).
46
+ identityProvider:
47
+ process.env.HQ_COGNITO_IDENTITY_PROVIDER !== undefined
48
+ ? process.env.HQ_COGNITO_IDENTITY_PROVIDER || undefined
49
+ : "Google",
41
50
  };
42
51
 
43
52
  export const DEFAULT_VAULT_API_URL =