@qaecy/cue-sdk 0.0.52 → 0.0.53

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/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { B as C, C as u, a as i, b as r, c as o, d as t, e as S, f as n, g as c, h as E, i as m, j as p, k as A, l, m as P, n as R, o as _, p as I, q as d, r as g, s as T, t as D, u as O, v as N, w as U, x as G, y as h, z as f, A as j, D as v, E as x, F as M, G as y, H as B, I as F, J as L, K as H, L as b, M as K, N as q, O as w, P as Q, Q as V, R as W, S as X, T as Y, U as k, V as z, W as J, X as Z, Y as $, Z as ee, _ as ae, $ as se, a0 as Ce, a1 as ue, a2 as ie, a3 as re } from "./document-filter-BuFNMQwr.js";
1
+ import { B as C, C as u, a as i, b as r, c as o, d as t, e as S, f as n, g as c, h as E, i as m, j as p, k as A, l, m as P, n as R, o as _, p as I, q as d, r as g, s as T, t as D, u as O, v as N, w as U, x as G, y as h, z as f, A as j, D as v, E as x, F as M, G as y, H as B, I as F, J as L, K as H, L as b, M as K, N as q, O as w, P as Q, Q as V, R as W, S as X, T as Y, U as k, V as z, W as J, X as Z, Y as $, Z as ee, _ as ae, $ as se, a0 as Ce, a1 as ue, a2 as ie, a3 as re } from "./document-filter-CBrY09DH.js";
2
2
  import "uuid";
3
3
  export {
4
4
  C as BASE_CURRENCY,
package/lib/auth.d.ts CHANGED
@@ -12,6 +12,7 @@ export declare class CueAuth {
12
12
  private readonly _isSuperAdminSignal;
13
13
  private readonly _userIdsSignal;
14
14
  private readonly _stopTokenListener;
15
+ private _ssoPending;
15
16
  /** Reactive auth state — emits the signed-in `User`, or `null` when signed out. */
16
17
  readonly user: ReadonlySignal<User | null>;
17
18
  /** Reactive Firebase ID token — refreshes automatically; `null` when signed out. */
@@ -21,6 +22,7 @@ export declare class CueAuth {
21
22
  /** All unique UIDs for the current user (Firebase UID + linked provider UIDs). */
22
23
  readonly userIds: ReadonlySignal<string[]>;
23
24
  constructor(app: FirebaseApp, useEmulator: boolean | undefined, endpoints: CueEndpoints);
25
+ private _publish;
24
26
  /** Stop all internal Firebase listeners. Call when the `Cue` instance is no longer needed. */
25
27
  destroy(): void;
26
28
  /** Sign in with Google or Microsoft via browser popup */
@@ -39,6 +41,13 @@ export declare class CueAuth {
39
41
  * Call this once on app startup before showing a sign-in UI.
40
42
  */
41
43
  checkRedirectResult(): Promise<User | null>;
44
+ /**
45
+ * SSO may sign in to an existing account but never create one. Firebase
46
+ * creates the account before we can object, so the backend checks it
47
+ * afterwards and deletes it if it is a fresh sign-up; we sign out and throw.
48
+ * Fails closed: if the check cannot be made, the session is dropped.
49
+ */
50
+ private _confirmSsoSignIn;
42
51
  /**
43
52
  * One-shot async check — returns `true` if the current user has the
44
53
  * `superadmin` custom claim. For reactive use, read `cue.auth.isSuperAdmin`
package/lib/models.d.ts CHANGED
@@ -12,10 +12,6 @@ export interface CueEndpoints {
12
12
  storageEmulatorHost: string;
13
13
  /** Firebase Storage emulator port (emulator mode only, default: 9199) */
14
14
  storageEmulatorPort: number;
15
- /** Firebase Firestore emulator hostname, no protocol (emulator mode only, default: 'localhost') */
16
- firestoreEmulatorHost: string;
17
- /** Firebase Firestore emulator port (emulator mode only, default: 8080) */
18
- firestoreEmulatorPort: number;
19
15
  }
20
16
  export interface CueSdkConfig {
21
17
  /** Firebase API key for this project. Defaults to the QAECY demo app if omitted. */
package/lib/profile.d.ts CHANGED
@@ -1,12 +1,10 @@
1
1
  import { UserInfo } from 'firebase/auth';
2
- import { FirebaseApp } from 'firebase/app';
3
2
  import { APIKeyDoc, APIKeyInfo, FileTypeBreakdownDto, OrgConsumptionReportDto, OrgCreditsDto, OrgMember, OrganizationData, ProfileSSOAccount, TrafficReportDto, UsageReportDto } from './models';
4
3
  import { CueAuth } from './auth';
5
4
  import { ReadonlySignal } from './signal';
6
5
  export declare class CueProfile {
7
6
  private readonly _auth;
8
7
  private readonly _gatewayUrl;
9
- private readonly _functions;
10
8
  private readonly _orgCredits;
11
9
  /**
12
10
  * Reactive view of the last-fetched org credit pool. Updated automatically
@@ -17,7 +15,7 @@ export declare class CueProfile {
17
15
  * `effect(() => sig.set(cue.profile.orgCredits.get()))` + `.subscribe(...)`.
18
16
  */
19
17
  readonly orgCredits: ReadonlySignal<OrgCreditsDto | undefined>;
20
- constructor(_auth: CueAuth, app: FirebaseApp, useEmulator: boolean, _gatewayUrl: string);
18
+ constructor(_auth: CueAuth, _gatewayUrl: string);
21
19
  private _url;
22
20
  private _fetch;
23
21
  /** Whether the current user has an active API key. */
package/lib/project.d.ts CHANGED
@@ -1,4 +1,3 @@
1
- import { FirebaseApp } from 'firebase/app';
2
1
  import { CueAuth } from './auth';
3
2
  import { CreateProjectOptions, CueEndpoints, ProjectData, ProjectMetadata } from './models';
4
3
  import { ReadonlySignal } from './signal';
@@ -12,7 +11,6 @@ export interface ProjectUpdate {
12
11
  }
13
12
  export declare class CueProjects {
14
13
  private readonly _auth;
15
- private readonly _db;
16
14
  private readonly _gatewayUrl;
17
15
  private readonly _projects;
18
16
  /**
@@ -21,7 +19,7 @@ export declare class CueProjects {
21
19
  * without every caller having to remember to re-fetch the whole list.
22
20
  */
23
21
  readonly projects: ReadonlySignal<ProjectData[] | undefined>;
24
- constructor(_auth: CueAuth, app: FirebaseApp, useEmulator?: boolean, endpoints?: CueEndpoints);
22
+ constructor(_auth: CueAuth, endpoints?: CueEndpoints);
25
23
  /**
26
24
  * Create a new project. The authenticated user is automatically set as admin, syncer, and member.
27
25
  * Throws if a project with the given ID already exists.
@@ -38,11 +36,6 @@ export declare class CueProjects {
38
36
  * single project look like the user's entire project set.
39
37
  */
40
38
  private _patchProject;
41
- /**
42
- * Atomically increments `unitsConsumed` on the top-level `clientSync/{projectId}`
43
- * document, creating it if it doesn't exist. Intended for pre-flight checks.
44
- */
45
- incrementUnitsConsumed(projectId: string, units: number, userId: string): Promise<void>;
46
39
  /**
47
40
  * Invite a user to a project by email. Returns the invited user's uid.
48
41
  * Throws if no account exists yet for that email — the gateway route supports
package/node.js CHANGED
@@ -1,5 +1,5 @@
1
- import { c as s } from "./document-filter-BuFNMQwr.js";
2
- import { B as t, C as c, a as n, b as S, d as E, e as m, f as p, g as l, h as A, i as P, j as R, k as d, l as _, m as I, n as g, o as T, p as D, q as N, r as O, s as U, t as G, u as h, v as x, w as f, x as j, y as v, z as M, A as y, D as B, E as F, F as L, G as H, H as b, I as K, J as q, K as w, L as Q, M as V, N as W, O as X, P as Y, Q as k, R as z, S as J, T as Z, U as $, V as ee, W as se, X as ae, Y as ue, Z as Ce, _ as re, $ as ie, a0 as oe, a1 as te, a2 as ce, a3 as ne } from "./document-filter-BuFNMQwr.js";
1
+ import { c as s } from "./document-filter-CBrY09DH.js";
2
+ import { B as t, C as c, a as n, b as S, d as E, e as m, f as p, g as l, h as A, i as P, j as R, k as d, l as _, m as I, n as g, o as T, p as D, q as N, r as O, s as U, t as G, u as h, v as x, w as f, x as j, y as v, z as M, A as y, D as B, E as F, F as L, G as H, H as b, I as K, J as q, K as w, L as Q, M as V, N as W, O as X, P as Y, Q as k, R as z, S as J, T as Z, U as $, V as ee, W as se, X as ae, Y as ue, Z as Ce, _ as re, $ as ie, a0 as oe, a1 as te, a2 as ce, a3 as ne } from "./document-filter-CBrY09DH.js";
3
3
  import "uuid";
4
4
  class r extends s {
5
5
  constructor(e) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qaecy/cue-sdk",
3
- "version": "0.0.52",
3
+ "version": "0.0.53",
4
4
  "type": "module",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",
package/variables.d.ts CHANGED
@@ -26,6 +26,7 @@ export declare const ENDPOINT_PROFILE_ORGANIZATIONS = "/data-views/admin/profile
26
26
  export declare const ENDPOINT_PROFILE_API_KEYS = "/data-views/admin/profile/api-keys";
27
27
  export declare const ENDPOINT_COMMANDS_PROFILE_API_KEYS = "/commands/admin/profile/api-keys";
28
28
  export declare const ENDPOINT_COMMANDS_PROFILE_TERMS = "/commands/admin/profile/terms";
29
+ export declare const ENDPOINT_COMMANDS_PROFILE_SSO_SIGN_IN = "/commands/admin/profile/sso-sign-in";
29
30
  export declare const ENDPOINT_COMMANDS_PROFILE_ANALYTICS_NOTICE = "/commands/admin/profile/analytics-notice";
30
31
  export declare const ENDPOINT_COMMANDS_USAGE_VIEW = "/commands/admin/usage/view";
31
32
  export declare const ENDPOINT_ORG_MEMBERS: (orgId: string) => string;