@alwatr/nitrobase-types 9.1.0 → 9.2.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/dist/main.js CHANGED
@@ -1,5 +1,5 @@
1
- /* 📦 @alwatr/nitrobase-types v9.1.0 */
1
+ /* 📦 @alwatr/nitrobase-types v9.2.1 */
2
2
  var f;((a)=>{a.Public="p";a.Authenticated="a";a.Managers="m";a.PerUser="u";a.PerOwner="o";a.Secret=".s"})(f||={});var h;((b)=>{b.Document="doc";b.Collection="col";b.AppendOnlyCollection="aoc"})(h||={});var j;((d)=>d.Json="asj")(j||={});export{h as StoreFileType,j as StoreFileExtension,f as Region};
3
3
 
4
- //# debugId=254008C60655E0FB64756E2164756E21
4
+ //# debugId=3FB6A6119A0615A364756E2164756E21
5
5
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -5,6 +5,6 @@
5
5
  "\n// *** Nitrobase File ***\n\n/**\n * The subdirectory location for each nitrobase file.\n */\nexport enum Region {\n /**\n * Nitrobase file location that can be accessed by anyone. e.g. Product list.\n */\n Public = 'p',\n\n /**\n * Nitrobase file location that can be accessed by authenticated users. e.g. Special price list for dealers\n */\n Authenticated = 'a',\n\n /**\n * Nitrobase file location that can be accessed by admins and managers only. e.g. User list.\n */\n Managers = 'm',\n\n /**\n * Nitrobase file location specific to each user id. Can be accessed using the user token. e.g. User profile and User orders.\n */\n PerUser = 'u',\n\n /**\n * Nitrobase file location specific to each owner id. e.g. user token or device id.\n */\n PerOwner = 'o',\n\n /**\n * Private nitrobase file location. Cannot be accessed publicly and must be directly accessed by the admin API only.\n * e.g. User secret data.\n */\n Secret = '.s',\n}\n\n/**\n * The different types of nitrobase file formats.\n */\nexport enum StoreFileType {\n /**\n * Type used for `single document` storage.\n */\n Document = 'doc',\n\n /**\n * Type used for storing a `collection` of simpler documents, referred to as collection items.\n */\n Collection = 'col',\n\n /**\n * Type used for storing a collection of items that are `append-only`.\n */\n AppendOnlyCollection = 'aoc',\n}\n\n/**\n * Nitrobase file extension (encode).\n */\nexport enum StoreFileExtension {\n /**\n * AlwatrNitrobase JSON format.\n */\n Json = 'asj',\n}\n\n/**\n * Unique identifier of the nitrobase file.\n *\n * Get from user for select nitrobase file.\n */\nexport type StoreFileId = {\n /**\n * The nitrobase filename.\n */\n readonly name: string;\n\n /**\n * The region where the nitrobase file is located.\n * @see {@link Region}\n */\n readonly region: Region;\n\n /**\n * The owner of the nitrobase file.\n * If the region is `Region.PerX` then this is the user id, device id, or token id etc.\n * @see {@link Region}\n *\n */\n readonly ownerId?: string;\n\n /**\n * The schema version for easy migration by user.\n * If not specified, the default value is `1`.\n */\n schemaVer?: number;\n};\n\n/**\n * Nitrobase the complete metadata of the file in the root database.\n */\nexport type StoreFileStat = StoreFileId & {\n /**\n * The type of the nitrobase file.\n *\n * @see {@link StoreFileType}\n */\n readonly type: StoreFileType;\n\n /**\n * The extension used for the nitrobase file.\n *\n * @see {@link StoreFileExtension}\n */\n readonly extension?: StoreFileExtension;\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 * If not specified, the default value get from AlwatrNitrobase `defaultChangeDebounce`.\n */\n readonly changeDebounce?: number;\n\n /**\n * The name of the migration process.\n * This is used to migrate the nitrobase file to a new schema version.\n */\n readonly migrateName?: string;\n\n /**\n * The time-to-live (TTL) of the nitrobase file in memory.\n */\n // readonly ttl?: number;\n};\n\n/**\n * Represents the metadata of a nitrobase file.\n */\nexport type StoreFileMeta = StoreFileStat & {\n /**\n * Nitrobase file format version.\n */\n fv: number;\n\n /**\n * The revision number of the nitrobase file.\n *\n * This number is incremented every time the nitrobase file is updated.\n */\n rev: number;\n\n /**\n * The Unix timestamp (in milliseconds since the epoch) for when the nitrobase file was created.\n */\n readonly created: number;\n\n /**\n * The Unix timestamp (in milliseconds since the epoch) for when the nitrobase file was updated.\n */\n updated: number;\n\n /**\n * Last auto increment id.\n */\n lastAutoId?: number;\n\n /**\n * The extra metadata for the nitrobase file.\n */\n extra: JsonObject;\n};\n\nexport type StoreFileData<T extends JsonObject = JsonObject> = T;\n\n/**\n * Represents the context of a nitrobase file.\n * @template TData The type of the data content in the nitrobase file.\n */\nexport type StoreFileContext<TData extends JsonObject = JsonObject> = {\n /**\n * The status of the nitrobase file.\n *\n * if false, the Alwatr nitrobase throws an error.\n */\n readonly ok: true;\n\n /**\n * The metadata of the nitrobase file.\n * @see {@link StoreFileMeta}\n */\n readonly meta: StoreFileMeta;\n\n /**\n * The data content of the nitrobase file.\n */\n readonly data: TData;\n};\n\n/**\n * Nitrobase file meta only content type.\n */\nexport type StoreFileMetaOnlyContext = Omit<StoreFileContext<never>, 'data'>;\n\n// *** Documents ***\n\n/**\n * StoreFileContext for document type.\n */\nexport type DocumentContext<T extends JsonObject = JsonObject> = StoreFileContext<T>;\n\n// *** Collections ***\n\n/**\n * The metadata of an item in a collection.\n */\nexport type CollectionItemMeta = {\n /**\n * The unique identifier for the collection item.\n */\n readonly id: string | number;\n\n /**\n * The Unix timestamp (in milliseconds since the epoch) for when the collection item was created.\n */\n readonly created: number;\n\n /**\n * The Unix timestamp (in milliseconds since the epoch) for when the collection item was updated.\n */\n updated: number;\n\n /**\n * The revision number for the collection item.\n *\n * This number is incremented each time the item is updated.\n */\n rev: number;\n};\n\n/**\n * Collection item context type.\n */\nexport type CollectionItem<TData extends JsonObject = JsonObject> = {\n /**\n * Collection item's metadata.\n */\n readonly meta: CollectionItemMeta;\n\n /**\n * Collection item data.\n */\n readonly data: TData;\n};\n\n/**\n * Collection item context type.\n */\nexport type CollectionContext<T extends JsonObject = JsonObject> = StoreFileContext<DictionaryReq<CollectionItem<T>>>;\n\nexport type AlwatrAuth = {\n userId: string;\n userToken: string;\n};\n"
6
6
  ],
7
7
  "mappings": ";AAMO,IAAK,GAAL,CAAK,IAAL,CAIL,SAAS,IAKT,gBAAgB,IAKhB,WAAW,IAKX,UAAU,IAKV,WAAW,IAMX,SAAS,OA9BC,QAoCL,IAAK,GAAL,CAAK,IAAL,CAIL,WAAW,MAKX,aAAa,MAKb,uBAAuB,QAdb,QAoBL,IAAK,GAAL,CAAK,IAIV,OAAO,OAJG",
8
- "debugId": "254008C60655E0FB64756E2164756E21",
8
+ "debugId": "3FB6A6119A0615A364756E2164756E21",
9
9
  "names": []
10
10
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alwatr/nitrobase-types",
3
- "version": "9.1.0",
3
+ "version": "9.2.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
5
  "license": "MPL-2.0",
6
6
  "author": "S. Ali Mihandoost <ali.mihandoost@gmail.com> (https://ali.mihandoost.com)",
@@ -10,7 +10,7 @@
10
10
  "url": "https://github.com/Alwatr/alwatr",
11
11
  "directory": "pkg/nitrobase-old/types"
12
12
  },
13
- "homepage": "https://github.com/Alwatr/alwatr/tree/main/pkg/nitrobase-old/types#readme",
13
+ "homepage": "https://github.com/Alwatr/alwatr/tree/next/pkg/nitrobase-old/types#readme",
14
14
  "bugs": "https://github.com/Alwatr/alwatr/issues",
15
15
  "exports": {
16
16
  ".": {
@@ -21,13 +21,13 @@
21
21
  },
22
22
  "sideEffects": false,
23
23
  "dependencies": {
24
- "@alwatr/type-helper": "9.1.0"
24
+ "@alwatr/type-helper": "9.1.1"
25
25
  },
26
26
  "devDependencies": {
27
- "@alwatr/nano-build": "9.1.0",
28
- "@alwatr/tsconfig-base": "9.1.0",
27
+ "@alwatr/nano-build": "9.1.1",
28
+ "@alwatr/tsconfig-base": "9.1.1",
29
29
  "@alwatr/type-helper": "workspace:*",
30
- "@types/node": "^25.5.0",
30
+ "@types/node": "^24.12.2",
31
31
  "typescript": "^6.0.2"
32
32
  },
33
33
  "scripts": {
@@ -70,5 +70,5 @@
70
70
  "typescript"
71
71
  ],
72
72
  "prettier": "@alwatr/nanolib/prettier-config",
73
- "gitHead": "4a25cd3e0499cf61dd761e87d3711abf9b0cd208"
73
+ "gitHead": "b9dc0cb8b04b16216d44fbe9a9682f2a57926167"
74
74
  }