@alwatr/nitrobase-engine 8.0.0 → 9.1.1
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/LICENSE +373 -661
- package/README.md +0 -6
- package/dist/alwatr-nitrobase.d.ts +1 -1
- package/dist/alwatr-nitrobase.d.ts.map +1 -1
- package/dist/logger.d.ts.map +1 -1
- package/dist/main.js +5 -0
- package/dist/main.js.map +11 -0
- package/package.json +65 -61
- package/{dist/main.mjs → src/alwatr-nitrobase.ts} +208 -135
- package/src/logger.ts +4 -0
- package/src/main.ts +1 -0
- package/CHANGELOG.md +0 -300
- package/dist/main.cjs +0 -447
- package/dist/main.cjs.map +0 -7
- package/dist/main.mjs.map +0 -7
package/README.md
CHANGED
|
@@ -78,12 +78,6 @@ Explore the provided demo code (`collection.mjs`, `document.mjs`, `benchmark.mjs
|
|
|
78
78
|
|
|
79
79
|
The following companies, organizations, and individuals support Nitrobase ongoing maintenance and development. Become a Sponsor to get your logo on our README and website.
|
|
80
80
|
|
|
81
|
-
[](https://exirstudio.com)
|
|
82
|
-
|
|
83
81
|
### Contributing
|
|
84
82
|
|
|
85
83
|
Contributions are welcome! Please read our [contribution guidelines](https://github.com/Alwatr/.github/blob/next/CONTRIBUTING.md) before submitting a pull request.
|
|
86
|
-
|
|
87
|
-
### License
|
|
88
|
-
|
|
89
|
-
This project is licensed under the [AGPL-3.0 License](LICENSE).
|
|
@@ -120,7 +120,7 @@ export declare class AlwatrNitrobase {
|
|
|
120
120
|
* @param stat nitrobase file stat
|
|
121
121
|
* @param data initial data for the document
|
|
122
122
|
*/
|
|
123
|
-
|
|
123
|
+
private newStoreFile__;
|
|
124
124
|
/**
|
|
125
125
|
* Open a document with the given id and create and return a DocumentReference.
|
|
126
126
|
* If the document not exists or its not a document, an error is thrown.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"alwatr-nitrobase.d.ts","sourceRoot":"","sources":["../src/alwatr-nitrobase.ts"],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,IAAI,SAAS,UAAU,EAAE,UAAU,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IA+B7G;;;;;;;;;;;;;;;;OAgBG;IACU,cAAc,CAAC,KAAK,SAAS,UAAU,EAAE,YAAY,EAAE,WAAW,GAAG,OAAO,CAAC,mBAAmB,CAAC,KAAK,CAAC,CAAC;IAiCrH;;;;;;;;;OASG;IACI,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,IAAI;IAY9C;;;;;;;;;;;;;OAaG;IACU,WAAW,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IA0B7D;;;;;;;;OAQG;IACU,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;IAUrC;;;;;OAKG;YACW,aAAa;IAS3B;;;;;;;;OAQG;IACH,OAAO,CAAC,cAAc;IAMtB;;;;;OAKG;cACa,aAAa,CAAC,CAAC,SAAS,UAAU,EAAE,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,GAAG,mBAAmB,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC;IAevH;;OAEG;IACH,OAAO,CAAC,YAAY;IAgBpB;;OAEG;IACH,OAAO,CAAC,UAAU;IAYlB;;;;;;;;;;OAUG;IACI,YAAY,IAAI,cAAc,CAAC,IAAI,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC,EAAE;CAI1E"}
|
package/dist/logger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM,uCAAiD,CAAC"}
|
package/dist/main.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
/* 📦 @alwatr/nitrobase-engine v9.1.1 */
|
|
2
|
+
import{delay as H}from"@alwatr/delay";import{exitHook as k}from"@alwatr/exit-hook";import{getStoreId as U,getStorePath as X}from"@alwatr/nitrobase-helper";import{CollectionReference as V,DocumentReference as Y}from"@alwatr/nitrobase-reference";import{StoreFileType as O,StoreFileExtension as L,Region as D}from"@alwatr/nitrobase-types";import{existsSync as A,readJson as $,resolve as W,unlink as J,writeJson as j}from"@alwatr/node-fs";import{createLogger as G}from"@alwatr/logger";var B=G("@alwatr/nitrobase-engine");q:B.logFileModule?.("alwatr-nitrobase");class Z{config;static version="9.1.1";static rootDbStat__={name:".nitrobase",region:D.Secret,type:O.Collection,extension:L.Json,changeDebounce:40};rootDb__;cacheReferences__={};constructor(q){this.config=q;this.storeChanged_=this.storeChanged_.bind(this),B.logMethodArgs?.("new",q),this.config.defaultChangeDebounce??=40,this.rootDb__=this.loadRootDb__(),k(this.exitHook__.bind(this))}hasStore(q){let z=U(q),K=this.rootDb__.hasItem(z);return B.logMethodFull?.("hasStore",z,K),K}newDocument(q,z){return B.logMethodArgs?.("newDocument",q),this.newStoreFile__({...q,type:O.Document},z)}newCollection(q){return B.logMethodArgs?.("newCollection",q),this.newStoreFile__({...q,type:O.Collection})}newStoreFile__(q,z){B.logMethodArgs?.("newStoreFile__",q),q.changeDebounce??=this.config.defaultChangeDebounce;let K;if(q.type===O.Document){if(z===void 0)throw B.accident("newStoreFile__","document_data_required",q),Error("document_data_required",{cause:q});K=Y.newRefFromData(q,z,this.storeChanged_)}else if(q.type===O.Collection)K=V.newRefFromData(q,this.storeChanged_);else throw B.accident("newStoreFile__","store_file_type_not_supported",q),Error("store_file_type_not_supported",{cause:q});if(this.rootDb__.hasItem(K.id))throw B.accident("newStoreFile__","store_file_already_defined",q),Error("store_file_already_defined",{cause:q});this.rootDb__.addItem(K.id,q),this.cacheReferences__[K.id]=K,this.storeChanged_(K)}async openDocument(q){let z=U(q);if(B.logMethodArgs?.("openDocument",z),Object.hasOwn(this.cacheReferences__,z)){if(!(this.cacheReferences__[z]instanceof Y))throw B.accident("openDocument","document_wrong_type",z),Error("document_wrong_type",{cause:z});return this.cacheReferences__[z]}if(!this.rootDb__.hasItem(z))throw B.accident("openDocument","document_not_found",z),Error("document_not_found",{cause:z});let K=this.rootDb__.getItemData(z);if(K.type!=O.Document)throw B.accident("openDocument","document_wrong_type",z),Error("document_wrong_type",{cause:z});let Q=await this.readContext__(K),M=Y.newRefFromContext(Q,this.storeChanged_);return this.cacheReferences__[z]=M,M}async openCollection(q){let z=U(q);if(B.logMethodArgs?.("openCollection",z),Object.hasOwn(this.cacheReferences__,z)){if(!(this.cacheReferences__[z]instanceof V))throw B.accident("openCollection","collection_wrong_type",z),Error("collection_wrong_type",{cause:z});return this.cacheReferences__[z]}if(!this.rootDb__.hasItem(z))throw B.accident("openCollection","collection_not_found",z),Error("collection_not_found",{cause:z});let K=this.rootDb__.getItemData(z);if(K.type!=O.Collection)throw B.accident("openCollection","collection_wrong_type",z),Error("collection_not_found",{cause:z});let Q=await this.readContext__(K),M=V.newRefFromContext(Q,this.storeChanged_);return this.cacheReferences__[z]=M,M}unloadStore(q){let z=U(q);B.logMethodArgs?.("unloadStore",z);let K=this.cacheReferences__[z];if(K===void 0)return;if(K.hasUnprocessedChanges_===!0)K.updateDelayed_=!1,this.storeChanged_(K);delete this.cacheReferences__[z]}async removeStore(q){let z=U(q);if(B.logMethodArgs?.("removeStore",z),!this.rootDb__.hasItem(z))throw B.accident("removeStore","document_not_found",z),Error("document_not_found",{cause:z});let K=this.cacheReferences__[z];if(K!==void 0)K.freeze=!0,K.updateDelayed_=!1,K.hasUnprocessedChanges_=!1,delete this.cacheReferences__[z];let Q=X(this.rootDb__.getItemData(z));this.rootDb__.removeItem(z),await H.by(0);try{await J(W(this.config.rootPath,Q))}catch(M){B.error("removeStore","remove_file_failed",M,{id:q,path:Q})}}async saveAll(){B.logMethod?.("saveAll");for(let q of Object.values(this.cacheReferences__))if(q.hasUnprocessedChanges_===!0&&q.freeze!==!0)q.updateDelayed_=!1,await this.storeChanged_(q)}async readContext__(q){if(typeof q!=="string")q=X(q);B.logMethodArgs?.("readContext__",q),B.time?.(`readContext__time(${q})`);let z=await $(W(this.config.rootPath,q));return B.timeEnd?.(`readContext__time(${q})`),z}writeContext__(q,z){if(typeof q!=="string")q=X(q);return B.logMethodArgs?.("writeContext__",q),j(W(this.config.rootPath,q),z)}async storeChanged_(q){B.logMethodArgs?.("storeChanged__",q.id);let z=q.getStoreMeta().rev;try{if(await this.writeContext__(q.path,q.getFullContext_()),z===q.getStoreMeta().rev)q.hasUnprocessedChanges_=!1}catch(K){B.error("storeChanged__","write_context_failed",{id:q.id,error:K})}}loadRootDb__(){B.logMethod?.("loadRootDb__");let q=W(this.config.rootPath,X(Z.rootDbStat__));if(!A(q)){if(this.config.errorWhenNotInitialized===!0)throw Error("store_not_found",{cause:"Nitrobase not initialized"});return B.banner("Initialize new alwatr-nitrobase"),V.newRefFromData(Z.rootDbStat__,this.storeChanged_)}let z=$(q,!0);return V.newRefFromContext(z,this.storeChanged_,"root-db")}exitHook__(){B.logMethod?.("exitHook__");for(let q of Object.values(this.cacheReferences__))if(B.logProperty?.(`StoreFile.${q.id}.hasUnprocessedChanges`,q.hasUnprocessedChanges_),q.hasUnprocessedChanges_===!0&&q.freeze!==!0)B.incident?.("exitHook__","rescue_unsaved_context",{id:q.id}),j(W(this.config.rootPath,q.path),q.getFullContext_(),!0),q.hasUnprocessedChanges_=!1}getStoreList(){return B.logMethod?.("getStoreList"),this.rootDb__.values()}}export{Z as AlwatrNitrobase};
|
|
3
|
+
|
|
4
|
+
//# debugId=98AEB8E70931DE6764756E2164756E21
|
|
5
|
+
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/alwatr-nitrobase.ts", "../src/logger.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import {delay} from '@alwatr/delay';\nimport {exitHook} from '@alwatr/exit-hook';\nimport {getStoreId, getStorePath} from '@alwatr/nitrobase-helper';\nimport {CollectionReference, DocumentReference} from '@alwatr/nitrobase-reference';\nimport {\n StoreFileType,\n StoreFileExtension,\n Region,\n type StoreFileStat,\n type StoreFileContext,\n type CollectionContext,\n type DocumentContext,\n type StoreFileId,\n type CollectionItem,\n} from '@alwatr/nitrobase-types';\nimport {existsSync, readJson, resolve, unlink, writeJson} from '@alwatr/node-fs';\n\nimport {logger} from './logger.js';\n\n\n__dev_mode__: logger.logFileModule?.('alwatr-nitrobase');\n\n/**\n * AlwatrNitrobase configuration.\n */\nexport interface AlwatrNitrobaseConfig {\n /**\n * The root path of the storage.\n * This is where the AlwatrNitrobase will nitrobase its data.\n */\n rootPath: string;\n\n /**\n * The save debounce timeout in milliseconds for minimal disk I/O usage.\n * This is used to limit the frequency of disk writes for performance reasons.\n * The recommended value is `40`.\n */\n defaultChangeDebounce?: number;\n\n /**\n * If true, an error will be thrown when trying to read or write to a nitrobase file that is not initialized (new storage).\n * The default value is `false` but highly recommended to set it to `true` in production to prevent data loss.\n */\n errorWhenNotInitialized?: boolean;\n}\n\n/**\n * AlwatrNitrobase engine.\n *\n * It provides methods to read, write, validate, and manage nitrobase files.\n * It also provides methods to interact with `documents` and `collections` in the nitrobase.\n */\nexport class AlwatrNitrobase {\n /**\n * The Alwatr Nitrobase version string.\n *\n * Use for nitrobase file format version for check compatibility.\n */\n public static readonly version = __package_version__;\n\n /**\n * The root nitrobase file stat.\n */\n private static readonly rootDbStat__: StoreFileStat = {\n name: '.nitrobase',\n region: Region.Secret,\n type: StoreFileType.Collection,\n extension: StoreFileExtension.Json,\n changeDebounce: 40,\n };\n\n /**\n * `collectionReference` of all `storeFileStat`s.\n * This is the root nitrobase collection.\n */\n private rootDb__;\n\n /**\n * Keep all loaded nitrobase file context loaded in memory.\n */\n private cacheReferences__: DictionaryReq<DocumentReference | CollectionReference> = {};\n\n /**\n * Constructs an AlwatrNitrobase instance with the provided configuration.\n *\n * @param config The configuration of the AlwatrNitrobase engine.\n * @example\n * ```typescript\n * const alwatrStore = new AlwatrNitrobase({\n * rootPath: './db',\n * saveDebounce: 40,\n * });\n * ```\n */\n constructor(public readonly config: AlwatrNitrobaseConfig) {\n this.storeChanged_ = this.storeChanged_.bind(this);\n\n logger.logMethodArgs?.('new', config);\n this.config.defaultChangeDebounce ??= 40;\n this.rootDb__ = this.loadRootDb__();\n exitHook(this.exitHook__.bind(this));\n }\n\n /**\n * Checks if a nitrobase file with the given ID exists.\n *\n * @param storeId - The ID of the nitrobase file to check.\n * @returns `true` if the nitrobase file exists, `false` otherwise.\n * @example\n * ```typescript\n * if (!alwatrStore.hasStore('user1/profile')) {\n * alwatrStore.defineDocument(...)\n * }\n * ```\n */\n public hasStore(storeId: StoreFileId): boolean {\n const id_ = getStoreId(storeId);\n const exists = this.rootDb__.hasItem(id_);\n logger.logMethodFull?.('hasStore', id_, exists);\n return exists;\n }\n\n /**\n * Defines a new document with the given configuration and initial data.\n * If a document with the same ID already exists, an error is thrown.\n *\n * @param stat nitrobase file stat\n * @param data initial data for the document\n * @template TDoc document data type\n * @example\n * ```typescript\n * await alwatrStore.newDocument<Order>(\n * {\n * name: 'profile',\n * region: Region.PerUser,\n * ownerId: 'user1',\n * },\n * {\n * name: 'Ali',\n * email: 'ali@alwatr.io',\n * }\n * );\n * ```\n */\n public newDocument<TDoc extends JsonObject = JsonObject>(stat: Omit<StoreFileStat, 'type'>, data: TDoc): void {\n logger.logMethodArgs?.('newDocument', stat);\n return this.newStoreFile__(\n {\n ...stat,\n type: StoreFileType.Document,\n },\n data,\n );\n }\n\n /**\n * Defines a new collection with the given configuration and initial data.\n * If a collection with the same ID already exists, an error is thrown.\n *\n * @param stat nitrobase file stat\n * @example\n * ```typescript\n * await alwatrStore.newCollection<Order>(\n * {\n * name: 'orders',\n * region: Region.PerUser,\n * ownerId: 'user1',\n * }\n * );\n * ```\n */\n public newCollection(stat: Omit<StoreFileStat, 'type'>): void {\n logger.logMethodArgs?.('newCollection', stat);\n return this.newStoreFile__({\n ...stat,\n type: StoreFileType.Collection,\n });\n }\n\n /**\n * Defines a AlwatrNitrobaseFile with the given configuration and initial data.\n *\n * @param stat nitrobase file stat\n * @param data initial data for the document\n */\n private newStoreFile__(stat: StoreFileStat, data?: DictionaryOpt): void {\n logger.logMethodArgs?.('newStoreFile__', stat);\n\n (stat.changeDebounce as number | undefined) ??= this.config.defaultChangeDebounce;\n\n let fileStoreRef: DocumentReference | CollectionReference;\n if (stat.type === StoreFileType.Document) {\n if (data === undefined) {\n logger.accident('newStoreFile__', 'document_data_required', stat);\n throw new Error('document_data_required', {cause: stat});\n }\n fileStoreRef = DocumentReference.newRefFromData(stat, data, this.storeChanged_);\n }\n else if (stat.type === StoreFileType.Collection) {\n fileStoreRef = CollectionReference.newRefFromData(stat, this.storeChanged_);\n }\n else {\n logger.accident('newStoreFile__', 'store_file_type_not_supported', stat);\n throw new Error('store_file_type_not_supported', {cause: stat});\n }\n\n if (this.rootDb__.hasItem(fileStoreRef.id)) {\n logger.accident('newStoreFile__', 'store_file_already_defined', stat);\n throw new Error('store_file_already_defined', {cause: stat});\n }\n\n this.rootDb__.addItem(fileStoreRef.id, stat);\n this.cacheReferences__[fileStoreRef.id] = fileStoreRef;\n\n // fileStoreRef.save();\n this.storeChanged_(fileStoreRef);\n }\n\n /**\n * Open a document with the given id and create and return a DocumentReference.\n * If the document not exists or its not a document, an error is thrown.\n *\n * @template TDoc document data type\n * @param documentId document id {@link StoreFileId}\n * @returns document reference {@link DocumentReference}\n * @example\n * ```typescript\n * const userProfile = await alwatrStore.openDocument<User>({\n * name: 'user1/profile',\n * region: Region.PerUser,\n * ownerId: 'user1',\n * });\n * userProfile.update({name: 'ali'});\n * ```\n */\n public async openDocument<TDoc extends JsonObject>(documentId: StoreFileId): Promise<DocumentReference<TDoc>> {\n const id = getStoreId(documentId);\n logger.logMethodArgs?.('openDocument', id);\n\n if (Object.hasOwn(this.cacheReferences__, id)) {\n const ref = this.cacheReferences__[id];\n if (!(ref instanceof DocumentReference)) {\n logger.accident('openDocument', 'document_wrong_type', id);\n throw new Error('document_wrong_type', {cause: id});\n }\n return this.cacheReferences__[id] as unknown as DocumentReference<TDoc>;\n }\n\n if (!this.rootDb__.hasItem(id)) {\n logger.accident('openDocument', 'document_not_found', id);\n throw new Error('document_not_found', {cause: id});\n }\n\n const storeStat = this.rootDb__.getItemData(id);\n\n if (storeStat.type != StoreFileType.Document) {\n logger.accident('openDocument', 'document_wrong_type', id);\n throw new Error('document_wrong_type', {cause: id});\n }\n\n const context = await this.readContext__<DocumentContext<TDoc>>(storeStat);\n const docRef = DocumentReference.newRefFromContext(context, this.storeChanged_);\n this.cacheReferences__[id] = docRef as unknown as DocumentReference;\n return docRef;\n }\n\n /**\n * Open a collection with the given id and create and return a CollectionReference.\n * If the collection not exists or its not a collection, an error is thrown.\n *\n * @template TItem collection item data type\n * @param collectionId collection id {@link StoreFileId}\n * @returns collection reference {@link CollectionReference}\n * @example\n * ```typescript\n * const orders = await alwatrStore.openCollection<Order>({\n * name: 'orders',\n * region: Region.PerUser,\n * ownerId: 'user1',\n * });\n * orders.append({name: 'order 1'});\n * ```\n */\n public async openCollection<TItem extends JsonObject>(collectionId: StoreFileId): Promise<CollectionReference<TItem>> {\n const id = getStoreId(collectionId);\n logger.logMethodArgs?.('openCollection', id);\n\n // try to get from cache\n if (Object.hasOwn(this.cacheReferences__, id)) {\n const ref = this.cacheReferences__[id];\n if (!(ref instanceof CollectionReference)) {\n logger.accident('openCollection', 'collection_wrong_type', id);\n throw new Error('collection_wrong_type', {cause: id});\n }\n return this.cacheReferences__[id] as unknown as CollectionReference<TItem>;\n }\n\n // load and create new collection reference\n if (!this.rootDb__.hasItem(id)) {\n logger.accident('openCollection', 'collection_not_found', id);\n throw new Error('collection_not_found', {cause: id});\n }\n\n const storeStat = this.rootDb__.getItemData(id);\n\n if (storeStat.type != StoreFileType.Collection) {\n logger.accident('openCollection', 'collection_wrong_type', id);\n throw new Error('collection_not_found', {cause: id});\n }\n\n const context = await this.readContext__<CollectionContext<TItem>>(storeStat);\n const colRef = CollectionReference.newRefFromContext(context, this.storeChanged_);\n this.cacheReferences__[id] = colRef as unknown as CollectionReference;\n return colRef;\n }\n\n /**\n * Unloads the nitrobase file with the given id from memory.\n *\n * @param storeId The unique identifier of the nitrobase file. {@link StoreFileId}\n * @example\n * ```typescript\n * alwatrStore.unloadStore({name: 'user-list', region: Region.Secret});\n * alwatrStore.hasStore({name: 'user-list', region: Region.Secret}); // true\n * ```\n */\n public unloadStore(storeId: StoreFileId): void {\n const id_ = getStoreId(storeId);\n logger.logMethodArgs?.('unloadStore', id_);\n const ref = this.cacheReferences__[id_];\n if (ref === undefined) return;\n if (ref.hasUnprocessedChanges_ === true) {\n ref.updateDelayed_ = false;\n this.storeChanged_(ref);\n }\n delete this.cacheReferences__[id_];\n }\n\n /**\n * Remove document or collection from nitrobase and delete the file from disk.\n * If the file is not found, an error is thrown.\n * If the file is not unloaded, it will be unloaded first.\n * You don't need to await this method to complete unless you want to make sure the file is deleted on disk.\n *\n * @param storeId The ID of the file to delete. {@link StoreFileId}\n * @returns A Promise that resolves when the file is deleted.\n * @example\n * ```typescript\n * alwatrStore.removeStore({name: 'user-list', region: Region.Secret});\n * alwatrStore.hasStore({name: 'user-list', region: Region.Secret}); // false\n * ```\n */\n public async removeStore(storeId: StoreFileId): Promise<void> {\n const id_ = getStoreId(storeId);\n logger.logMethodArgs?.('removeStore', id_);\n if (!this.rootDb__.hasItem(id_)) {\n logger.accident('removeStore', 'document_not_found', id_);\n throw new Error('document_not_found', {cause: id_});\n }\n const ref = this.cacheReferences__[id_];\n if (ref !== undefined) {\n // direct unload to prevent save\n ref.freeze = true;\n ref.updateDelayed_ = false;\n ref.hasUnprocessedChanges_ = false;\n delete this.cacheReferences__[id_]; // unload\n }\n const path = getStorePath(this.rootDb__.getItemData(id_));\n this.rootDb__.removeItem(id_);\n await delay.by(0);\n try {\n await unlink(resolve(this.config.rootPath, path));\n }\n catch (error) {\n logger.error('removeStore', 'remove_file_failed', error, {id: storeId, path});\n }\n }\n\n /**\n * Saves all changes in the nitrobase.\n *\n * @returns A Promise that resolves when all changes are saved.\n * @example\n * ```typescript\n * await alwatrStore.saveAll();\n * ```\n */\n public async saveAll(): Promise<void> {\n logger.logMethod?.('saveAll');\n for (const ref of Object.values(this.cacheReferences__)) {\n if (ref.hasUnprocessedChanges_ === true && ref.freeze !== true) {\n ref.updateDelayed_ = false;\n await this.storeChanged_(ref);\n }\n }\n }\n\n /**\n * Reads the context from a given path or StoreFileStat object.\n *\n * @param path The path or StoreFileStat object from which to read the context.\n * @returns A promise that resolves to the context object.\n */\n private async readContext__<T extends StoreFileContext>(path: string | StoreFileStat): Promise<T> {\n if (typeof path !== 'string') path = getStorePath(path);\n logger.logMethodArgs?.('readContext__', path);\n logger.time?.(`readContext__time(${path})`);\n const context = (await readJson(resolve(this.config.rootPath, path))) as T;\n logger.timeEnd?.(`readContext__time(${path})`);\n return context;\n }\n\n /**\n * Writes the context to the specified path.\n *\n * @template T The type of the context.\n * @param path The path where the context will be written.\n * @param context The context to be written.\n * @param sync Indicates whether the write operation should be synchronous.\n * @returns A promise that resolves when the write operation is complete.\n */\n private writeContext__<T extends StoreFileContext>(path: string | StoreFileStat, context: T): Promise<void> {\n if (typeof path !== 'string') path = getStorePath(path);\n logger.logMethodArgs?.('writeContext__', path);\n return writeJson(resolve(this.config.rootPath, path), context);\n }\n\n /**\n * Write nitrobase file context.\n *\n * @param from nitrobase file reference\n * @returns A promise that resolves when the write operation is complete.\n */\n protected async storeChanged_<T extends JsonObject>(from: DocumentReference<T> | CollectionReference<T>): Promise<void> {\n logger.logMethodArgs?.('storeChanged__', from.id);\n const rev = from.getStoreMeta().rev;\n try {\n await this.writeContext__(from.path, from.getFullContext_());\n if (rev === from.getStoreMeta().rev) {\n // Context not changed during saving\n from.hasUnprocessedChanges_ = false;\n }\n }\n catch (error) {\n logger.error('storeChanged__', 'write_context_failed', {id: from.id, error});\n }\n }\n\n /**\n * Load storeFilesCollection or create new one.\n */\n private loadRootDb__(): CollectionReference<StoreFileStat> {\n logger.logMethod?.('loadRootDb__');\n const fullPath = resolve(this.config.rootPath, getStorePath(AlwatrNitrobase.rootDbStat__));\n if (!existsSync(fullPath)) {\n if (this.config.errorWhenNotInitialized === true) {\n throw new Error('store_not_found', {cause: 'Nitrobase not initialized'});\n }\n\n logger.banner('Initialize new alwatr-nitrobase');\n return CollectionReference.newRefFromData(AlwatrNitrobase.rootDbStat__, this.storeChanged_);\n }\n // else\n const context = readJson<CollectionContext<StoreFileStat>>(fullPath, true);\n return CollectionReference.newRefFromContext(context, this.storeChanged_, 'root-db');\n }\n\n /**\n * Save all nitrobase files.\n */\n private exitHook__(): void {\n logger.logMethod?.('exitHook__');\n for (const ref of Object.values(this.cacheReferences__)) {\n logger.logProperty?.(`StoreFile.${ref.id}.hasUnprocessedChanges`, ref.hasUnprocessedChanges_);\n if (ref.hasUnprocessedChanges_ === true && ref.freeze !== true) {\n logger.incident?.('exitHook__', 'rescue_unsaved_context', {id: ref.id});\n writeJson(resolve(this.config.rootPath, ref.path), ref.getFullContext_(), true);\n ref.hasUnprocessedChanges_ = false;\n }\n }\n }\n\n /**\n * Get all nitrobase files.\n *\n * @returns all nitrobase files.\n * @example\n * ```typescript\n * const storeList = alwatrStore.getStoreList();\n * for (const nitrobase of storeList) {\n * console.log(nitrobase.meta.id, nitrobase.data);\n * }\n */\n public getStoreList(): CollectionItem<Omit<StoreFileStat, 'schemaVer'>>[] {\n logger.logMethod?.('getStoreList');\n return this.rootDb__.values();\n }\n}\n",
|
|
6
|
+
"import {createLogger} from '@alwatr/logger';\n\n\nexport const logger = /* #__PURE__ */ createLogger(__package_name__);\n"
|
|
7
|
+
],
|
|
8
|
+
"mappings": ";AAAA,gBAAQ,sBACR,mBAAQ,0BACR,qBAAQ,kBAAY,iCACpB,8BAAQ,uBAAqB,oCAC7B,wBACE,wBACA,YACA,gCAQF,qBAAQ,cAAY,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EACjC,IAAM,EAAW,EAAQ,KAAK,OAAO,SAAU,EAAa,EAAgB,YAAY,CAAC,EACzF,GAAI,CAAC,EAAW,CAAQ,EAAG,CACzB,GAAI,KAAK,OAAO,0BAA4B,GAC1C,MAAU,MAAM,kBAAmB,CAAC,MAAO,2BAA2B,CAAC,EAIzE,OADA,EAAO,OAAO,iCAAiC,EACxC,EAAoB,eAAe,EAAgB,aAAc,KAAK,aAAa,EAG5F,IAAM,EAAU,EAA2C,EAAU,EAAI,EACzE,OAAO,EAAoB,kBAAkB,EAAS,KAAK,cAAe,SAAS,EAM7E,UAAU,EAAS,CACzB,EAAO,YAAY,YAAY,EAC/B,QAAW,KAAO,OAAO,OAAO,KAAK,iBAAiB,EAEpD,GADA,EAAO,cAAc,aAAa,EAAI,2BAA4B,EAAI,sBAAsB,EACxF,EAAI,yBAA2B,IAAQ,EAAI,SAAW,GACxD,EAAO,WAAW,aAAc,yBAA0B,CAAC,GAAI,EAAI,EAAE,CAAC,EACtE,EAAU,EAAQ,KAAK,OAAO,SAAU,EAAI,IAAI,EAAG,EAAI,gBAAgB,EAAG,EAAI,EAC9E,EAAI,uBAAyB,GAgB5B,YAAY,EAAuD,CAExE,OADA,EAAO,YAAY,cAAc,EAC1B,KAAK,SAAS,OAAO,EAEhC",
|
|
9
|
+
"debugId": "98AEB8E70931DE6764756E2164756E21",
|
|
10
|
+
"names": []
|
|
11
|
+
}
|
package/package.json
CHANGED
|
@@ -1,77 +1,81 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwatr/nitrobase-engine",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "9.1.1",
|
|
4
4
|
"description": "Nitrobase is a blazingly fast, lightweight database built on JSON. It stores data entirely in memory for lightning-quick access, while also providing a JSON file backup for persistence. You can easily serve your data over the web using our high-performance accelerated Nginx server.",
|
|
5
|
-
"
|
|
6
|
-
"
|
|
7
|
-
"database",
|
|
8
|
-
"storage",
|
|
9
|
-
"json",
|
|
10
|
-
"nosql",
|
|
11
|
-
"no-sql",
|
|
12
|
-
"data",
|
|
13
|
-
"data-storage",
|
|
14
|
-
"file",
|
|
15
|
-
"typescript",
|
|
16
|
-
"esm",
|
|
17
|
-
"alwatr"
|
|
18
|
-
],
|
|
5
|
+
"license": "MPL-2.0",
|
|
6
|
+
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com> (https://ali.mihandoost.com)",
|
|
19
7
|
"type": "module",
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/Alwatr/alwatr",
|
|
11
|
+
"directory": "pkg/nitrobase-old/engine"
|
|
12
|
+
},
|
|
13
|
+
"homepage": "https://github.com/Alwatr/alwatr/tree/next/pkg/nitrobase-old/engine#readme",
|
|
14
|
+
"bugs": "https://github.com/Alwatr/alwatr/issues",
|
|
23
15
|
"exports": {
|
|
24
16
|
".": {
|
|
25
17
|
"types": "./dist/main.d.ts",
|
|
26
|
-
"import": "./dist/main.
|
|
27
|
-
"
|
|
18
|
+
"import": "./dist/main.js",
|
|
19
|
+
"default": "./dist/main.js"
|
|
28
20
|
}
|
|
29
21
|
},
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
"type": "
|
|
40
|
-
"url": "https://github.com/Alwatr/nitrobase",
|
|
41
|
-
"directory": "packages/engine"
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@alwatr/delay": "9.1.1",
|
|
25
|
+
"@alwatr/exit-hook": "9.1.1",
|
|
26
|
+
"@alwatr/logger": "9.1.1",
|
|
27
|
+
"@alwatr/nitrobase-helper": "^9.1.1",
|
|
28
|
+
"@alwatr/nitrobase-reference": "^9.1.1",
|
|
29
|
+
"@alwatr/nitrobase-types": "^9.1.1",
|
|
30
|
+
"@alwatr/node-fs": "9.1.1",
|
|
31
|
+
"@alwatr/type-helper": "9.1.1"
|
|
42
32
|
},
|
|
43
|
-
"
|
|
44
|
-
|
|
45
|
-
"
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"@alwatr/nano-build": "9.1.1",
|
|
35
|
+
"@alwatr/tsconfig-base": "9.1.1",
|
|
36
|
+
"@alwatr/type-helper": "workspace:*",
|
|
37
|
+
"@types/node": "^25.5.0",
|
|
38
|
+
"typescript": "^6.0.2"
|
|
46
39
|
},
|
|
47
|
-
"prettier": "@alwatr/prettier-config",
|
|
48
40
|
"scripts": {
|
|
49
|
-
"b": "
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"cb": "yarn run clean && yarn run build",
|
|
53
|
-
"d": "yarn node --enable-source-maps --trace-warnings",
|
|
54
|
-
"build": "yarn run build:ts & yarn run build:es",
|
|
55
|
-
"build:es": "nano-build --preset=module",
|
|
41
|
+
"b": "bun run build",
|
|
42
|
+
"build": "bun run build:ts && bun run build:es",
|
|
43
|
+
"build:es": "nano-build --preset=module src/main.ts",
|
|
56
44
|
"build:ts": "tsc --build",
|
|
57
|
-
"
|
|
58
|
-
"
|
|
59
|
-
"
|
|
60
|
-
"
|
|
45
|
+
"cl": "bun run clean",
|
|
46
|
+
"clean": "rm -rfv dist *.tsbuildinfo",
|
|
47
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
48
|
+
"lint": "eslint src/ --ext .ts",
|
|
49
|
+
"t": "bun run test",
|
|
50
|
+
"test": "ALWATR_DEBUG=0 bun test",
|
|
51
|
+
"w": "bun run watch",
|
|
52
|
+
"watch": "bun run watch:ts & bun run watch:es",
|
|
53
|
+
"watch:es": "bun run build:es --watch",
|
|
54
|
+
"watch:ts": "bun run build:ts --watch --preserveWatchOutput"
|
|
61
55
|
},
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
"@alwatr/tsconfig-base": "^5.0.0",
|
|
72
|
-
"@alwatr/type-helper": "^5.3.0",
|
|
73
|
-
"@types/node": "^22.13.4",
|
|
74
|
-
"typescript": "^5.7.3"
|
|
56
|
+
"files": [
|
|
57
|
+
"dist",
|
|
58
|
+
"src/**/*.ts",
|
|
59
|
+
"!src/**/*.test.ts",
|
|
60
|
+
"README.md",
|
|
61
|
+
"LICENSE"
|
|
62
|
+
],
|
|
63
|
+
"publishConfig": {
|
|
64
|
+
"access": "public"
|
|
75
65
|
},
|
|
76
|
-
"
|
|
66
|
+
"keywords": [
|
|
67
|
+
"alwatr",
|
|
68
|
+
"data",
|
|
69
|
+
"data-storage",
|
|
70
|
+
"database",
|
|
71
|
+
"esm",
|
|
72
|
+
"file",
|
|
73
|
+
"json",
|
|
74
|
+
"no-sql",
|
|
75
|
+
"nosql",
|
|
76
|
+
"storage",
|
|
77
|
+
"typescript"
|
|
78
|
+
],
|
|
79
|
+
"prettier": "@alwatr/nanolib/prettier-config",
|
|
80
|
+
"gitHead": "38fb79dd8b6cf48108ae6492ecd7a285c7633e9b"
|
|
77
81
|
}
|