@seip/bluebird-js 0.1.5 → 0.1.6

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/core/database.js CHANGED
@@ -1,6 +1,8 @@
1
1
  import fs from "node:fs";
2
2
  import path from "node:path";
3
- import crypto from "node:crypto";
3
+ import crypto from "node:crypto";
4
+ import zlib from "node:zlib";
5
+ import { execSync } from "node:child_process";
4
6
  import Config from "./config.js";
5
7
  import Cache from "./cache.js";
6
8
 
@@ -132,7 +134,61 @@ function toPostgresSql(sql) {
132
134
  return result;
133
135
  }
134
136
 
135
- const _activeDatabases = new Set();
137
+ const _activeDatabases = new Set();
138
+
139
+ /**
140
+ * Generates an ISO-safe timestamp string formatted for filenames across OS platforms.
141
+ * @returns {string}
142
+ */
143
+ function getBackupTimestamp() {
144
+ const now = new Date();
145
+ const pad = (n) => String(n).padStart(2, "0");
146
+ const year = now.getFullYear();
147
+ const month = pad(now.getMonth() + 1);
148
+ const day = pad(now.getDate());
149
+ const hours = pad(now.getHours());
150
+ const mins = pad(now.getMinutes());
151
+ const secs = pad(now.getSeconds());
152
+ const ms = String(now.getMilliseconds()).padStart(3, "0");
153
+ return `${year}-${month}-${day}_${hours}${mins}${secs}_${ms}`;
154
+ }
155
+
156
+ /**
157
+ * Rotates backups in backupDir, keeping only the most recent N backups.
158
+ * @param {string} backupDir
159
+ * @param {string} prefix
160
+ * @param {number} [keep=10]
161
+ * @returns {number} Count of deleted backups.
162
+ */
163
+ function rotateBackups(backupDir, prefix, keep = 10) {
164
+ if (!fs.existsSync(backupDir) || keep <= 0) return 0;
165
+ try {
166
+ const files = fs.readdirSync(backupDir)
167
+ .filter((file) => file.startsWith(prefix))
168
+ .map((file) => {
169
+ const fullPath = path.join(backupDir, file);
170
+ return {
171
+ file,
172
+ fullPath,
173
+ mtime: fs.statSync(fullPath).mtimeMs,
174
+ };
175
+ })
176
+ .sort((a, b) => b.mtime - a.mtime);
177
+
178
+ let deleted = 0;
179
+ if (files.length > keep) {
180
+ for (let i = keep; i < files.length; i++) {
181
+ try {
182
+ fs.unlinkSync(files[i].fullPath);
183
+ deleted++;
184
+ } catch {}
185
+ }
186
+ }
187
+ return deleted;
188
+ } catch {
189
+ return 0;
190
+ }
191
+ }
136
192
 
137
193
  /**
138
194
  * Database class wrapping native node:sqlite, mysql2, and pg with pooling and multi-level caching.
@@ -256,6 +312,7 @@ class Database {
256
312
  */
257
313
  async init(retries = 3) {
258
314
  if (!mysqlPromise && !pgPromise && !sqlitePromise) return false;
315
+ _activeDatabases.add(this);
259
316
  if (this.pool || this.db) return true;
260
317
 
261
318
  if (this.type === "sqlite" && sqlitePromise) {
@@ -655,6 +712,409 @@ class Database {
655
712
  * Closes all active database instances across the application.
656
713
  * @returns {Promise<void>}
657
714
  */
715
+ /**
716
+ * Creates an atomic backup of this database instance.
717
+ * @param {Object} [options={}]
718
+ * @returns {Promise<{ success: boolean, file: string, filename: string, size: number, rotated: number, dbType: string }>}
719
+ */
720
+ async backup(options = {}) {
721
+ return Database.backup({ ...options, dbInstance: this });
722
+ }
723
+
724
+ /**
725
+ * Restores this database instance from a backup file.
726
+ * @param {string} filePath
727
+ * @param {Object} [options={}]
728
+ * @returns {Promise<{ success: boolean, restoredFrom: string, targetFile: string, preRestoreBackup?: string, size: number, dbType: string }>}
729
+ */
730
+ async restore(filePath, options = {}) {
731
+ return Database.restore(filePath, { ...options, dbInstance: this });
732
+ }
733
+
734
+ /**
735
+ * Creates an atomic, compressed database backup with automatic retention rotation.
736
+ * For SQLite, executes VACUUM INTO for non-blocking, WAL-safe online snapshots.
737
+ * @param {Object} [options={}]
738
+ * @param {string} [options.out] - Directory to store backups (default: database/backups).
739
+ * @param {boolean} [options.compress=true] - Whether to compress with gzip (.gz).
740
+ * @param {number} [options.keep=10] - Number of recent backups to retain.
741
+ * @param {string} [options.filename] - Custom output filename.
742
+ * @param {Database} [options.dbInstance] - Specific database instance to backup.
743
+ * @returns {Promise<{ success: boolean, file: string, filename: string, size: number, rotated: number, dbType: string }>}
744
+ */
745
+ static async backup(options = {}) {
746
+ const dbType = options.dbInstance?.type || options.dbType || DB_TYPE;
747
+ const backupDir = options.out
748
+ ? path.resolve(options.out)
749
+ : path.resolve(Config.userDataDir(), "database/backups");
750
+
751
+ if (!fs.existsSync(backupDir)) {
752
+ fs.mkdirSync(backupDir, { recursive: true });
753
+ }
754
+
755
+ const compress = options.compress !== false;
756
+ const keep = options.keep !== undefined ? parseInt(options.keep, 10) : 10;
757
+ const timestamp = getBackupTimestamp();
758
+
759
+ if (dbType === "sqlite") {
760
+ let dbFilePath =
761
+ options.dbInstance?.sqliteConfig?.filename ||
762
+ process.env.DB_FILE ||
763
+ "database/blue_bird.db";
764
+
765
+ if (!path.isAbsolute(dbFilePath) && dbFilePath !== ":memory:") {
766
+ dbFilePath = path.resolve(Config.userDataDir(), dbFilePath);
767
+ }
768
+
769
+ if (dbFilePath === ":memory:") {
770
+ throw new Error("Cannot backup an in-memory SQLite database (:memory:).");
771
+ }
772
+
773
+ if (!fs.existsSync(dbFilePath)) {
774
+ throw new Error(`SQLite database file not found: ${dbFilePath}`);
775
+ }
776
+
777
+ const ext = compress ? ".db.gz" : ".db";
778
+ const filename = options.filename || `backup-sqlite-${timestamp}${ext}`;
779
+ const targetPath = path.join(backupDir, filename);
780
+ const tempDbPath = path.join(backupDir, `.temp-backup-${Date.now()}-${Math.random().toString(36).slice(2, 6)}.db`);
781
+
782
+ if (fs.existsSync(tempDbPath)) {
783
+ try { fs.unlinkSync(tempDbPath); } catch {}
784
+ }
785
+
786
+ if (options.dbInstance && options.dbInstance.db) {
787
+ options.dbInstance.db.exec(`VACUUM INTO '${tempDbPath.replace(/'/g, "''")}';`);
788
+ } else {
789
+ if (sqlitePromise?.DatabaseSync) {
790
+ const tempConn = new sqlitePromise.DatabaseSync(dbFilePath);
791
+ try {
792
+ tempConn.exec(`VACUUM INTO '${tempDbPath.replace(/'/g, "''")}';`);
793
+ } finally {
794
+ tempConn.close();
795
+ }
796
+ } else if (sqlitePromise?.BetterSqlite) {
797
+ const tempConn = new sqlitePromise.BetterSqlite(dbFilePath);
798
+ try {
799
+ tempConn.exec(`VACUUM INTO '${tempDbPath.replace(/'/g, "''")}';`);
800
+ } finally {
801
+ tempConn.close();
802
+ }
803
+ } else {
804
+ throw new Error("No SQLite driver available to perform VACUUM INTO backup.");
805
+ }
806
+ }
807
+
808
+ if (compress) {
809
+ const rawBytes = fs.readFileSync(tempDbPath);
810
+ const gzipped = zlib.gzipSync(rawBytes);
811
+ fs.writeFileSync(targetPath, gzipped);
812
+ try { fs.unlinkSync(tempDbPath); } catch {}
813
+ } else {
814
+ fs.renameSync(tempDbPath, targetPath);
815
+ }
816
+
817
+ const rotated = rotateBackups(backupDir, "backup-sqlite-", keep);
818
+
819
+ return {
820
+ success: true,
821
+ file: targetPath,
822
+ filename,
823
+ size: fs.statSync(targetPath).size,
824
+ rotated,
825
+ dbType: "sqlite",
826
+ };
827
+ }
828
+
829
+ if (dbType === "postgres") {
830
+ const ext = compress ? ".sql.gz" : ".sql";
831
+ const filename = options.filename || `backup-postgres-${timestamp}${ext}`;
832
+ const targetPath = path.join(backupDir, filename);
833
+
834
+ const dbName = process.env.DB_NAME || "blue_bird";
835
+ const dbHost = process.env.DB_HOST || "localhost";
836
+ const dbPort = process.env.DB_PORT || "5432";
837
+ const dbUser = process.env.DB_USER || "postgres";
838
+ const dbPass = process.env.DB_PASSWORD || "";
839
+
840
+ const env = { ...process.env, PGPASSWORD: dbPass };
841
+ let cmd = `pg_dump -h ${dbHost} -p ${dbPort} -U ${dbUser} -d ${dbName}`;
842
+ if (process.env.DATABASE_URL) {
843
+ cmd = `pg_dump "${process.env.DATABASE_URL}"`;
844
+ }
845
+
846
+ const dumpBuffer = execSync(cmd, { env, maxBuffer: 1024 * 1024 * 100 });
847
+ if (compress) {
848
+ fs.writeFileSync(targetPath, zlib.gzipSync(dumpBuffer));
849
+ } else {
850
+ fs.writeFileSync(targetPath, dumpBuffer);
851
+ }
852
+
853
+ const rotated = rotateBackups(backupDir, "backup-postgres-", keep);
854
+ return {
855
+ success: true,
856
+ file: targetPath,
857
+ filename,
858
+ size: fs.statSync(targetPath).size,
859
+ rotated,
860
+ dbType: "postgres",
861
+ };
862
+ }
863
+
864
+ if (dbType === "mysql") {
865
+ const ext = compress ? ".sql.gz" : ".sql";
866
+ const filename = options.filename || `backup-mysql-${timestamp}${ext}`;
867
+ const targetPath = path.join(backupDir, filename);
868
+
869
+ const dbName = process.env.DB_NAME || "blue_bird";
870
+ const dbHost = process.env.DB_HOST || "localhost";
871
+ const dbPort = process.env.DB_PORT || "3306";
872
+ const dbUser = process.env.DB_USER || "root";
873
+ const dbPass = process.env.DB_PASSWORD || "";
874
+
875
+ let cmd = `mysqldump -h ${dbHost} -P ${dbPort} -u ${dbUser} ${dbPass ? `-p${dbPass}` : ""} ${dbName}`;
876
+ const dumpBuffer = execSync(cmd, { maxBuffer: 1024 * 1024 * 100 });
877
+ if (compress) {
878
+ fs.writeFileSync(targetPath, zlib.gzipSync(dumpBuffer));
879
+ } else {
880
+ fs.writeFileSync(targetPath, dumpBuffer);
881
+ }
882
+
883
+ const rotated = rotateBackups(backupDir, "backup-mysql-", keep);
884
+ return {
885
+ success: true,
886
+ file: targetPath,
887
+ filename,
888
+ size: fs.statSync(targetPath).size,
889
+ rotated,
890
+ dbType: "mysql",
891
+ };
892
+ }
893
+
894
+ throw new Error(`Unsupported database type '${dbType}' for backup.`);
895
+ }
896
+
897
+ /**
898
+ * Restores a database from a backup file with pre-restore safety snapshot and SQLite integrity verification.
899
+ * @param {string} filePath - Path to backup file (.db, .db.gz, .sql, .sql.gz).
900
+ * @param {Object} [options={}]
901
+ * @param {boolean} [options.safetyBackup=true] - Create pre-restore snapshot of current database.
902
+ * @param {boolean} [options.verify=true] - Verify SQLite PRAGMA integrity_check before overwriting.
903
+ * @param {Database} [options.dbInstance]
904
+ * @returns {Promise<{ success: boolean, restoredFrom: string, targetFile: string, preRestoreBackup?: string, size: number, dbType: string }>}
905
+ */
906
+ static async restore(filePath, options = {}) {
907
+ if (!filePath) {
908
+ throw new Error("Backup file path is required for restore.");
909
+ }
910
+
911
+ let resolvedFile = path.isAbsolute(filePath) ? filePath : path.resolve(process.cwd(), filePath);
912
+ if (!fs.existsSync(resolvedFile)) {
913
+ const inDefaultBackups = path.resolve(Config.userDataDir(), "database/backups", filePath);
914
+ if (fs.existsSync(inDefaultBackups)) {
915
+ resolvedFile = inDefaultBackups;
916
+ } else {
917
+ throw new Error(`Backup file not found: ${filePath}`);
918
+ }
919
+ }
920
+
921
+ const filename = path.basename(resolvedFile).toLowerCase();
922
+ let dbType = options.dbInstance?.type || options.dbType || DB_TYPE;
923
+ if (filename.includes("postgres")) {
924
+ dbType = "postgres";
925
+ } else if (filename.includes("mysql")) {
926
+ dbType = "mysql";
927
+ } else if (filename.endsWith(".db") || filename.endsWith(".db.gz")) {
928
+ dbType = "sqlite";
929
+ }
930
+
931
+ if (dbType === "sqlite") {
932
+ let targetDbPath =
933
+ options.dbInstance?.sqliteConfig?.filename ||
934
+ process.env.DB_FILE ||
935
+ "database/blue_bird.db";
936
+
937
+ if (!path.isAbsolute(targetDbPath) && targetDbPath !== ":memory:") {
938
+ targetDbPath = path.resolve(Config.userDataDir(), targetDbPath);
939
+ }
940
+
941
+ if (targetDbPath === ":memory:") {
942
+ throw new Error("Cannot restore into an in-memory SQLite database (:memory:).");
943
+ }
944
+
945
+ const candidateFile = path.join(
946
+ path.dirname(targetDbPath),
947
+ `.restore-cand-${Date.now()}-${Math.random().toString(36).slice(2, 6)}.db`
948
+ );
949
+
950
+ if (resolvedFile.endsWith(".gz")) {
951
+ const compressed = fs.readFileSync(resolvedFile);
952
+ const decompressed = zlib.gunzipSync(compressed);
953
+ fs.writeFileSync(candidateFile, decompressed);
954
+ } else {
955
+ fs.copyFileSync(resolvedFile, candidateFile);
956
+ }
957
+
958
+ if (options.verify !== false) {
959
+ let integrityOk = false;
960
+ let integrityMsg = "";
961
+
962
+ if (sqlitePromise?.DatabaseSync) {
963
+ const testDb = new sqlitePromise.DatabaseSync(candidateFile);
964
+ try {
965
+ const row = testDb.prepare("PRAGMA integrity_check;").get();
966
+ if (row && (row.integrity_check === "ok" || Object.values(row)[0] === "ok")) {
967
+ integrityOk = true;
968
+ } else {
969
+ integrityMsg = JSON.stringify(row);
970
+ }
971
+ } finally {
972
+ testDb.close();
973
+ }
974
+ } else if (sqlitePromise?.BetterSqlite) {
975
+ const testDb = new sqlitePromise.BetterSqlite(candidateFile);
976
+ try {
977
+ const row = testDb.pragma("integrity_check", { simple: true });
978
+ if (row === "ok") {
979
+ integrityOk = true;
980
+ } else {
981
+ integrityMsg = String(row);
982
+ }
983
+ } finally {
984
+ testDb.close();
985
+ }
986
+ }
987
+
988
+ if (!integrityOk) {
989
+ try { fs.unlinkSync(candidateFile); } catch {}
990
+ throw new Error(`Database restore aborted: backup failed integrity check (${integrityMsg || "unknown error"}).`);
991
+ }
992
+ }
993
+
994
+ if (options.dbInstance) {
995
+ try {
996
+ await options.dbInstance.close();
997
+ } catch {}
998
+ }
999
+ await Database.closeAll();
1000
+
1001
+ let preRestoreBackup = null;
1002
+ if (options.safetyBackup !== false && fs.existsSync(targetDbPath)) {
1003
+ const backupDir = path.resolve(Config.userDataDir(), "database/backups");
1004
+ if (!fs.existsSync(backupDir)) {
1005
+ fs.mkdirSync(backupDir, { recursive: true });
1006
+ }
1007
+ preRestoreBackup = path.join(backupDir, `pre-restore-sqlite-${getBackupTimestamp()}.db`);
1008
+ fs.copyFileSync(targetDbPath, preRestoreBackup);
1009
+ }
1010
+
1011
+ const targetDir = path.dirname(targetDbPath);
1012
+ if (!fs.existsSync(targetDir)) {
1013
+ fs.mkdirSync(targetDir, { recursive: true });
1014
+ }
1015
+
1016
+ try {
1017
+ fs.unlinkSync(targetDbPath);
1018
+ } catch {}
1019
+
1020
+ try {
1021
+ fs.copyFileSync(candidateFile, targetDbPath);
1022
+ } catch {
1023
+ await new Promise((resolve) => setTimeout(resolve, 100));
1024
+ fs.copyFileSync(candidateFile, targetDbPath);
1025
+ }
1026
+ try { fs.unlinkSync(candidateFile); } catch {}
1027
+
1028
+ const walFile = `${targetDbPath}-wal`;
1029
+ const shmFile = `${targetDbPath}-shm`;
1030
+ if (fs.existsSync(walFile)) {
1031
+ try { fs.unlinkSync(walFile); } catch {}
1032
+ }
1033
+ if (fs.existsSync(shmFile)) {
1034
+ try { fs.unlinkSync(shmFile); } catch {}
1035
+ }
1036
+
1037
+ return {
1038
+ success: true,
1039
+ restoredFrom: resolvedFile,
1040
+ targetFile: targetDbPath,
1041
+ preRestoreBackup,
1042
+ size: fs.statSync(targetDbPath).size,
1043
+ dbType: "sqlite",
1044
+ };
1045
+ }
1046
+
1047
+ if (dbType === "postgres") {
1048
+ let sqlFile = resolvedFile;
1049
+ let tempSql = null;
1050
+ if (resolvedFile.endsWith(".gz")) {
1051
+ tempSql = path.join(os.tmpdir(), `bluebird-restore-${Date.now()}.sql`);
1052
+ fs.writeFileSync(tempSql, zlib.gunzipSync(fs.readFileSync(resolvedFile)));
1053
+ sqlFile = tempSql;
1054
+ }
1055
+
1056
+ await Database.closeAll();
1057
+
1058
+ const dbName = process.env.DB_NAME || "blue_bird";
1059
+ const dbHost = process.env.DB_HOST || "localhost";
1060
+ const dbPort = process.env.DB_PORT || "5432";
1061
+ const dbUser = process.env.DB_USER || "postgres";
1062
+ const dbPass = process.env.DB_PASSWORD || "";
1063
+
1064
+ const env = { ...process.env, PGPASSWORD: dbPass };
1065
+ let cmd = `psql -h ${dbHost} -p ${dbPort} -U ${dbUser} -d ${dbName} -f "${sqlFile}"`;
1066
+ if (process.env.DATABASE_URL) {
1067
+ cmd = `psql "${process.env.DATABASE_URL}" -f "${sqlFile}"`;
1068
+ }
1069
+
1070
+ execSync(cmd, { env });
1071
+ if (tempSql) {
1072
+ try { fs.unlinkSync(tempSql); } catch {}
1073
+ }
1074
+
1075
+ return {
1076
+ success: true,
1077
+ restoredFrom: resolvedFile,
1078
+ targetFile: dbName,
1079
+ dbType: "postgres",
1080
+ };
1081
+ }
1082
+
1083
+ if (dbType === "mysql") {
1084
+ let sqlFile = resolvedFile;
1085
+ let tempSql = null;
1086
+ if (resolvedFile.endsWith(".gz")) {
1087
+ tempSql = path.join(os.tmpdir(), `bluebird-restore-${Date.now()}.sql`);
1088
+ fs.writeFileSync(tempSql, zlib.gunzipSync(fs.readFileSync(resolvedFile)));
1089
+ sqlFile = tempSql;
1090
+ }
1091
+
1092
+ await Database.closeAll();
1093
+
1094
+ const dbName = process.env.DB_NAME || "blue_bird";
1095
+ const dbHost = process.env.DB_HOST || "localhost";
1096
+ const dbPort = process.env.DB_PORT || "3306";
1097
+ const dbUser = process.env.DB_USER || "root";
1098
+ const dbPass = process.env.DB_PASSWORD || "";
1099
+
1100
+ let cmd = `mysql -h ${dbHost} -P ${dbPort} -u ${dbUser} ${dbPass ? `-p${dbPass}` : ""} ${dbName} < "${sqlFile}"`;
1101
+ execSync(cmd, { shell: true });
1102
+
1103
+ if (tempSql) {
1104
+ try { fs.unlinkSync(tempSql); } catch {}
1105
+ }
1106
+
1107
+ return {
1108
+ success: true,
1109
+ restoredFrom: resolvedFile,
1110
+ targetFile: dbName,
1111
+ dbType: "mysql",
1112
+ };
1113
+ }
1114
+
1115
+ throw new Error(`Unsupported database type '${dbType}' for restore.`);
1116
+ }
1117
+
658
1118
  static async closeAll() {
659
1119
  const list = Array.from(_activeDatabases);
660
1120
  for (const db of list) {
package/core/index.d.ts CHANGED
@@ -2,6 +2,7 @@ import type { Server as HttpServer } from "node:http";
2
2
  import { Router as ExpressRouter, Request, Response, NextFunction, RequestHandler } from "express";
3
3
 
4
4
  export type { Request, Response, NextFunction, RequestHandler };
5
+ export * from "./ai.js";
5
6
 
6
7
  /**
7
8
  * Standard pagination metadata structure.
@@ -305,6 +306,7 @@ export class App {
305
306
  static helmet(options?: any): (req: Request, res: Response, next: NextFunction) => void;
306
307
  static securityHeaders(options?: SecurityHeadersOptions): (req: Request, res: Response, next: NextFunction) => void;
307
308
  static rateLimit(options?: RateLimitOptions | boolean): (req: Request, res: Response, next: NextFunction) => Promise<any>;
309
+ static ai(options?: any): any;
308
310
  }
309
311
 
310
312
  /**
@@ -732,7 +734,45 @@ export interface DatabaseTransactionClient {
732
734
  query<T = any>(sql: string, params?: any[], options?: "return_row" | DatabaseQueryOptions | any): Promise<T>;
733
735
  }
734
736
 
737
+ export interface DatabaseBackupOptions {
738
+ out?: string;
739
+ compress?: boolean;
740
+ keep?: number;
741
+ filename?: string;
742
+ dbInstance?: Database;
743
+ dbType?: string;
744
+ }
745
+
746
+ export interface DatabaseBackupResult {
747
+ success: boolean;
748
+ file: string;
749
+ filename: string;
750
+ size: number;
751
+ rotated: number;
752
+ dbType: string;
753
+ }
754
+
755
+ export interface DatabaseRestoreOptions {
756
+ safetyBackup?: boolean;
757
+ verify?: boolean;
758
+ dbInstance?: Database;
759
+ dbType?: string;
760
+ }
761
+
762
+ export interface DatabaseRestoreResult {
763
+ success: boolean;
764
+ restoredFrom: string;
765
+ targetFile: string;
766
+ preRestoreBackup?: string | null;
767
+ size?: number;
768
+ dbType: string;
769
+ }
770
+
735
771
  export class Database {
772
+ backup(options?: DatabaseBackupOptions): Promise<DatabaseBackupResult>;
773
+ restore(filePath: string, options?: DatabaseRestoreOptions): Promise<DatabaseRestoreResult>;
774
+ static backup(options?: DatabaseBackupOptions): Promise<DatabaseBackupResult>;
775
+ static restore(filePath: string, options?: DatabaseRestoreOptions): Promise<DatabaseRestoreResult>;
736
776
  type: string;
737
777
  constructor(connectionLimit?: number, queueLimit?: number, config?: any);
738
778
  init(retries?: number): Promise<boolean>;
@@ -1383,3 +1423,9 @@ declare module "@seip/bluebird-js/core/actions.js" {
1383
1423
  export default Actions;
1384
1424
  }
1385
1425
 
1426
+ declare module "@seip/bluebird-js/core/ai.js" {
1427
+ import { AI, ai, AIOptions, AIAskOptions, AIResult, AIStreamChunk } from "@seip/bluebird-js";
1428
+ export { AI, ai, AIOptions, AIAskOptions, AIResult, AIStreamChunk };
1429
+ export default AI;
1430
+ }
1431
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seip/bluebird-js",
3
- "version": "0.1.5",
3
+ "version": "0.1.6",
4
4
  "description": "Performance-first Node.js API and web framework with built-in JWT auth, HTML rendering, validation, BaseModel, and multi-level caching",
5
5
  "type": "module",
6
6
  "main": "core/app.js",