@alwatr/nitrobase-reference 7.10.1 → 9.1.0
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/dist/logger.d.ts.map +1 -1
- package/dist/main.js +5 -0
- package/dist/main.js.map +12 -0
- package/package.json +52 -48
- package/src/collection-reference.ts +684 -0
- package/src/document-reference.ts +429 -0
- package/src/logger.ts +4 -0
- package/src/main.ts +2 -0
- package/CHANGELOG.md +0 -417
- package/dist/main.cjs +0 -4
- package/dist/main.cjs.map +0 -7
- package/dist/main.mjs +0 -4
- package/dist/main.mjs.map +0 -7
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-reference v9.1.0 */
|
|
2
|
+
import{delay as N}from"@alwatr/delay";import{createLogger as Y}from"@alwatr/logger";import{getStoreId as Z,getStorePath as $}from"@alwatr/nitrobase-helper";import{StoreFileType as O,StoreFileExtension as L}from"@alwatr/nitrobase-types";import{createLogger as X}from"@alwatr/logger";var B=X("@alwatr/nitrobase-reference");q:B.logFileModule?.("collection-reference");class G{context__;updatedCallback__;static version="9.1.0";static fileFormatVersion=3;static newRefFromData(q,z,A){B.logMethodArgs?.("col.newRefFromData",q);let J=Date.now(),K={ok:!0,meta:{...q,rev:1,updated:J,created:J,lastAutoId:0,type:O.Collection,extension:L.Json,fv:G.fileFormatVersion,extra:{}},data:{}};return new G(K,z,A)}static newRefFromContext(q,z,A){return B.logMethodArgs?.("col.newRefFromContext",q.meta),new G(q,z,A)}validateContext__(){if(this.logger__.logMethod?.("validateContext__"),this.context__.ok!==!0)throw this.logger__.accident?.("validateContext__","store_not_ok"),Error("store_not_ok",{cause:{context:this.context__}});if(this.context__.meta===void 0)throw this.logger__.accident?.("validateContext__","store_meta_undefined"),Error("store_meta_undefined",{cause:{context:this.context__}});if(this.context__.meta.type!==O.Collection)throw this.logger__.accident?.("validateContext__","collection_type_invalid",this.context__.meta),Error("collection_type_invalid",{cause:this.context__.meta});if(this.context__.meta.fv!==G.fileFormatVersion)this.logger__.incident?.("validateContext__","store_file_version_incompatible",{old:this.context__.meta.fv,new:G.fileFormatVersion}),this.migrateContext__()}migrateContext__(){if(this.context__.meta.fv===G.fileFormatVersion)return;if(this.logger__.logMethod?.("migrateContext__"),this.context__.meta.fv>G.fileFormatVersion)throw this.logger__.accident("migrateContext__","store_version_incompatible",this.context__.meta),Error("store_version_incompatible",{cause:this.context__.meta});if(this.context__.meta.fv===1)this.context__.meta.fv=2;if(this.context__.meta.fv===2){if(this.context__.meta.schemaVer===void 0||this.context__.meta.schemaVer===0)this.context__.meta.schemaVer=1;delete this.context__.meta.ver,this.context__.meta.extra??={},this.context__.meta.fv=3}this.updated__()}id;path;hasUnprocessedChanges_=!1;logger__;constructor(q,z,A){this.context__=q;this.updatedCallback__=z;this.id=Z(this.context__.meta),this.path=$(this.context__.meta),A??=this.id.slice(0,20),this.logger__=Y(`col:${A}`),this.logger__.logMethodArgs?.("new",{id:this.id}),this.validateContext__()}get schemaVer(){return this.context__.meta.schemaVer??1}set schemaVer(q){this.logger__.logMethodArgs?.("set schemaVer",{old:this.context__.meta.schemaVer,new:q}),this.context__.meta.schemaVer=q,this.updated__()}_freeze=!1;get freeze(){return this._freeze}set freeze(q){this.logger__.logMethodArgs?.("freeze changed",{value:q}),this._freeze=q}hasItem(q){let z=Object.hasOwn(this.context__.data,q);return this.logger__.logMethodFull?.("hasItem",q,z),z}getStoreMeta(){return this.logger__.logMethod?.("getStoreMeta"),this.context__.meta}item__(q){let z=this.context__.data[q];if(z===void 0)throw this.logger__.accident("item__","collection_item_not_found",{itemId:q}),Error("collection_item_not_found",{cause:{itemId:q}});return z}getItemMeta(q){let z=this.item__(q).meta;return this.logger__.logMethodFull?.("getItemMeta",q,z),z}getItemData(q){return this.logger__.logMethodArgs?.("getItemData",q),this.item__(q).data}getItemContext_(q){return this.logger__.logMethodArgs?.("getItemContext_",q),this.context__.data[q]}addItem(q,z){if(this.logger__.logMethodArgs?.("addItem",{itemId:q,data:z}),this.hasItem(q))throw this.logger__.accident("addItem","collection_item_exist",{itemId:q}),Error("collection_item_exist",{cause:{itemId:q}});let A=Date.now();this.context__.data[q]={meta:{id:q,rev:0,created:A,updated:A},data:z},this.updated__(q)}appendItem(q){this.logger__.logMethodArgs?.("appendItem",q);let z=this.nextAutoIncrementId__();return this.addItem(z,q),z}removeItem(q){this.logger__.logMethodArgs?.("removeItem",q),delete this.context__.data[q],this.updated__()}replaceItemData(q,z){this.logger__.logMethodArgs?.("replaceItemData",{itemId:q,data:z}),this.item__(q).data=z,this.updated__(q)}mergeItemData(q,z){this.logger__.logMethodArgs?.("mergeItemData",{itemId:q,data:z}),Object.assign(this.item__(q).data,z),this.updated__(q)}save(q){this.logger__.logMethod?.("save"),this.updated__(q,!1)}saveImmediate(q){this.logger__.logMethod?.("saveImmediate"),this.updated__(q,!0)}keys(){return this.logger__.logMethod?.("keys"),Object.keys(this.context__.data)}values(){return this.logger__.logMethod?.("values"),Object.values(this.context__.data)}*ids(){this.logger__.logMethod?.("ids");for(let q in this.context__.data)yield q}*items(){this.logger__.logMethod?.("items");for(let q in this.context__.data)yield this.context__.data[q]}getFullContext_(){return this.logger__.logMethod?.("getFullContext_"),this.context__}updateDelayed_=!1;async updated__(q=null,z=!1){if(this.logger__.logMethodArgs?.("updated__",{id:q,immediate:z,delayed:this.updateDelayed_}),this.hasUnprocessedChanges_=!0,q!==null)this.refreshMeta_(q);if(z===!1&&this.updateDelayed_===!0)return;if(this.updateDelayed_=!0,z===!0||this.context__.meta.changeDebounce===void 0)await N.nextMacrotask();else await N.by(this.context__.meta.changeDebounce);if(this.updateDelayed_!==!0)return;if(this.updateDelayed_=!1,q===null)this.refreshMeta_(q);if(this._freeze===!0)return;this.updatedCallback__(this)}refreshMeta_(q){this.logger__.logMethodArgs?.("refreshMeta_",{id:q});let z=Date.now();if(this.context__.meta.rev++,this.context__.meta.updated=z,q!==null){let A=this.item__(q).meta;A.rev++,A.updated=z}}nextAutoIncrementId__(){this.logger__.logMethod?.("nextAutoIncrementId__");let q=this.context__.meta;do q.lastAutoId++;while(q.lastAutoId in this.context__.data);return q.lastAutoId}getExtraMeta(){return this.logger__.logMethod?.("getExtraMeta"),this.context__.meta.extra}replaceExtraMeta(q){this.logger__.logMethodArgs?.("replaceExtraMeta",q),this.context__.meta.extra=q,this.updated__()}mergeExtraMeta(q){this.logger__.logMethodArgs?.("mergeExtraMeta",q),Object.assign(this.context__.meta.extra,q),this.updated__()}}import{delay as Q}from"@alwatr/delay";import{createLogger as j}from"@alwatr/logger";import{getStoreId as P,getStorePath as U}from"@alwatr/nitrobase-helper";import{StoreFileType as V,StoreFileExtension as E}from"@alwatr/nitrobase-types";q:B.logFileModule?.("document-reference");class H{context__;updatedCallback__;static version="9.1.0";static fileFormatVersion=3;static newRefFromData(q,z,A,J){B.logMethodArgs?.("doc.newRefFromData",q);let K=Date.now(),W={ok:!0,meta:{...q,rev:1,updated:K,created:K,type:V.Document,extension:E.Json,fv:H.fileFormatVersion,extra:{}},data:z};return new H(W,A,J)}static newRefFromContext(q,z,A){return B.logMethodArgs?.("doc.newRefFromContext",q.meta),new H(q,z,A)}validateContext__(){if(this.logger__.logMethod?.("validateContext__"),this.context__.ok!==!0)throw this.logger__.accident?.("validateContext__","store_not_ok"),Error("store_not_ok",{cause:{context:this.context__}});if(this.context__.meta===void 0)throw this.logger__.accident?.("validateContext__","store_meta_undefined"),Error("store_meta_undefined",{cause:{context:this.context__}});if(this.context__.meta.type!==V.Document)throw this.logger__.accident?.("validateContext__","document_type_invalid",this.context__.meta),Error("document_type_invalid",{cause:this.context__.meta});if(this.context__.meta.fv!==H.fileFormatVersion)this.logger__.incident?.("validateContext__","store_file_version_incompatible",{old:this.context__.meta.fv,new:H.fileFormatVersion}),this.migrateContext__()}migrateContext__(){if(this.context__.meta.fv===H.fileFormatVersion)return;if(this.logger__.logMethod?.("migrateContext__"),this.context__.meta.fv>H.fileFormatVersion)throw this.logger__.accident("migrateContext__","store_version_incompatible",this.context__.meta),Error("store_version_incompatible",{cause:this.context__.meta});if(this.context__.meta.fv===1)this.context__.meta.fv=2;if(this.context__.meta.fv===2){if(this.context__.meta.schemaVer===void 0||this.context__.meta.schemaVer===0)this.context__.meta.schemaVer=1;delete this.context__.meta.ver,this.context__.meta.extra??={},this.context__.meta.fv=3}this.updated__()}id;path;hasUnprocessedChanges_=!1;logger__;constructor(q,z,A){this.context__=q;this.updatedCallback__=z;this.id=P(this.context__.meta),this.path=U(this.context__.meta),A??=this.id.slice(0,20),this.logger__=j(`doc:${A}`),this.logger__.logMethodArgs?.("new",{path:this.path}),this.validateContext__()}get schemaVer(){return this.context__.meta.schemaVer??1}set schemaVer(q){this.logger__.logMethodArgs?.("set schemaVer",{old:this.context__.meta.schemaVer,new:q}),this.context__.meta.schemaVer=q,this.updated__()}_freeze=!1;get freeze(){return this._freeze}set freeze(q){this.logger__.logMethodArgs?.("freeze changed",{value:q}),this._freeze=q}getData(){return this.logger__.logMethod?.("getData"),this.context__.data}getStoreMeta(){return this.logger__.logMethod?.("getStoreMeta"),this.context__.meta}replaceData(q){this.logger__.logMethodArgs?.("replaceData",q),this.context__.data=q,this.updated__()}mergeData(q){this.logger__.logMethodArgs?.("mergeData",q),Object.assign(this.context__.data,q),this.updated__()}save(){this.logger__.logMethod?.("save"),this.updated__()}saveImmediate(){this.logger__.logMethod?.("saveImmediate"),this.updated__(!0)}getFullContext_(){return this.logger__.logMethod?.("getFullContext_"),this.context__}updateDelayed_=!1;async updated__(q=!1){if(this.logger__.logMethodArgs?.("updated__",{immediate:q,delayed:this.updateDelayed_}),this.hasUnprocessedChanges_=!0,q!==!0&&this.updateDelayed_===!0)return;if(this.updateDelayed_=!0,q===!0||this.context__.meta.changeDebounce===void 0)await Q.nextMacrotask();else await Q.by(this.context__.meta.changeDebounce);if(this.updateDelayed_!==!0)return;if(this.updateDelayed_=!1,this.refreshMetadata_(),this._freeze===!0)return;this.updatedCallback__(this)}refreshMetadata_(){this.logger__.logMethod?.("refreshMetadata_"),this.context__.meta.updated=Date.now(),this.context__.meta.rev++}getExtraMeta(){return this.logger__.logMethod?.("getExtraMeta"),this.context__.meta.extra}replaceExtraMeta(q){this.logger__.logMethodArgs?.("replaceExtraMeta",q),this.context__.meta.extra=q,this.updated__()}mergeExtraMeta(q){this.logger__.logMethodArgs?.("mergeExtraMeta",q),Object.assign(this.context__.meta.extra,q),this.updated__()}}export{H as DocumentReference,G as CollectionReference};
|
|
3
|
+
|
|
4
|
+
//# debugId=1445A22D1A02267664756E2164756E21
|
|
5
|
+
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../src/collection-reference.ts", "../src/logger.ts", "../src/document-reference.ts"],
|
|
4
|
+
"sourcesContent": [
|
|
5
|
+
"import {delay} from '@alwatr/delay';\nimport {createLogger} from '@alwatr/logger';\nimport {getStoreId, getStorePath} from '@alwatr/nitrobase-helper';\nimport {\n StoreFileType,\n StoreFileExtension,\n type StoreFileId,\n type CollectionContext,\n type CollectionItem,\n type CollectionItemMeta,\n type StoreFileMeta,\n} from '@alwatr/nitrobase-types';\n\nimport {logger} from './logger.js';\n\n__dev_mode__: logger.logFileModule?.('collection-reference');\n\n/**\n * Represents a reference to a collection of the AlwatrNitrobase.\n * Provides methods to interact with the collection, such as retrieving, creating, updating, and deleting items.\n *\n * @template TItem - The data type of the collection items.\n */\nexport class CollectionReference<TItem extends JsonObject = JsonObject> {\n /**\n * Alwatr nitrobase engine version string.\n */\n public static readonly version = __package_version__;\n\n /**\n * Alwatr nitrobase engine file format version number.\n */\n public static readonly fileFormatVersion = 3;\n\n /**\n * Creates new CollectionReference instance from stat.\n *\n * @param stat the collection stat.\n * @param initialData the collection data.\n * @param updatedCallback the callback to invoke when the collection changed.\n * @template TItem The collection item data type.\n * @returns A new collection reference class.\n */\n public static newRefFromData<TItem extends JsonObject>(\n stat: StoreFileId,\n updatedCallback: (from: CollectionReference<TItem>) => void,\n debugDomain?: string,\n ): CollectionReference<TItem> {\n logger.logMethodArgs?.('col.newRefFromData', stat);\n\n const now = Date.now();\n const initialContext: CollectionContext<TItem> = {\n ok: true,\n meta: {\n ...stat,\n rev: 1,\n updated: now,\n created: now,\n lastAutoId: 0,\n type: StoreFileType.Collection,\n extension: StoreFileExtension.Json,\n fv: CollectionReference.fileFormatVersion,\n extra: {},\n },\n data: {},\n };\n\n return new CollectionReference(initialContext, updatedCallback, debugDomain);\n }\n\n /**\n * Creates new CollectionReference instance from CollectionContext.\n *\n * @param context the collection context.\n * @param updatedCallback the callback to invoke when the collection changed.\n * @template TItem The collection item data type.\n * @returns A new collection reference class.\n */\n public static newRefFromContext<TItem extends JsonObject>(\n context: CollectionContext<TItem>,\n updatedCallback: (from: CollectionReference<TItem>) => void,\n debugDomain?: string,\n ): CollectionReference<TItem> {\n logger.logMethodArgs?.('col.newRefFromContext', context.meta);\n return new CollectionReference(context, updatedCallback, debugDomain);\n }\n\n /**\n * Validates the collection context and try to migrate it to the latest version.\n */\n private validateContext__(): void {\n this.logger__.logMethod?.('validateContext__');\n\n if (this.context__.ok !== true) {\n this.logger__.accident?.('validateContext__', 'store_not_ok');\n throw new Error('store_not_ok', {cause: {context: this.context__}});\n }\n\n if (this.context__.meta === undefined) {\n this.logger__.accident?.('validateContext__', 'store_meta_undefined');\n throw new Error('store_meta_undefined', {cause: {context: this.context__}});\n }\n\n if (this.context__.meta.type !== StoreFileType.Collection) {\n this.logger__.accident?.('validateContext__', 'collection_type_invalid', this.context__.meta);\n throw new Error('collection_type_invalid', {cause: this.context__.meta});\n }\n\n if (this.context__.meta.fv !== CollectionReference.fileFormatVersion) {\n this.logger__.incident?.('validateContext__', 'store_file_version_incompatible', {\n old: this.context__.meta.fv,\n new: CollectionReference.fileFormatVersion,\n });\n this.migrateContext__();\n }\n }\n\n /**\n * Migrate the collection context to the latest.\n */\n private migrateContext__(): void {\n if (this.context__.meta.fv === CollectionReference.fileFormatVersion) return;\n\n this.logger__.logMethod?.('migrateContext__');\n\n if (this.context__.meta.fv > CollectionReference.fileFormatVersion) {\n this.logger__.accident('migrateContext__', 'store_version_incompatible', this.context__.meta);\n throw new Error('store_version_incompatible', {cause: this.context__.meta});\n }\n\n if (this.context__.meta.fv === 1) {\n // migrate from v1 to v2\n // this.context__.meta.schemaVer = 0\n this.context__.meta.fv = 2;\n }\n\n if (this.context__.meta.fv === 2) {\n // migrate from v1 to v3\n if (this.context__.meta.schemaVer === undefined || this.context__.meta.schemaVer === 0) {\n this.context__.meta.schemaVer = 1;\n }\n delete (this.context__.meta as DictionaryOpt)['ver'];\n this.context__.meta.extra ??= {};\n this.context__.meta.fv = 3;\n }\n\n this.updated__();\n }\n\n /**\n * The ID of the collection nitrobase file.\n */\n public readonly id: string;\n\n /**\n * The location path of the collection nitrobase file.\n */\n public readonly path: string;\n\n /**\n * Indicates whether the collection has unsaved changes.\n */\n public hasUnprocessedChanges_ = false;\n\n /**\n * Logger instance for this collection.\n */\n private logger__;\n\n /**\n * Collection reference have methods to get, set, update and save the Alwatr Nitrobase Collection.\n * This class is dummy in saving and loading the collection from file.\n * It's the responsibility of the Alwatr Nitrobase to save and load the collection.\n *\n * @param context__ Collection's context filled from the Alwatr Nitrobase (parent).\n * @param updatedCallback__ updated callback to invoke when the collection is updated from the Alwatr Nitrobase (parent).\n * @template TItem - Items data type.\n * @example\n * ```typescript\n * const collectionRef = alwatrStore.col('blog/posts');\n * ```\n */\n constructor(\n private context__: CollectionContext<TItem>,\n private updatedCallback__: (from: CollectionReference<TItem>) => void,\n debugDomain?: string,\n ) {\n this.id = getStoreId(this.context__.meta);\n this.path = getStorePath(this.context__.meta);\n\n debugDomain ??= this.id.slice(0, 20);\n this.logger__ = createLogger(`col:${debugDomain}`);\n\n this.logger__.logMethodArgs?.('new', {id: this.id});\n\n this.validateContext__();\n }\n\n /**\n * Get nitrobase schema version\n *\n * @returns nitrobase schema version\n */\n public get schemaVer(): number {\n return this.context__.meta.schemaVer ?? 1;\n }\n\n /**\n * Set nitrobase schema version for migrate\n */\n public set schemaVer(ver: number) {\n this.logger__.logMethodArgs?.('set schemaVer', {old: this.context__.meta.schemaVer, new: ver});\n this.context__.meta.schemaVer = ver;\n this.updated__();\n }\n\n /**\n * Indicates whether the collection data is frozen and cannot be saved.\n */\n private _freeze = false;\n\n /**\n * Gets the freeze status of the collection data.\n *\n * @returns `true` if the collection data is frozen, `false` otherwise.\n *\n * @example\n * ```typescript\n * const isFrozen = collectionRef.freeze;\n * console.log(isFrozen); // Output: false\n * ```\n */\n public get freeze(): boolean {\n return this._freeze;\n }\n\n /**\n * Sets the freeze status of the collection data.\n *\n * @param value - The freeze status to set.\n *\n * @example\n * ```typescript\n * collectionRef.freeze = true;\n * console.log(collectionRef.freeze); // Output: true\n * ```\n */\n public set freeze(value: boolean) {\n this.logger__.logMethodArgs?.('freeze changed', {value});\n this._freeze = value;\n }\n\n /**\n * Checks if an item exists in the collection.\n *\n * @param itemId - The ID of the item.\n * @returns `true` if the item with the given ID exists in the collection, `false` otherwise.\n *\n * @example\n * ```typescript\n * const doesExist = collectionRef.hasItem('item1');\n *\n * if (doesExist) {\n * collectionRef.addItem('item1', { key: 'value' });\n * }\n * ```\n */\n public hasItem(itemId: string | number): boolean {\n const exists = Object.hasOwn(this.context__.data, itemId);\n this.logger__.logMethodFull?.('hasItem', itemId, exists);\n return exists;\n }\n\n /**\n * Retrieves the metadata of the nitrobase file.\n *\n * @returns The metadata of the nitrobase file.\n *\n * @example\n * ```typescript\n * const metadata = collectionRef.getStoreMeta();\n * ```\n */\n public getStoreMeta(): Readonly<StoreFileMeta> {\n this.logger__.logMethod?.('getStoreMeta');\n return this.context__.meta;\n }\n\n /**\n * Retrieves an item from the collection. If the item does not exist, an error is thrown.\n *\n * @param itemId - The ID of the item.\n * @returns The item with the given ID.\n */\n private item__(itemId: string | number): CollectionItem<TItem> {\n const item = this.context__.data[itemId];\n if (item === undefined) {\n this.logger__.accident('item__', 'collection_item_not_found', {itemId});\n throw new Error('collection_item_not_found', {cause: {itemId}});\n }\n return item;\n }\n\n /**\n * Retrieves an item's metadata from the collection. If the item does not exist, an error is thrown.\n *\n * @param itemId - The ID of the item.\n * @returns The metadata of the item with the given ID.\n * @example\n * ```typescript\n * const itemMeta = collectionRef.getItemMeta('item1');\n * ```\n */\n public getItemMeta(itemId: string | number): Readonly<CollectionItemMeta> {\n const meta = this.item__(itemId).meta;\n this.logger__.logMethodFull?.('getItemMeta', itemId, meta);\n return meta;\n }\n\n /**\n * Retrieves an item's data from the collection. If the item does not exist, an error is thrown.\n *\n * @param itemId - The ID of the item.\n * @returns The data of the item with the given ID.\n *\n * @example\n * ```typescript\n * const itemData = collectionRef.getItemData('item1');\n * ```\n */\n public getItemData(itemId: string | number): TItem {\n this.logger__.logMethodArgs?.('getItemData', itemId);\n return this.item__(itemId).data;\n }\n\n /**\n * Direct access to an item.\n * If the item does not exist, `undefined` is returned.\n * **USE WITH CAUTION!**\n *\n * @param itemId - The ID of the item.\n * @returns The data of the item with the given ID or `undefined` if the item does not exist.\n *\n * @example\n * ```typescript\n * collectionRef.getItemContext_('item1')?.data.name = 'test2';\n * ```\n */\n public getItemContext_(itemId: string | number): CollectionItem<TItem> | undefined {\n this.logger__.logMethodArgs?.('getItemContext_', itemId);\n return this.context__.data[itemId];\n }\n\n /**\n * Add a new item to the collection.\n * If an item with the given ID already exists, an error is thrown.\n *\n * @param itemId - The ID of the item to create.\n * @param data - The initial data of the item.\n *\n * @example\n * ```typescript\n * collectionRef.addItem('item1', { key: 'value' });\n * ```\n */\n public addItem(itemId: string | number, data: TItem): void {\n this.logger__.logMethodArgs?.('addItem', {itemId, data});\n if (this.hasItem(itemId)) {\n this.logger__.accident('addItem', 'collection_item_exist', {itemId});\n throw new Error('collection_item_exist', {cause: {itemId}});\n }\n\n const now = Date.now();\n\n this.context__.data[itemId] = {\n meta: {\n id: itemId,\n // other prop calc in updateMeta__\n rev: 0,\n created: now,\n updated: now,\n },\n data,\n };\n this.updated__(itemId);\n }\n\n /**\n * Appends the given data to the collection with auto increment ID.\n *\n * @param data - The data to append.\n * @returns The ID of the appended item.\n *\n * @example\n * ```typescript\n * const newId = collectionRef.appendItem({ key: 'value' });\n * ```\n */\n public appendItem(data: TItem): string | number {\n this.logger__.logMethodArgs?.('appendItem', data);\n const id = this.nextAutoIncrementId__();\n this.addItem(id, data);\n return id;\n }\n\n /**\n * Removes an item from the collection.\n *\n * @param itemId - The ID of the item to delete.\n *\n * @example\n * ```typescript\n * collectionRef.removeItem('item1');\n * collectionRef.hasItem('item1'); // Output: false\n * ```\n */\n public removeItem(itemId: string | number): void {\n this.logger__.logMethodArgs?.('removeItem', itemId);\n delete this.context__.data[itemId];\n this.updated__();\n }\n\n /**\n * Sets an item's data in the collection. Replaces the item's data with the given data.\n *\n * @param itemId - The ID of the item to set.\n * @param data - The data to set for the item.\n *\n * @example\n * ```typescript\n * collectionRef.replaceItemData('item1', { a: 1, b: 2, c: 3 });\n * ```\n */\n public replaceItemData(itemId: string | number, data: TItem): void {\n this.logger__.logMethodArgs?.('replaceItemData', {itemId, data});\n (this.item__(itemId).data as unknown) = data;\n this.updated__(itemId);\n }\n\n /**\n * Updates an item in the collection by merging a partial update into the item's data.\n *\n * @param itemId - The ID of the item to update.\n * @param data - The part of data to merge into the item's data.\n *\n * @example\n * ```typescript\n * collectionRef.mergeItemData(itemId, partialUpdate);\n * ```\n */\n public mergeItemData(itemId: string | number, data: Partial<TItem>): void {\n this.logger__.logMethodArgs?.('mergeItemData', {itemId, data});\n Object.assign(this.item__(itemId).data, data);\n this.updated__(itemId);\n }\n\n /**\n * Requests the Alwatr Nitrobase to save the collection.\n * Saving may take some time in Alwatr Nitrobase due to the use of throttling.\n *\n * @example\n * ```typescript\n * collectionRef.save();\n * ```\n */\n public save(itemId: string | number | null): void {\n this.logger__.logMethod?.('save');\n this.updated__(itemId, false);\n }\n\n /**\n * Requests the Alwatr Nitrobase to save the collection immediately.\n *\n * @example\n * ```typescript\n * collectionRef.saveImmediate();\n * ```\n */\n public saveImmediate(itemId: string | number | null): void {\n this.logger__.logMethod?.('saveImmediate');\n this.updated__(itemId, true);\n }\n\n /**\n * Retrieves the IDs of all items in the collection in array.\n * Impact performance if the collection is large, use `ids()` instead.\n *\n * @returns Array of IDs of all items in the collection.\n * @example\n * ```typescript\n * const ids = collectionRef.keys();\n * ```\n */\n public keys(): string[] {\n this.logger__.logMethod?.('keys');\n return Object.keys(this.context__.data);\n }\n\n /**\n * Retrieves all items in the collection in array.\n * Impact performance if the collection is large, use `items()` instead.\n *\n * @returns Array of all items in the collection.\n * @example\n * ```typescript\n * const items = collectionRef.values();\n * console.log('meta: %o', items[0].meta);\n * console.log('data: %o', items[0].data);\n * ```\n */\n public values(): CollectionItem<TItem>[] {\n this.logger__.logMethod?.('values');\n return Object.values(this.context__.data);\n }\n\n /**\n * Retrieves the IDs of all items in the collection.\n * Use this method instead of `keys()` if the collection is large.\n * This method is a generator and can be used in `for...of` loops.\n * @returns Generator of IDs of all items in the collection.\n * @example\n * ```typescript\n * for (const id of collectionRef.ids()) {\n * const doc = collectionRef.get(id);\n * }\n * ```\n */\n public *ids(): Generator<string, void, void> {\n this.logger__.logMethod?.('ids');\n for (const id in this.context__.data) {\n yield id;\n }\n }\n\n /**\n * Retrieves all items in the collection.\n * Use this method instead of `values()` if the collection is large.\n * This method is a generator and can be used in `for...of` loops.\n * @returns Generator of all items in the collection.\n * @example\n * ```typescript\n * for (const item of collectionRef.items()) {\n * console.log(item.data);\n * }\n */\n public *items(): Generator<CollectionItem<TItem>, void, void> {\n this.logger__.logMethod?.('items');\n for (const id in this.context__.data) {\n yield this.context__.data[id];\n }\n }\n\n /**\n * Retrieves the full context of the collection.\n *\n * @returns The full context of the collection.\n *\n * @example\n * ```typescript\n * const context = collectionRef.getFullContext_();\n * ```\n */\n public getFullContext_(): Readonly<CollectionContext<TItem>> {\n this.logger__.logMethod?.('getFullContext_');\n return this.context__;\n }\n\n public updateDelayed_ = false;\n\n /**\n * Update the document metadata and invoke the updated callback.\n * This method is throttled to prevent multiple updates in a short time.\n *\n * @param itemId - The ID of the item to update.\n */\n private async updated__(itemId: string | number | null = null, immediate = false): Promise<void> {\n this.logger__.logMethodArgs?.('updated__', {id: itemId, immediate, delayed: this.updateDelayed_});\n\n this.hasUnprocessedChanges_ = true;\n if (itemId !== null) this.refreshMeta_(itemId); // meta must updated per item\n\n if (immediate === false && this.updateDelayed_ === true) return;\n // else\n\n this.updateDelayed_ = true;\n\n if (immediate === true || this.context__.meta.changeDebounce === undefined) {\n await delay.nextMacrotask();\n }\n else {\n await delay.by(this.context__.meta.changeDebounce);\n }\n\n if (this.updateDelayed_ !== true) return; // another parallel update finished!\n this.updateDelayed_ = false;\n\n if (itemId === null) this.refreshMeta_(itemId); // root meta not updated for null\n\n if (this._freeze === true) return; // prevent save if frozen\n this.updatedCallback__(this);\n }\n\n /**\n * Refresh/recalculate the collection's metadata timestamp and revision.\n *\n * @param itemId - The ID of the item to update.\n */\n protected refreshMeta_(itemId: string | number | null): void {\n this.logger__.logMethodArgs?.('refreshMeta_', {id: itemId});\n const now = Date.now();\n this.context__.meta.rev++;\n this.context__.meta.updated = now;\n if (itemId !== null) {\n const itemMeta = this.item__(itemId).meta;\n itemMeta.rev++;\n itemMeta.updated = now;\n }\n }\n\n /**\n * Generates the next auto increment ID.\n *\n * @returns The next auto increment ID.\n * @example\n * ```typescript\n * const nextId = this.nextAutoIncrementId_();\n * ```\n */\n private nextAutoIncrementId__(): number {\n this.logger__.logMethod?.('nextAutoIncrementId__');\n const meta = this.context__.meta as Required<StoreFileMeta>;\n do {\n meta.lastAutoId++;\n } while (meta.lastAutoId in this.context__.data);\n return meta.lastAutoId;\n }\n\n /**\n * Retrieves the collection's extra metadata.\n *\n * @returns The collection's extra metadata.\n *\n * @example\n * ```typescript\n * const colExtraMeta = collectionRef.getExtraMeta();\n * ```\n */\n public getExtraMeta<T extends JsonObject>(): T {\n this.logger__.logMethod?.('getExtraMeta');\n return this.context__.meta.extra as T;\n }\n\n /**\n * Sets/replace the collection's extra metadata.\n *\n * @param extraMeta The new collection's extra metadata.\n *\n * @example\n * ```typescript\n * collectionRef.replaceExtraMeta({ a: 1, b: 2, c: 3 });\n * ```\n */\n public replaceExtraMeta<T extends JsonObject>(extraMeta: T): void {\n this.logger__.logMethodArgs?.('replaceExtraMeta', extraMeta);\n this.context__.meta.extra = extraMeta;\n this.updated__();\n }\n\n /**\n * Updates collection's extra metadata by merging a partial update.\n *\n * @param extraMeta The part of extra metadata to merge into the collection's extra metadata.\n *\n * @example\n * ```typescript\n * collectionRef.mergeExtraMeta({ c: 4 });\n * ```\n */\n public mergeExtraMeta<T extends JsonObject>(extraMeta: Partial<T>): void {\n this.logger__.logMethodArgs?.('mergeExtraMeta', extraMeta);\n Object.assign(this.context__.meta.extra, extraMeta);\n this.updated__();\n }\n}\n",
|
|
6
|
+
"import {createLogger} from '@alwatr/logger';\n\n\nexport const logger = /* #__PURE__ */ createLogger(__package_name__);\n",
|
|
7
|
+
"import {delay} from '@alwatr/delay';\nimport {createLogger} from '@alwatr/logger';\nimport {getStoreId, getStorePath} from '@alwatr/nitrobase-helper';\nimport {StoreFileType, StoreFileExtension, type StoreFileId, type DocumentContext, type StoreFileMeta} from '@alwatr/nitrobase-types';\n\nimport {logger} from './logger.js';\n\n__dev_mode__: logger.logFileModule?.('document-reference');\n\n/**\n * Represents a reference to a document of the AlwatrNitrobase.\n * Provides methods to interact with the document, such as get, set, update and save.\n */\nexport class DocumentReference<TDoc extends JsonObject = JsonObject> {\n /**\n * Alwatr nitrobase engine version string.\n */\n public static readonly version = __package_version__;\n\n /**\n * Alwatr nitrobase engine file format version number.\n */\n public static readonly fileFormatVersion = 3;\n\n /**\n * Creates new DocumentReference instance from stat and initial data.\n *\n * @param statId the document stat.\n * @param data the document data.\n * @param updatedCallback the callback to invoke when the document changed.\n * @template TDoc The document data type.\n * @returns A new document reference class.\n */\n public static newRefFromData<TDoc extends JsonObject>(\n statId: StoreFileId,\n data: TDoc,\n updatedCallback: (from: DocumentReference<TDoc>) => unknown,\n debugDomain?: string,\n ): DocumentReference<TDoc> {\n logger.logMethodArgs?.('doc.newRefFromData', statId);\n\n const now = Date.now();\n const initialContext: DocumentContext<TDoc> = {\n ok: true,\n meta: {\n ...statId,\n rev: 1,\n updated: now,\n created: now,\n type: StoreFileType.Document,\n extension: StoreFileExtension.Json,\n fv: DocumentReference.fileFormatVersion,\n extra: {},\n },\n data,\n };\n\n return new DocumentReference(initialContext, updatedCallback, debugDomain);\n }\n\n /**\n * Creates new DocumentReference instance from DocumentContext.\n *\n * @param context the document context.\n * @param updatedCallback the callback to invoke when the document changed.\n * @template TDoc The document data type.\n * @returns A new document reference class.\n */\n public static newRefFromContext<TDoc extends JsonObject>(\n context: DocumentContext<TDoc>,\n updatedCallback: (from: DocumentReference<TDoc>) => unknown,\n debugDomain?: string,\n ): DocumentReference<TDoc> {\n logger.logMethodArgs?.('doc.newRefFromContext', context.meta);\n return new DocumentReference(context, updatedCallback, debugDomain);\n }\n\n /**\n * Validates the document context and try to migrate it to the latest version.\n */\n private validateContext__(): void {\n this.logger__.logMethod?.('validateContext__');\n\n if (this.context__.ok !== true) {\n this.logger__.accident?.('validateContext__', 'store_not_ok');\n throw new Error('store_not_ok', {cause: {context: this.context__}});\n }\n\n if (this.context__.meta === undefined) {\n this.logger__.accident?.('validateContext__', 'store_meta_undefined');\n throw new Error('store_meta_undefined', {cause: {context: this.context__}});\n }\n\n if (this.context__.meta.type !== StoreFileType.Document) {\n this.logger__.accident?.('validateContext__', 'document_type_invalid', this.context__.meta);\n throw new Error('document_type_invalid', {cause: this.context__.meta});\n }\n\n if (this.context__.meta.fv !== DocumentReference.fileFormatVersion) {\n this.logger__.incident?.('validateContext__', 'store_file_version_incompatible', {\n old: this.context__.meta.fv,\n new: DocumentReference.fileFormatVersion,\n });\n this.migrateContext__();\n }\n }\n\n /**\n * Migrate the document context to the latest.\n */\n private migrateContext__(): void {\n if (this.context__.meta.fv === DocumentReference.fileFormatVersion) return;\n\n this.logger__.logMethod?.('migrateContext__');\n\n if (this.context__.meta.fv > DocumentReference.fileFormatVersion) {\n this.logger__.accident('migrateContext__', 'store_version_incompatible', this.context__.meta);\n throw new Error('store_version_incompatible', {cause: this.context__.meta});\n }\n\n if (this.context__.meta.fv === 1) {\n // migrate from v1 to v2\n // this.context__.meta.schemaVer = 0\n this.context__.meta.fv = 2;\n }\n\n if (this.context__.meta.fv === 2) {\n // migrate from v1 to v3\n if (this.context__.meta.schemaVer === undefined || this.context__.meta.schemaVer === 0) {\n this.context__.meta.schemaVer = 1;\n }\n delete (this.context__.meta as DictionaryOpt)['ver'];\n this.context__.meta.extra ??= {};\n this.context__.meta.fv = 3;\n }\n\n this.updated__();\n }\n\n /**\n * The ID of the document nitrobase file.\n */\n public readonly id: string;\n\n /**\n * The location path of the document nitrobase file.\n */\n public readonly path: string;\n\n /**\n * Indicates whether the document has unsaved changes.\n */\n public hasUnprocessedChanges_ = false;\n\n /**\n * Logger instance for this document.\n */\n private logger__;\n\n /**\n * Create a new document reference.\n * Document reference have methods to get, set, update and save the AlwatrNitrobase Document.\n *\n * @param context__ Document's context filled from the Alwatr Nitrobase (parent).\n * @param updatedCallback__ updated callback to invoke when the document is updated from the Alwatr Nitrobase (parent).\n * @template TDoc The document data type.\n */\n constructor(\n private readonly context__: DocumentContext<TDoc>,\n private readonly updatedCallback__: (from: DocumentReference<TDoc>) => unknown,\n debugDomain?: string,\n ) {\n this.id = getStoreId(this.context__.meta);\n this.path = getStorePath(this.context__.meta);\n\n debugDomain ??= this.id.slice(0, 20);\n this.logger__ = createLogger(`doc:${debugDomain}`);\n\n this.logger__.logMethodArgs?.('new', {path: this.path});\n\n this.validateContext__();\n }\n\n /**\n * Get nitrobase schema version\n *\n * @returns nitrobase schema version\n */\n public get schemaVer(): number {\n return this.context__.meta.schemaVer ?? 1;\n }\n\n /**\n * Set nitrobase schema version for migrate\n */\n public set schemaVer(ver: number) {\n this.logger__.logMethodArgs?.('set schemaVer', {old: this.context__.meta.schemaVer, new: ver});\n this.context__.meta.schemaVer = ver;\n this.updated__();\n }\n\n /**\n * Indicates whether the document data is frozen and cannot be saved.\n */\n private _freeze = false;\n\n /**\n * Gets the freeze status of the document data.\n *\n * @returns `true` if the document data is frozen, `false` otherwise.\n *\n * @example\n * ```typescript\n * const isFrozen = documentRef.freeze;\n * console.log(isFrozen); // Output: false\n * ```\n */\n public get freeze(): boolean {\n return this._freeze;\n }\n\n /**\n * Sets the freeze status of the document data.\n *\n * @param value - The freeze status to set.\n *\n * @example\n * ```typescript\n * documentRef.freeze = true;\n * console.log(documentRef.freeze); // Output: true\n * ```\n */\n public set freeze(value: boolean) {\n this.logger__.logMethodArgs?.('freeze changed', {value});\n this._freeze = value;\n }\n\n /**\n * Retrieves the document's data.\n *\n * @returns The document's data.\n *\n * @example\n * ```typescript\n * const documentData = documentRef.getData();\n * ```\n */\n public getData(): TDoc {\n this.logger__.logMethod?.('getData');\n return this.context__.data;\n }\n\n /**\n * Retrieves the document's metadata.\n *\n * @returns The document's metadata.\n *\n * @example\n * ```typescript\n * const documentMeta = documentRef.getStoreMeta();\n * ```\n */\n public getStoreMeta(): Readonly<StoreFileMeta> {\n this.logger__.logMethod?.('getStoreMeta');\n return this.context__.meta;\n }\n\n /**\n * Sets the document's data. replacing the existing data.\n *\n * @param data The new document data.\n *\n * @example\n * ```typescript\n * documentRef.replaceData({ a: 1, b: 2, c: 3 });\n * ```\n */\n public replaceData(data: TDoc): void {\n this.logger__.logMethodArgs?.('replaceData', data);\n (this.context__.data as unknown) = data;\n this.updated__();\n }\n\n /**\n * Updates document's data by merging a partial update into the document's data.\n *\n * @param data The part of data to merge into the document's data.\n *\n * @example\n * ```typescript\n * documentRef.mergeData({ c: 4 });\n * ```\n */\n public mergeData(data: Partial<TDoc>): void {\n this.logger__.logMethodArgs?.('mergeData', data);\n Object.assign(this.context__.data, data);\n this.updated__();\n }\n\n /**\n * Requests the Alwatr Nitrobase to save the document.\n * Saving may take some time in Alwatr Nitrobase due to the use of throttling.\n *\n * @example\n * ```typescript\n * documentRef.save();\n * ```\n */\n public save(): void {\n this.logger__.logMethod?.('save');\n this.updated__();\n }\n\n /**\n * Requests the Alwatr Nitrobase to save the document immediately.\n *\n * @example\n * ```typescript\n * documentRef.saveImmediate();\n * ```\n */\n public saveImmediate(): void {\n this.logger__.logMethod?.('saveImmediate');\n this.updated__(/* immediate: */ true);\n }\n\n /**\n * Retrieves the full context of the document.\n *\n * @returns The full context of the document.\n *\n * @example\n * ```typescript\n * const context = documentRef.getFullContext_();\n * ```\n */\n public getFullContext_(): Readonly<DocumentContext<TDoc>> {\n this.logger__.logMethod?.('getFullContext_');\n return this.context__;\n }\n\n public updateDelayed_ = false;\n\n /**\n * Update the document metadata and invoke the updated callback.\n * This method is throttled to prevent multiple updates in a short time.\n */\n private async updated__(immediate = false): Promise<void> {\n this.logger__.logMethodArgs?.('updated__', {immediate, delayed: this.updateDelayed_});\n\n this.hasUnprocessedChanges_ = true;\n\n if (immediate !== true && this.updateDelayed_ === true) return;\n // else\n\n this.updateDelayed_ = true;\n\n if (immediate === true || this.context__.meta.changeDebounce === undefined) {\n await delay.nextMacrotask();\n }\n else {\n await delay.by(this.context__.meta.changeDebounce);\n }\n\n if (this.updateDelayed_ !== true) return; // another parallel update finished!\n this.updateDelayed_ = false;\n\n this.refreshMetadata_();\n\n if (this._freeze === true) return; // prevent save if frozen\n this.updatedCallback__(this);\n }\n\n /**\n * Refresh/recalculate the document's metadata timestamp and revision.\n */\n protected refreshMetadata_(): void {\n this.logger__.logMethod?.('refreshMetadata_');\n this.context__.meta.updated = Date.now();\n this.context__.meta.rev++;\n }\n\n /**\n * Retrieves the document's extra metadata.\n *\n * @returns The document's extra metadata.\n *\n * @example\n * ```typescript\n * const colExtraMeta = documentRef.getExtraMeta();\n * ```\n */\n public getExtraMeta<T extends JsonObject>(): T {\n this.logger__.logMethod?.('getExtraMeta');\n return this.context__.meta.extra as T;\n }\n\n /**\n * Sets/replace the document's extra metadata.\n *\n * @param extraMeta The new document's extra metadata.\n *\n * @example\n * ```typescript\n * documentRef.replaceExtraMeta({ a: 1, b: 2, c: 3 });\n * ```\n */\n public replaceExtraMeta<T extends JsonObject>(extraMeta: T): void {\n this.logger__.logMethodArgs?.('replaceExtraMeta', extraMeta);\n this.context__.meta.extra = extraMeta;\n this.updated__();\n }\n\n /**\n * Updates document's extra metadata by merging a partial update.\n *\n * @param extraMeta The part of extra metadata to merge into the document's extra metadata.\n *\n * @example\n * ```typescript\n * documentRef.mergeExtraMeta({ c: 4 });\n * ```\n */\n public mergeExtraMeta<T extends JsonObject>(extraMeta: Partial<T>): void {\n this.logger__.logMethodArgs?.('mergeExtraMeta', extraMeta);\n Object.assign(this.context__.meta.extra, extraMeta);\n this.updated__();\n }\n}\n"
|
|
8
|
+
],
|
|
9
|
+
"mappings": ";AAAA,gBAAQ,sBACR,uBAAQ,uBACR,qBAAQ,kBAAY,iCACpB,wBACE,wBACA,gCCLF,uBAAQ,uBAGD,IAAM,EAAyB,EAAa,6BAAgB,EDYnE,EAAc,EAAO,gBAAgB,sBAAsB,EAQpD,MAAM,CAA2D,CAgK5D,UACA,wBA7Ja,SAAU,cAKV,mBAAoB,QAW7B,eAAwC,CACpD,EACA,EACA,EAC4B,CAC5B,EAAO,gBAAgB,qBAAsB,CAAI,EAEjD,IAAM,EAAM,KAAK,IAAI,EACf,EAA2C,CAC/C,GAAI,GACJ,KAAM,IACD,EACH,IAAK,EACL,QAAS,EACT,QAAS,EACT,W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S,EAC3D,KAAK,UAAU,KAAK,MAAQ,EAC5B,KAAK,UAAU,EAaV,cAAoC,CAAC,EAA6B,CACvE,KAAK,SAAS,gBAAgB,iBAAkB,CAAS,EACzD,OAAO,OAAO,KAAK,UAAU,KAAK,MAAO,CAAS,EAClD,KAAK,UAAU,EAEnB",
|
|
10
|
+
"debugId": "1445A22D1A02267664756E2164756E21",
|
|
11
|
+
"names": []
|
|
12
|
+
}
|
package/package.json
CHANGED
|
@@ -1,33 +1,65 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alwatr/nitrobase-reference",
|
|
3
|
+
"version": "9.1.0",
|
|
3
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.",
|
|
4
|
-
"
|
|
5
|
-
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com>",
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
"
|
|
10
|
-
"
|
|
11
|
-
"@alwatr/nitrobase-types": "^7.10.1",
|
|
12
|
-
"@alwatr/type-helper": "^7.0.0"
|
|
13
|
-
},
|
|
14
|
-
"devDependencies": {
|
|
15
|
-
"@alwatr/nanolib": "^7.3.4",
|
|
16
|
-
"@types/node": "^24.10.4",
|
|
17
|
-
"typescript": "^5.9.3"
|
|
5
|
+
"license": "MPL-2.0",
|
|
6
|
+
"author": "S. Ali Mihandoost <ali.mihandoost@gmail.com> (https://ali.mihandoost.com)",
|
|
7
|
+
"type": "module",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/Alwatr/alwatr",
|
|
11
|
+
"directory": "pkg/nitrobase-old/reference"
|
|
18
12
|
},
|
|
13
|
+
"homepage": "https://github.com/Alwatr/alwatr/tree/main/pkg/nitrobase-old/reference#readme",
|
|
14
|
+
"bugs": "https://github.com/Alwatr/alwatr/issues",
|
|
19
15
|
"exports": {
|
|
20
16
|
".": {
|
|
21
17
|
"types": "./dist/main.d.ts",
|
|
22
|
-
"import": "./dist/main.
|
|
23
|
-
"
|
|
18
|
+
"import": "./dist/main.js",
|
|
19
|
+
"default": "./dist/main.js"
|
|
24
20
|
}
|
|
25
21
|
},
|
|
22
|
+
"sideEffects": false,
|
|
23
|
+
"dependencies": {
|
|
24
|
+
"@alwatr/delay": "9.1.0",
|
|
25
|
+
"@alwatr/logger": "9.1.0",
|
|
26
|
+
"@alwatr/nitrobase-helper": "^9.1.0",
|
|
27
|
+
"@alwatr/nitrobase-types": "^9.1.0",
|
|
28
|
+
"@alwatr/type-helper": "9.1.0"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"@alwatr/nano-build": "9.1.0",
|
|
32
|
+
"@alwatr/tsconfig-base": "9.1.0",
|
|
33
|
+
"@alwatr/type-helper": "workspace:*",
|
|
34
|
+
"@types/node": "^25.5.0",
|
|
35
|
+
"typescript": "^6.0.2"
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"b": "bun run build",
|
|
39
|
+
"build": "bun run build:ts && bun run build:es",
|
|
40
|
+
"build:es": "nano-build --preset=module src/main.ts",
|
|
41
|
+
"build:ts": "tsc --build",
|
|
42
|
+
"cl": "bun run clean",
|
|
43
|
+
"clean": "rm -rfv dist *.tsbuildinfo",
|
|
44
|
+
"format": "prettier --write \"src/**/*.ts\"",
|
|
45
|
+
"lint": "eslint src/ --ext .ts",
|
|
46
|
+
"t": "bun run test",
|
|
47
|
+
"test": "ALWATR_DEBUG=0 bun test",
|
|
48
|
+
"w": "bun run watch",
|
|
49
|
+
"watch": "bun run watch:ts & bun run watch:es",
|
|
50
|
+
"watch:es": "bun run build:es --watch",
|
|
51
|
+
"watch:ts": "bun run build:ts --watch --preserveWatchOutput"
|
|
52
|
+
},
|
|
26
53
|
"files": [
|
|
27
|
-
"
|
|
28
|
-
"
|
|
54
|
+
"dist",
|
|
55
|
+
"src/**/*.ts",
|
|
56
|
+
"!src/**/*.test.ts",
|
|
57
|
+
"README.md",
|
|
58
|
+
"LICENSE"
|
|
29
59
|
],
|
|
30
|
-
"
|
|
60
|
+
"publishConfig": {
|
|
61
|
+
"access": "public"
|
|
62
|
+
},
|
|
31
63
|
"keywords": [
|
|
32
64
|
"alwatr",
|
|
33
65
|
"data",
|
|
@@ -41,34 +73,6 @@
|
|
|
41
73
|
"storage",
|
|
42
74
|
"typescript"
|
|
43
75
|
],
|
|
44
|
-
"license": "MPL-2.0",
|
|
45
|
-
"main": "./dist/main.cjs",
|
|
46
|
-
"module": "./dist/main.mjs",
|
|
47
76
|
"prettier": "@alwatr/nanolib/prettier-config",
|
|
48
|
-
"
|
|
49
|
-
"access": "public"
|
|
50
|
-
},
|
|
51
|
-
"repository": {
|
|
52
|
-
"type": "git",
|
|
53
|
-
"url": "https://github.com/Alwatr/nitrobase",
|
|
54
|
-
"directory": "packages/reference"
|
|
55
|
-
},
|
|
56
|
-
"scripts": {
|
|
57
|
-
"b": "yarn run build",
|
|
58
|
-
"build": "yarn run build:ts & yarn run build:es",
|
|
59
|
-
"build:es": "nano-build --preset=module",
|
|
60
|
-
"build:ts": "tsc --build",
|
|
61
|
-
"c": "yarn run clean",
|
|
62
|
-
"cb": "yarn run clean && yarn run build",
|
|
63
|
-
"clean": "rm -rfv dist *.tsbuildinfo",
|
|
64
|
-
"d": "yarn run build:es && yarn node",
|
|
65
|
-
"w": "yarn run watch",
|
|
66
|
-
"watch": "yarn run watch:ts & yarn run watch:es",
|
|
67
|
-
"watch:es": "yarn run build:es --watch",
|
|
68
|
-
"watch:ts": "yarn run build:ts --watch --preserveWatchOutput"
|
|
69
|
-
},
|
|
70
|
-
"sideEffects": false,
|
|
71
|
-
"type": "module",
|
|
72
|
-
"types": "./dist/main.d.ts",
|
|
73
|
-
"gitHead": "e23943a279d6b0905b205c0c17b2b3249efab226"
|
|
77
|
+
"gitHead": "4a25cd3e0499cf61dd761e87d3711abf9b0cd208"
|
|
74
78
|
}
|