@qaecy/cue-sdk 0.0.1 → 0.0.2

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/package.json CHANGED
@@ -1,46 +1,21 @@
1
1
  {
2
2
  "name": "@qaecy/cue-sdk",
3
- "version": "0.0.1",
4
- "description": "Headless JavaScript SDK for building apps on the QAECY platform",
5
- "main": "./src/index.js",
6
- "module": "./src/index.js",
7
- "typings": "./src/index.d.ts",
3
+ "version": "0.0.2",
8
4
  "type": "module",
5
+ "main": "./index.js",
6
+ "types": "./index.d.ts",
9
7
  "exports": {
10
8
  ".": {
11
- "import": "./src/index.js",
12
- "types": "./src/index.d.ts"
9
+ "import": "./index.js",
10
+ "types": "./index.d.ts"
11
+ },
12
+ "./node": {
13
+ "import": "./node.js",
14
+ "types": "./node.d.ts"
13
15
  }
14
16
  },
15
- "files": [
16
- "src/**/*",
17
- "README.md"
18
- ],
19
- "keywords": [
20
- "qaecy",
21
- "sdk",
22
- "search",
23
- "knowledge-graph",
24
- "rag",
25
- "ai",
26
- "document-search"
27
- ],
28
- "author": "QAECY",
29
- "license": "MIT",
30
- "repository": {
31
- "type": "git",
32
- "url": "https://github.com/qaecy/qaecy-monorepo.git",
33
- "directory": "libs/js/cue-sdk"
34
- },
35
- "publishConfig": {
36
- "access": "public",
37
- "registry": "https://registry.npmjs.org/"
38
- },
17
+ "dependencies": {},
39
18
  "peerDependencies": {
40
- "firebase": "^12.0.0"
41
- },
42
- "engines": {
43
- "node": ">=18.0.0"
44
- },
45
- "types": "./src/index.d.ts"
46
- }
19
+ "firebase": ">=10.0.0"
20
+ }
21
+ }
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../libs/js/cue-sdk/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,YAAY,EACV,YAAY,EACZ,WAAW,EACX,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,YAAY,GACb,MAAM,cAAc,CAAC;AACtB,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
package/src/index.js DELETED
@@ -1,4 +0,0 @@
1
- export { Cue } from './lib/cue';
2
- export { CueAuth } from './lib/auth';
3
- export { CueApi } from './lib/api';
4
- //# sourceMappingURL=index.js.map
package/src/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../libs/js/cue-sdk/src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC","sourcesContent":["export { Cue } from './lib/cue';\nexport { CueAuth } from './lib/auth';\nexport { CueApi } from './lib/api';\nexport type {\n CueSdkConfig,\n SsoProvider,\n PasswordCredentials,\n SearchRequest,\n SearchResponse,\n SearchSource,\n} from './lib/models';\nexport type { AuthStateListener, Unsubscribe } from './lib/auth';\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../../../../libs/js/cue-sdk/src/lib/api.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACtC,OAAO,KAAK,EAAE,aAAa,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAK9D,qBAAa,MAAM;IAEf,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,WAAW;gBADX,KAAK,EAAE,OAAO,EACd,WAAW,EAAE,MAAM;YAGxB,YAAY;IAS1B;;;OAGG;IACG,MAAM,CAAC,OAAO,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAiB7D;;;OAGG;IACG,MAAM,CAAC,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAYjE"}
package/src/lib/api.js DELETED
@@ -1,56 +0,0 @@
1
- const ENDPOINT_SEARCH = '/assistant/search';
2
- const ENDPOINT_SPARQL = '/triplestore/query';
3
- export class CueApi {
4
- _auth;
5
- _gatewayUrl;
6
- constructor(_auth, _gatewayUrl) {
7
- this._auth = _auth;
8
- this._gatewayUrl = _gatewayUrl;
9
- }
10
- async _authHeaders() {
11
- const token = await this._auth.getToken();
12
- if (!token)
13
- throw new Error('Not authenticated. Call cue.auth.signIn() first.');
14
- return {
15
- Authorization: `Bearer ${token}`,
16
- 'Content-Type': 'application/json',
17
- };
18
- }
19
- /**
20
- * Search project documents using natural language.
21
- * The user must be authenticated before calling this.
22
- */
23
- async search(request) {
24
- const headers = await this._authHeaders();
25
- const response = await fetch(`${this._gatewayUrl}${ENDPOINT_SEARCH}`, {
26
- method: 'POST',
27
- headers,
28
- body: JSON.stringify({
29
- term: request.term,
30
- projectId: request.projectId,
31
- categories: request.categories ?? [],
32
- }),
33
- });
34
- if (!response.ok) {
35
- throw new Error(`Search request failed: ${response.status} ${response.statusText}`);
36
- }
37
- return response.json();
38
- }
39
- /**
40
- * Execute a SPARQL query against the project's triplestore.
41
- * The user must be authenticated before calling this.
42
- */
43
- async sparql(query, projectId) {
44
- const headers = await this._authHeaders();
45
- const response = await fetch(`${this._gatewayUrl}${ENDPOINT_SPARQL}`, {
46
- method: 'POST',
47
- headers,
48
- body: JSON.stringify({ query, projectId }),
49
- });
50
- if (!response.ok) {
51
- throw new Error(`SPARQL query failed: ${response.status} ${response.statusText}`);
52
- }
53
- return response.json();
54
- }
55
- }
56
- //# sourceMappingURL=api.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"api.js","sourceRoot":"","sources":["../../../../../../libs/js/cue-sdk/src/lib/api.ts"],"names":[],"m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M,IAAI,CAAC,YAAY,EAAE,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,GAAG,eAAe,EAAE,EAAE;YACpE,MAAM,EAAE,MAAM;YACd,OAAO;YACP,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,CAAC;SAC3C,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CAAC,wBAAwB,QAAQ,CAAC,MAAM,IAAI,QAAQ,CAAC,UAAU,EAAE,CAAC,CAAC;QACpF,CAAC;QACD,OAAO,QAAQ,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;CACF","sourcesContent":["import type { CueAuth } from './auth';\nimport type { SearchRequest, SearchResponse } from './models';\n\nconst ENDPOINT_SEARCH = '/assistant/search';\nconst ENDPOINT_SPARQL = '/triplestore/query';\n\nexport class CueApi {\n constructor(\n private readonly _auth: CueAuth,\n private readonly _gatewayUrl: string,\n ) {}\n\n private async _authHeaders(): Promise<HeadersInit> {\n const token = await this._auth.getToken();\n if (!token) throw new Error('Not authenticated. Call cue.auth.signIn() first.');\n return {\n Authorization: `Bearer ${token}`,\n 'Content-Type': 'application/json',\n };\n }\n\n /**\n * Search project documents using natural language.\n * The user must be authenticated before calling this.\n */\n async search(request: SearchRequest): Promise<SearchResponse> {\n const headers = await this._authHeaders();\n const response = await fetch(`${this._gatewayUrl}${ENDPOINT_SEARCH}`, {\n method: 'POST',\n headers,\n body: JSON.stringify({\n term: request.term,\n projectId: request.projectId,\n categories: request.categories ?? [],\n }),\n });\n if (!response.ok) {\n throw new Error(`Search request failed: ${response.status} ${response.statusText}`);\n }\n return response.json();\n }\n\n /**\n * Execute a SPARQL query against the project's triplestore.\n * The user must be authenticated before calling this.\n */\n async sparql(query: string, projectId: string): Promise<unknown> {\n const headers = await this._authHeaders();\n const response = await fetch(`${this._gatewayUrl}${ENDPOINT_SPARQL}`, {\n method: 'POST',\n headers,\n body: JSON.stringify({ query, projectId }),\n });\n if (!response.ok) {\n throw new Error(`SPARQL query failed: ${response.status} ${response.statusText}`);\n }\n return response.json();\n }\n}\n"]}
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.d.ts","sourceRoot":"","sources":["../../../../../../libs/js/cue-sdk/src/lib/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,IAAI,EASJ,IAAI,EACL,MAAM,eAAe,CAAC;AACvB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAChD,OAAO,KAAK,EAAE,mBAAmB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIjE,MAAM,MAAM,iBAAiB,GAAG,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,KAAK,IAAI,CAAC;AAC5D,MAAM,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC;AAErC,qBAAa,OAAO;IAClB,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAO;gBAEjB,GAAG,EAAE,WAAW,EAAE,WAAW,UAAQ;IAOjD,yDAAyD;IACnD,MAAM,CAAC,QAAQ,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAClD,sCAAsC;IAChC,MAAM,CAAC,QAAQ,EAAE,UAAU,EAAE,WAAW,EAAE,mBAAmB,GAAG,OAAO,CAAC,IAAI,CAAC;IAsBnF,gCAAgC;IAC1B,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9B,6DAA6D;IAC7D,IAAI,WAAW,IAAI,IAAI,GAAG,IAAI,CAE7B;IAED,kFAAkF;IAClF,kBAAkB,CAAC,QAAQ,EAAE,iBAAiB,GAAG,WAAW;IAI5D,mFAAmF;IAC7E,QAAQ,CAAC,YAAY,UAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAM5D,yDAAyD;IACzD,IAAI,YAAY,IAAI,IAAI,CAEvB;CACF"}
package/src/lib/auth.js DELETED
@@ -1,48 +0,0 @@
1
- import { connectAuthEmulator, getAuth, GoogleAuthProvider, OAuthProvider, onAuthStateChanged as firebaseOnAuthStateChanged, signInWithEmailAndPassword, signInWithPopup, signOut as firebaseSignOut, } from 'firebase/auth';
2
- const MICROSOFT_PROVIDER_ID = 'microsoft.com';
3
- export class CueAuth {
4
- _auth;
5
- constructor(app, useEmulator = false) {
6
- this._auth = getAuth(app);
7
- if (useEmulator) {
8
- connectAuthEmulator(this._auth, 'http://localhost:9099', { disableWarnings: true });
9
- }
10
- }
11
- async signIn(provider, credentials) {
12
- if (provider === 'password') {
13
- if (!credentials)
14
- throw new Error('credentials are required for password sign-in');
15
- const result = await signInWithEmailAndPassword(this._auth, credentials.email, credentials.password);
16
- return result.user;
17
- }
18
- const firebaseProvider = provider === 'google'
19
- ? new GoogleAuthProvider()
20
- : new OAuthProvider(MICROSOFT_PROVIDER_ID);
21
- const result = await signInWithPopup(this._auth, firebaseProvider);
22
- return result.user;
23
- }
24
- /** Sign out the current user */
25
- async signOut() {
26
- await firebaseSignOut(this._auth);
27
- }
28
- /** Currently signed-in user, or null if not authenticated */
29
- get currentUser() {
30
- return this._auth.currentUser;
31
- }
32
- /** Subscribe to authentication state changes. Returns an unsubscribe function. */
33
- onAuthStateChanged(listener) {
34
- return firebaseOnAuthStateChanged(this._auth, listener);
35
- }
36
- /** Get the Firebase ID token for the current user, or null if not authenticated */
37
- async getToken(forceRefresh = false) {
38
- const user = this._auth.currentUser;
39
- if (!user)
40
- return null;
41
- return user.getIdToken(forceRefresh);
42
- }
43
- /** Raw Firebase Auth instance, for advanced use cases */
44
- get firebaseAuth() {
45
- return this._auth;
46
- }
47
- }
48
- //# sourceMappingURL=auth.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"auth.js","sourceRoot":"","sources":["../../../../../../libs/js/cue-sdk/src/lib/auth.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,mBAAmB,EACnB,OAAO,EACP,kBAAkB,EAClB,aAAa,E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C,WAAW,CAAC;IAChC,CAAC;IAED,kFAAkF;IAClF,kBAAkB,CAAC,QAA2B;QAC5C,OAAO,0BAA0B,CAAC,IAAI,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;IAC1D,CAAC;IAED,mFAAmF;IACnF,KAAK,CAAC,QAAQ,CAAC,YAAY,GAAG,KAAK;QACjC,MAAM,IAAI,GAAG,IAAI,CAAC,KAAK,CAAC,WAAW,CAAC;QACpC,IAAI,CAAC,IAAI;YAAE,OAAO,IAAI,CAAC;QACvB,OAAO,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;IACvC,CAAC;IAED,yDAAyD;IACzD,IAAI,YAAY;QACd,OAAO,IAAI,CAAC,KAAK,CAAC;IACpB,CAAC;CACF","sourcesContent":["import {\n Auth,\n connectAuthEmulator,\n getAuth,\n GoogleAuthProvider,\n OAuthProvider,\n onAuthStateChanged as firebaseOnAuthStateChanged,\n signInWithEmailAndPassword,\n signInWithPopup,\n signOut as firebaseSignOut,\n User,\n} from 'firebase/auth';\nimport type { FirebaseApp } from 'firebase/app';\nimport type { PasswordCredentials, SsoProvider } from './models';\n\nconst MICROSOFT_PROVIDER_ID = 'microsoft.com';\n\nexport type AuthStateListener = (user: User | null) => void;\nexport type Unsubscribe = () => void;\n\nexport class CueAuth {\n private readonly _auth: Auth;\n\n constructor(app: FirebaseApp, useEmulator = false) {\n this._auth = getAuth(app);\n if (useEmulator) {\n connectAuthEmulator(this._auth, 'http://localhost:9099', { disableWarnings: true });\n }\n }\n\n /** Sign in with Google or Microsoft via browser popup */\n async signIn(provider: SsoProvider): Promise<User>;\n /** Sign in with email and password */\n async signIn(provider: 'password', credentials: PasswordCredentials): Promise<User>;\n async signIn(\n provider: SsoProvider | 'password',\n credentials?: PasswordCredentials,\n ): Promise<User> {\n if (provider === 'password') {\n if (!credentials) throw new Error('credentials are required for password sign-in');\n const result = await signInWithEmailAndPassword(\n this._auth,\n credentials.email,\n credentials.password,\n );\n return result.user;\n }\n const firebaseProvider =\n provider === 'google'\n ? new GoogleAuthProvider()\n : new OAuthProvider(MICROSOFT_PROVIDER_ID);\n const result = await signInWithPopup(this._auth, firebaseProvider);\n return result.user;\n }\n\n /** Sign out the current user */\n async signOut(): Promise<void> {\n await firebaseSignOut(this._auth);\n }\n\n /** Currently signed-in user, or null if not authenticated */\n get currentUser(): User | null {\n return this._auth.currentUser;\n }\n\n /** Subscribe to authentication state changes. Returns an unsubscribe function. */\n onAuthStateChanged(listener: AuthStateListener): Unsubscribe {\n return firebaseOnAuthStateChanged(this._auth, listener);\n }\n\n /** Get the Firebase ID token for the current user, or null if not authenticated */\n async getToken(forceRefresh = false): Promise<string | null> {\n const user = this._auth.currentUser;\n if (!user) return null;\n return user.getIdToken(forceRefresh);\n }\n\n /** Raw Firebase Auth instance, for advanced use cases */\n get firebaseAuth(): Auth {\n return this._auth;\n }\n}\n"]}
package/src/lib/cue.d.ts DELETED
@@ -1,20 +0,0 @@
1
- import { CueAuth } from './auth';
2
- import { CueApi } from './api';
3
- import type { CueSdkConfig } from './models';
4
- /**
5
- * Main entry point for the QAECY SDK.
6
- *
7
- * @example
8
- * const cue = new Cue({ apiKey: '...', appId: '...', measurementId: '...' });
9
- * await cue.auth.signIn('google');
10
- * const results = await cue.api.search({ term: 'my query', projectId: 'project-id' });
11
- */
12
- export declare class Cue {
13
- readonly auth: CueAuth;
14
- readonly api: CueApi;
15
- private readonly _app;
16
- constructor(config: CueSdkConfig);
17
- /** Convenience: get the current user's Firebase ID token */
18
- getToken(forceRefresh?: boolean): Promise<string | null>;
19
- }
20
- //# sourceMappingURL=cue.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cue.d.ts","sourceRoot":"","sources":["../../../../../../libs/js/cue-sdk/src/lib/cue.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAC/B,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAO7C;;;;;;;GAOG;AACH,qBAAa,GAAG;IACd,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IAErB,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAc;gBAEvB,MAAM,EAAE,YAAY;IAkBhC,4DAA4D;IAC5D,QAAQ,CAAC,YAAY,UAAQ,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;CAGvD"}
package/src/lib/cue.js DELETED
@@ -1,39 +0,0 @@
1
- import { initializeApp } from 'firebase/app';
2
- import { CueAuth } from './auth';
3
- import { CueApi } from './api';
4
- const FIREBASE_PROJECT_ID = 'qaecy-mvp-406413';
5
- const FIREBASE_SENDER_ID = '734737865998';
6
- const GATEWAY_URL_PRODUCTION = 'https://accessors-api-gateway-ueyeemwf2a-oa.a.run.app';
7
- const GATEWAY_URL_EMULATORS = 'http://localhost:8093';
8
- /**
9
- * Main entry point for the QAECY SDK.
10
- *
11
- * @example
12
- * const cue = new Cue({ apiKey: '...', appId: '...', measurementId: '...' });
13
- * await cue.auth.signIn('google');
14
- * const results = await cue.api.search({ term: 'my query', projectId: 'project-id' });
15
- */
16
- export class Cue {
17
- auth;
18
- api;
19
- _app;
20
- constructor(config) {
21
- this._app = initializeApp({
22
- apiKey: config.apiKey,
23
- appId: config.appId,
24
- measurementId: config.measurementId,
25
- authDomain: `${FIREBASE_PROJECT_ID}.firebaseapp.com`,
26
- projectId: FIREBASE_PROJECT_ID,
27
- messagingSenderId: FIREBASE_SENDER_ID,
28
- });
29
- const gatewayUrl = config.gatewayUrl ??
30
- (config.useEmulator ? GATEWAY_URL_EMULATORS : GATEWAY_URL_PRODUCTION);
31
- this.auth = new CueAuth(this._app, config.useEmulator ?? false);
32
- this.api = new CueApi(this.auth, gatewayUrl);
33
- }
34
- /** Convenience: get the current user's Firebase ID token */
35
- getToken(forceRefresh = false) {
36
- return this.auth.getToken(forceRefresh);
37
- }
38
- }
39
- //# sourceMappingURL=cue.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cue.js","sourceRoot":"","sources":["../../../../../../libs/js/cue-sdk/src/lib/cue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAC;AACjC,OAAO,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAG/B,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAC/C,MAAM,kBAAkB,GAAG,cAAc,CAAC;AAC1C,MAAM,sBAAsB,GAAG,uDAAuD,CAAC;AACvF,MAAM,qBAAqB,GAAG,uBAAuB,CAAC;AAEtD;;;;;;;GAOG;AACH,MAAM,OAAO,GAAG;IACL,IAAI,CAAU;IACd,GAAG,CAAS;IAEJ,IAAI,CAAc;IAEnC,YAAY,MAAoB;QAC9B,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC;YACxB,MAAM,EAAE,MAAM,CAAC,MAAM;YACrB,KAAK,EAAE,MAAM,CAAC,KAAK;YACnB,aAAa,EAAE,MAAM,CAAC,aAAa;YACnC,UAAU,EAAE,GAAG,mBAAmB,kBAAkB;YACpD,SAAS,EAAE,mBAAmB;YAC9B,iBAAiB,EAAE,kBAAkB;SACtC,CAAC,CAAC;QAEH,MAAM,UAAU,GACd,MAAM,CAAC,UAAU;YACjB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,sBAAsB,CAAC,CAAC;QAExE,IAAI,CAAC,IAAI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,CAAC,WAAW,IAAI,KAAK,CAAC,CAAC;QAChE,IAAI,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;IAC/C,CAAC;IAED,4DAA4D;IAC5D,QAAQ,CAAC,YAAY,GAAG,KAAK;QAC3B,OAAO,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,CAAC;IAC1C,CAAC;CACF","sourcesContent":["import { initializeApp } from 'firebase/app';\nimport type { FirebaseApp } from 'firebase/app';\nimport { CueAuth } from './auth';\nimport { CueApi } from './api';\nimport type { CueSdkConfig } from './models';\n\nconst FIREBASE_PROJECT_ID = 'qaecy-mvp-406413';\nconst FIREBASE_SENDER_ID = '734737865998';\nconst GATEWAY_URL_PRODUCTION = 'https://accessors-api-gateway-ueyeemwf2a-oa.a.run.app';\nconst GATEWAY_URL_EMULATORS = 'http://localhost:8093';\n\n/**\n * Main entry point for the QAECY SDK.\n *\n * @example\n * const cue = new Cue({ apiKey: '...', appId: '...', measurementId: '...' });\n * await cue.auth.signIn('google');\n * const results = await cue.api.search({ term: 'my query', projectId: 'project-id' });\n */\nexport class Cue {\n readonly auth: CueAuth;\n readonly api: CueApi;\n\n private readonly _app: FirebaseApp;\n\n constructor(config: CueSdkConfig) {\n this._app = initializeApp({\n apiKey: config.apiKey,\n appId: config.appId,\n measurementId: config.measurementId,\n authDomain: `${FIREBASE_PROJECT_ID}.firebaseapp.com`,\n projectId: FIREBASE_PROJECT_ID,\n messagingSenderId: FIREBASE_SENDER_ID,\n });\n\n const gatewayUrl =\n config.gatewayUrl ??\n (config.useEmulator ? GATEWAY_URL_EMULATORS : GATEWAY_URL_PRODUCTION);\n\n this.auth = new CueAuth(this._app, config.useEmulator ?? false);\n this.api = new CueApi(this.auth, gatewayUrl);\n }\n\n /** Convenience: get the current user's Firebase ID token */\n getToken(forceRefresh = false): Promise<string | null> {\n return this.auth.getToken(forceRefresh);\n }\n}\n"]}
@@ -1,39 +0,0 @@
1
- export interface CueSdkConfig {
2
- /** Firebase API key for this project */
3
- apiKey: string;
4
- /** Firebase App ID */
5
- appId: string;
6
- /** Firebase Measurement ID */
7
- measurementId: string;
8
- /** Override the API gateway URL. Defaults to production. */
9
- gatewayUrl?: string;
10
- /** Connect to local emulators instead of production services */
11
- useEmulator?: boolean;
12
- }
13
- export type SsoProvider = 'google' | 'microsoft';
14
- export interface PasswordCredentials {
15
- email: string;
16
- password: string;
17
- }
18
- export interface SearchRequest {
19
- /** Natural language query or search term */
20
- term: string;
21
- /** Project ID to search within */
22
- projectId: string;
23
- /** Optional category filters */
24
- categories?: string[];
25
- }
26
- export interface SearchSource {
27
- item: string;
28
- parent: string;
29
- content: string;
30
- }
31
- export interface SearchResponse {
32
- id: string;
33
- question: string;
34
- questionHTML: string;
35
- response: string;
36
- sources: SearchSource[];
37
- rankedSources: SearchSource[];
38
- }
39
- //# sourceMappingURL=models.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../../../../../libs/js/cue-sdk/src/lib/models.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,sBAAsB;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,8BAA8B;IAC9B,aAAa,EAAE,MAAM,CAAC;IACtB,4DAA4D;IAC5D,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,gEAAgE;IAChE,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,WAAW,CAAC;AAEjD,MAAM,WAAW,mBAAmB;IAClC,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,aAAa;IAC5B,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,gCAAgC;IAChC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,YAAY;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,YAAY,EAAE,CAAC;IACxB,aAAa,EAAE,YAAY,EAAE,CAAC;CAC/B"}
package/src/lib/models.js DELETED
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=models.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../../../../../../libs/js/cue-sdk/src/lib/models.ts"],"names":[],"mappings":"","sourcesContent":["export interface CueSdkConfig {\n /** Firebase API key for this project */\n apiKey: string;\n /** Firebase App ID */\n appId: string;\n /** Firebase Measurement ID */\n measurementId: string;\n /** Override the API gateway URL. Defaults to production. */\n gatewayUrl?: string;\n /** Connect to local emulators instead of production services */\n useEmulator?: boolean;\n}\n\nexport type SsoProvider = 'google' | 'microsoft';\n\nexport interface PasswordCredentials {\n email: string;\n password: string;\n}\n\nexport interface SearchRequest {\n /** Natural language query or search term */\n term: string;\n /** Project ID to search within */\n projectId: string;\n /** Optional category filters */\n categories?: string[];\n}\n\nexport interface SearchSource {\n item: string;\n parent: string;\n content: string;\n}\n\nexport interface SearchResponse {\n id: string;\n question: string;\n questionHTML: string;\n response: string;\n sources: SearchSource[];\n rankedSources: SearchSource[];\n}\n"]}