@alwatr/nitrobase-types 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/CHANGELOG.md DELETED
@@ -1,239 +0,0 @@
1
- # Change Log
2
-
3
- All notable changes to this project will be documented in this file.
4
- See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
-
6
- ## [8.0.0](https://github.com/Alwatr/nitrobase/compare/v7.5.9...v8.0.0) (2025-02-24)
7
-
8
- **Note:** Version bump only for package @alwatr/nitrobase-types
9
-
10
- ## [7.5.8](https://github.com/Alwatr/nitrobase/compare/v7.5.7...v7.5.8) (2025-02-18)
11
-
12
- ### Dependencies update
13
-
14
- * bump @alwatr/nanolib, @alwatr/nano-build, and @types/node to latest versions across multiple packages ([3e89c62](https://github.com/Alwatr/nitrobase/commit/3e89c62ad20f3afe0c38c6ae36d91bcb6199b231)) by @
15
- * **deps-dev:** bump the dependencies group across 1 directory with 2 updates ([03715d0](https://github.com/Alwatr/nitrobase/commit/03715d0b5534b127dfb57ffe0ea713fb168eefe6)) by @dependabot[bot]
16
-
17
- ## [7.5.7](https://github.com/Alwatr/nitrobase/compare/v7.5.6...v7.5.7) (2025-02-03)
18
-
19
- ### Dependencies update
20
-
21
- * update [@alwatr](https://github.com/alwatr) dependencies to latest versions ([f8bb10f](https://github.com/Alwatr/nitrobase/commit/f8bb10fa3343f25e2a442e80fbddb88c55fac813)) by @
22
-
23
- ## [7.5.5](https://github.com/Alwatr/nitrobase/compare/v7.5.4...v7.5.5) (2025-02-02)
24
-
25
- ### Dependencies update
26
-
27
- * **deps-dev:** bump @types/node ([d60ee96](https://github.com/Alwatr/nitrobase/commit/d60ee96716b8df7837b3d7f9fe4b8705c94e5af0)) by @dependabot[bot]
28
- * update ([0b9eccd](https://github.com/Alwatr/nitrobase/commit/0b9eccd3b54dade17e3eeb94bd08612c57356801)) by @alimd
29
-
30
- ## [7.5.4](https://github.com/Alwatr/nitrobase/compare/v7.5.3...v7.5.4) (2025-01-12)
31
-
32
- ### Dependencies update
33
-
34
- * **deps-dev:** bump the dependencies group across 1 directory with 11 updates ([fdd30a6](https://github.com/Alwatr/nitrobase/commit/fdd30a6639ae7ead4e8dbfaca0295cb2bf0e6649)) by @dependabot[bot]
35
-
36
- ## [7.5.0](https://github.com/Alwatr/nitrobase/compare/v7.4.1...v7.5.0) (2024-11-09)
37
-
38
- ### Features
39
-
40
- * **types:** add `AlwatrAuth` ([bff7ab6](https://github.com/Alwatr/nitrobase/commit/bff7ab6cc3850173c30cf3b0408cfda9584df185)) by @mohammadhonarvar
41
-
42
- ## [7.4.0](https://github.com/Alwatr/nitrobase/compare/v7.3.1...v7.4.0) (2024-11-08)
43
-
44
- ### Dependencies update
45
-
46
- * bump @alwatr/nanolib from 5.2.0 to 5.2.1 across multiple packages ([e1f87b0](https://github.com/Alwatr/nitrobase/commit/e1f87b07d33e8227440256a70f012aa63410f153)) by @
47
- * **deps-dev:** bump @types/node in the dependencies group ([67ffbad](https://github.com/Alwatr/nitrobase/commit/67ffbad06c95c304d47acbe46fd137fb4cf69f95)) by @dependabot[bot]
48
- * **deps:** bump @alwatr/nanolib from 5.0.0 to 5.2.0 in the alwatr group ([dfa1eef](https://github.com/Alwatr/nitrobase/commit/dfa1eefb191bbaac2ff2fff410bb1d3ec615d959)) by @dependabot[bot]
49
-
50
- ## [7.3.1](https://github.com/Alwatr/nitrobase/compare/v7.3.0...v7.3.1) (2024-11-02)
51
-
52
- ### Miscellaneous Chores
53
-
54
- * **deps-dev:** bump the development-dependencies group with 8 updates ([63f7adc](https://github.com/Alwatr/nitrobase/commit/63f7adc5ff83d4876f34d4f089a4be9b95b711a6)) by @dependabot[bot]
55
- * **deps:** bump the alwatr-dependencies group with 2 updates ([20fb436](https://github.com/Alwatr/nitrobase/commit/20fb436b9f146d5ec7452a693c7af8faa32bedff)) by @dependabot[bot]
56
-
57
- ### Dependencies update
58
-
59
- * **deps-dev:** bump @types/node in the dependencies group ([dd3e94a](https://github.com/Alwatr/nitrobase/commit/dd3e94a4c007da8fddda4cfeffe5f0763d74952e)) by @dependabot[bot]
60
- * **deps:** bump the alwatr group with 6 updates ([eb9eeb1](https://github.com/Alwatr/nitrobase/commit/eb9eeb1901f7947cde783bf6f06340c984d6f59d)) by @dependabot[bot]
61
-
62
- ## [7.3.0](https://github.com/Alwatr/nitrobase/compare/v7.2.1...v7.3.0) (2024-10-11)
63
-
64
- ### Features
65
-
66
- * update `import`s & packages based on the latest changes of `nanolib` & prevent side-effects ([0d66f89](https://github.com/Alwatr/nitrobase/commit/0d66f894dc4ff615ab73ebd27c275f98dc384fbe)) by @mohammadhonarvar
67
-
68
- ### Code Refactoring
69
-
70
- * update `import`s & packages based on the latest changes of `nanolib` ([ce990a2](https://github.com/Alwatr/nitrobase/commit/ce990a2fedc5545e971c3bb6e58b55bfba8c0bd9)) by @mohammadhonarvar
71
-
72
- ### Miscellaneous Chores
73
-
74
- * **deps-dev:** bump the development-dependencies group with 10 updates ([7bdcf3f](https://github.com/Alwatr/nitrobase/commit/7bdcf3f47ddb8e1376a1c7ae6e221811182bae58)) by @dependabot[bot]
75
- * **deps:** bump the alwatr-dependencies group with 10 updates ([60afdde](https://github.com/Alwatr/nitrobase/commit/60afdde98562f3023e6624ee0579d6bdee80bc32)) by @dependabot[bot]
76
- * **deps:** bump the alwatr-dependencies group with 6 updates ([1cf29b2](https://github.com/Alwatr/nitrobase/commit/1cf29b20055554945cd669ea9d022ab7c503d9fc)) by @dependabot[bot]
77
-
78
- ## [7.2.1](https://github.com/Alwatr/nitrobase/compare/v7.2.0...v7.2.1) (2024-09-29)
79
-
80
- ### Miscellaneous Chores
81
-
82
- * **deps-dev:** bump @types/node in the development-dependencies group ([9b146d2](https://github.com/Alwatr/nitrobase/commit/9b146d2f6cf7d1d79a2a6f46a5e8f50e7fb2ac75)) by @dependabot[bot]
83
- * **types:** change the license to AGPL-3.0 ([b45e0a4](https://github.com/Alwatr/nitrobase/commit/b45e0a417b5d00735bc893236e72111e4caac63d)) by @ArmanAsadian
84
-
85
- ### Dependencies update
86
-
87
- * update ([90a0fe1](https://github.com/Alwatr/nitrobase/commit/90a0fe146eb703c183c116776d7c5748918282da)) by @
88
-
89
- ## [7.2.0](https://github.com/Alwatr/nitrobase/compare/v7.1.1...v7.2.0) (2024-09-24)
90
-
91
- ### Code Refactoring
92
-
93
- * rename all store to nitrobase ([0928420](https://github.com/Alwatr/nitrobase/commit/0928420d8751e16ff1e8d91e1d3048a5895885a6)) by @AliMD
94
- * rename all store to nitrobase ([9e31765](https://github.com/Alwatr/nitrobase/commit/9e31765b63ecd94bcf600cb44cfd9e341dd11a4e)) by @AliMD
95
-
96
- ## [7.1.1](https://github.com/Alwatr/nitrobase/compare/v7.1.0...v7.1.1) (2024-09-24)
97
-
98
- ### Miscellaneous Chores
99
-
100
- * **deps-dev:** bump the development-dependencies group across 1 directory with 3 updates ([122251c](https://github.com/Alwatr/nitrobase/commit/122251c315c422b7e9c2d5aba827f27b321194bb)) by @dependabot[bot]
101
- * **deps:** bump the alwatr-dependencies group with 9 updates ([2a94694](https://github.com/Alwatr/nitrobase/commit/2a94694b2ec12c2915aa77934023328751d13837)) by @dependabot[bot]
102
-
103
- ### Dependencies update
104
-
105
- * update ([82c475e](https://github.com/Alwatr/nitrobase/commit/82c475e29bd7f42ad03660556f40f180b3b6c9c6)) by @AliMD
106
-
107
- ## [7.1.0](https://github.com/Alwatr/nitrobase/compare/v7.0.0...v7.1.0) (2024-09-08)
108
-
109
- ### Miscellaneous Chores
110
-
111
- * **deps-dev:** bump the development-dependencies group with 2 updates ([f6d8374](https://github.com/Alwatr/nitrobase/commit/f6d837417886ccf3719100570194434455fda365)) by @dependabot[bot]
112
-
113
- ## [7.0.0](https://github.com/Alwatr/nitrobase/compare/v7.0.0-beta.1...v7.0.0) (2024-09-02)
114
-
115
- ### ⚠ BREAKING CHANGES
116
-
117
- * The ver property has been removed from the StoreFileMeta interface. Developers should update their code to remove any references to the ver property.
118
-
119
- ### Features
120
-
121
- * add `extra` property to StoreFileMeta ([5cdb573](https://github.com/Alwatr/nitrobase/commit/5cdb5735c2faf888a3fcea466ec3fd848e60148e)) by @AliMD
122
- * Add migrateName property to StoreFileStat ([f5b4f39](https://github.com/Alwatr/nitrobase/commit/f5b4f3904cec69ad96089daa800ed4243bd0f33e)) by @AliMD
123
- * Update type imports in alwatr-nitrobase.ts ([68064c4](https://github.com/Alwatr/nitrobase/commit/68064c4430c5aad8bca49d1f2a9270d6e64b051e)) by @AliMD
124
-
125
- ### Code Refactoring
126
-
127
- * Remove unused "ALWATR_DEBUG" environment variable from build script ([26e7642](https://github.com/Alwatr/nitrobase/commit/26e764280e0a2827904762ed3de21a9966ddfc63)) by @AliMD
128
- * Remove ver property from StoreFileMeta ([3c27903](https://github.com/Alwatr/nitrobase/commit/3c2790330c71857ffafd41495610abdd691c5486)) by @AliMD
129
-
130
- ### Dependencies update
131
-
132
- * update ([6411ff7](https://github.com/Alwatr/nitrobase/commit/6411ff7d49323b8bbf0dbb03fbc3c640b433a8bb)) by @
133
-
134
- ## [7.0.0-beta.1](https://github.com/Alwatr/nitrobase/compare/v7.0.0-beta.0...v7.0.0-beta.1) (2024-08-31)
135
-
136
- ### Code Refactoring
137
-
138
- * move schemaVer to storeId ([322b76d](https://github.com/Alwatr/nitrobase/commit/322b76d8432752f979e1d4fc3c2250e22945fd36)) by @
139
-
140
- ## [7.0.0-beta.0](https://github.com/Alwatr/nitrobase/compare/v6.2.1...v7.0.0-beta.0) (2024-08-31)
141
-
142
- ### Code Refactoring
143
-
144
- * update StoreFileStat type to make extension property optional ([e75a186](https://github.com/Alwatr/nitrobase/commit/e75a186fbafd30a3d745467a973bec06e1d8109e)) by @AliMD
145
-
146
- ### Dependencies update
147
-
148
- * update ([2657638](https://github.com/Alwatr/nitrobase/commit/26576384c4a8ffcf35776f19008432e194fb39de)) by @AliMD
149
-
150
- ## [6.2.1](https://github.com/Alwatr/nitrobase/compare/v6.2.0...v6.2.1) (2024-08-31)
151
-
152
- ### Miscellaneous Chores
153
-
154
- * **deps-dev:** bump the development-dependencies group across 1 directory with 13 updates ([7e6aa11](https://github.com/Alwatr/nitrobase/commit/7e6aa11e1b4507111993a6070b481ebc95e534c7)) by @dependabot[bot]
155
- * **deps:** bump the alwatr-dependencies group with 10 updates ([faf1fc1](https://github.com/Alwatr/nitrobase/commit/faf1fc15f8b4c9c4c451dd5fa1d564eb3bf3d9a3)) by @dependabot[bot]
156
- * **deps:** bump the alwatr-dependencies group with 9 updates ([64ac4f2](https://github.com/Alwatr/nitrobase/commit/64ac4f239c0f0a8ccdadbd736c16973bd684f811)) by @dependabot[bot]
157
-
158
- ## [6.1.0](https://github.com/Alwatr/nitrobase/compare/v6.0.5...v6.1.0) (2024-07-03)
159
-
160
- ### Features
161
-
162
- * schema version ([2590674](https://github.com/Alwatr/nitrobase/commit/259067435512b71f1f0aaea07566441cbb85e539)) by @AliMD
163
-
164
- ### Dependencies update
165
-
166
- * bump the development-dependencies ([546ca1b](https://github.com/Alwatr/nitrobase/commit/546ca1be049090eb3c8304fcb75e98ac0b984510)) by @AliMD
167
-
168
- ## [6.0.5](https://github.com/Alwatr/nitrobase/compare/v6.0.4...v6.0.5) (2024-05-12)
169
-
170
- ### Miscellaneous Chores
171
-
172
- * **deps-dev:** bump the development-dependencies group across 1 directory with 3 updates ([f97552d](https://github.com/Alwatr/nitrobase/commit/f97552d0e8e85bc2e2f0863da17502b8e55799e8)) by @dependabot[bot]
173
- * **deps:** bump the alwatr-dependencies group with 8 updates ([1aa95ca](https://github.com/Alwatr/nitrobase/commit/1aa95ca232a7b706eda4b0eb537316d38b27aa28)) by @dependabot[bot]
174
-
175
- ## [6.0.4](https://github.com/Alwatr/nitrobase/compare/v6.0.3...v6.0.4) (2024-04-25)
176
-
177
- **Note:** Version bump only for package @alwatr/nitrobase-types
178
-
179
- ## [6.0.3](https://github.com/Alwatr/nitrobase/compare/v6.0.2...v6.0.3) (2024-03-28)
180
-
181
- ### Miscellaneous Chores
182
-
183
- * **deps-dev:** bump the development-dependencies group with 13 updates ([23fb121](https://github.com/Alwatr/nitrobase/commit/23fb1217470593d386b658f2a1d85fe4ef6e55df)) by @dependabot[bot]
184
- * **deps:** bump the alwatr-dependencies group with 10 updates ([ce6ee74](https://github.com/Alwatr/nitrobase/commit/ce6ee7495aaa67a8d3bb0a3f2b2ea8389e161552)) by @dependabot[bot]
185
- * **deps:** bump the alwatr-dependencies group with 9 updates ([686e155](https://github.com/Alwatr/nitrobase/commit/686e155d4c0ccab6daf81d280cf91299152b8583)) by @dependabot[bot]
186
-
187
- ## [6.0.0](https://github.com/Alwatr/nitrobase/compare/v6.0.0-alpha.0...v6.0.0) (2024-01-24)
188
-
189
- ### Features
190
-
191
- * Enhance types, add Jsonifiable type and update method signatures ([57502d2](https://github.com/Alwatr/nitrobase/commit/57502d230f0c9cb88aa9a9e71a3460f1219955b0)) by @AliMD
192
-
193
- ### Miscellaneous Chores
194
-
195
- * **deps-dev:** bump the development-dependencies group with 4 updates ([7d71044](https://github.com/Alwatr/nitrobase/commit/7d71044165583f9d56fb61a05bdf51ccb104f422)) by @dependabot[bot]
196
- * **deps:** bump the alwatr-dependencies group with 10 updates ([cc42e89](https://github.com/Alwatr/nitrobase/commit/cc42e895179c53ee2dd60802d994ba84f5a37fde)) by @dependabot[bot]
197
- * **deps:** update ([0e85743](https://github.com/Alwatr/nitrobase/commit/0e85743f76f0efdd0f6cd4001eebc4550b43f43f)) by @AliMD
198
- * **deps:** update ([a894bfc](https://github.com/Alwatr/nitrobase/commit/a894bfc62124a3eb027cad4e8d1c974761e22dad)) by @AliMD
199
-
200
- ## [6.0.0-alpha.0](https://github.com/Alwatr/nitrobase/compare/v5.1.0...v6.0.0-alpha.0) (2024-01-15)
201
-
202
- ### ⚠ BREAKING CHANGES
203
-
204
- * **types:** `PerDevice` and `PerToken` in Region removed
205
-
206
- ### Code Refactoring
207
-
208
- * **types:** replace `PerDevice` and `PerToken` in Region enum with `PerOwner` ([2b47b5d](https://github.com/Alwatr/nitrobase/commit/2b47b5dd81e59ee33b17e4ae01253ea2cde5f9ab)) by @AliMD
209
-
210
- ### Miscellaneous Chores
211
-
212
- * **deps:** update ([8f3edcf](https://github.com/Alwatr/nitrobase/commit/8f3edcf8a489927a6c43dfcaa5db88a579ecac80)) by @
213
-
214
- ## [5.1.0](https://github.com/Alwatr/nitrobase/compare/v5.0.0...v5.1.0) (2024-01-13)
215
-
216
- ### Code Refactoring
217
-
218
- * Update nitrobaseRegionSecret value in Dockerfile and types file ([a0b13c6](https://github.com/Alwatr/nitrobase/commit/a0b13c6ff07599a425fa666437c0ebf167ccf6c8)) by @AliMD
219
-
220
- # [5.0.0](https://github.com/Alwatr/nitrobase/compare/v5.0.0-beta...v5.0.0) (2024-01-12)
221
-
222
- ### Code Refactoring
223
-
224
- * rename region SuperAdmin to Managers ([7c3ece8](https://github.com/Alwatr/nitrobase/commit/7c3ece8a24a88ea12a82966e41ea1ad7362159f4)) by @AliMD
225
-
226
- ### BREAKING CHANGES
227
-
228
- * region `SuperAdmin` renamed to `Managers`
229
-
230
- # [5.0.0-beta](https://github.com/Alwatr/nitrobase/compare/v4.1.0...v5.0.0-beta) (2023-12-31)
231
-
232
- ### Bug Fixes
233
-
234
- * **types:** StoreFileId interface ([d7b0f61](https://github.com/Alwatr/nitrobase/commit/d7b0f61d673e6c70c139454aae03f1472f6f7c31)) by @AliMD
235
-
236
- ### Features
237
-
238
- * **type/storeFileId:** change debounce ([0f459b6](https://github.com/Alwatr/nitrobase/commit/0f459b6bf51ef2ab79b35a738f7a58dd67686527)) by @AliMD
239
- * **types:** new package for nitrobase share types ([8487d02](https://github.com/Alwatr/nitrobase/commit/8487d0255b21ab02eecb0b6216e438fe0d0ca852)) by @AliMD
package/dist/main.cjs DELETED
@@ -1,56 +0,0 @@
1
- /* @alwatr/nitrobase-types v8.0.0 */
2
- "use strict";
3
- var __defProp = Object.defineProperty;
4
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
- var __getOwnPropNames = Object.getOwnPropertyNames;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
20
-
21
- // src/main.ts
22
- var main_exports = {};
23
- __export(main_exports, {
24
- Region: () => Region,
25
- StoreFileExtension: () => StoreFileExtension,
26
- StoreFileType: () => StoreFileType
27
- });
28
- module.exports = __toCommonJS(main_exports);
29
- var import_nanolib = require("@alwatr/nanolib");
30
- __dev_mode__: import_nanolib.packageTracer.add("@alwatr/nitrobase-types", "8.0.0");
31
- var Region = /* @__PURE__ */ ((Region2) => {
32
- Region2["Public"] = "p";
33
- Region2["Authenticated"] = "a";
34
- Region2["Managers"] = "m";
35
- Region2["PerUser"] = "u";
36
- Region2["PerOwner"] = "o";
37
- Region2["Secret"] = ".s";
38
- return Region2;
39
- })(Region || {});
40
- var StoreFileType = /* @__PURE__ */ ((StoreFileType2) => {
41
- StoreFileType2["Document"] = "doc";
42
- StoreFileType2["Collection"] = "col";
43
- StoreFileType2["AppendOnlyCollection"] = "aoc";
44
- return StoreFileType2;
45
- })(StoreFileType || {});
46
- var StoreFileExtension = /* @__PURE__ */ ((StoreFileExtension2) => {
47
- StoreFileExtension2["Json"] = "asj";
48
- return StoreFileExtension2;
49
- })(StoreFileExtension || {});
50
- // Annotate the CommonJS export names for ESM import in node:
51
- 0 && (module.exports = {
52
- Region,
53
- StoreFileExtension,
54
- StoreFileType
55
- });
56
- //# sourceMappingURL=main.cjs.map
package/dist/main.cjs.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/main.ts"],
4
- "sourcesContent": ["import {packageTracer} from '@alwatr/nanolib';\n\n__dev_mode__: packageTracer.add(__package_name__, __package_version__);\n\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"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAA4B;AAE5B,aAAc,8BAAc,IAAI,2BAAkB,OAAmB;AAO9D,IAAK,SAAL,kBAAKA,YAAL;AAIL,EAAAA,QAAA,YAAS;AAKT,EAAAA,QAAA,mBAAgB;AAKhB,EAAAA,QAAA,cAAW;AAKX,EAAAA,QAAA,aAAU;AAKV,EAAAA,QAAA,cAAW;AAMX,EAAAA,QAAA,YAAS;AA9BC,SAAAA;AAAA,GAAA;AAoCL,IAAK,gBAAL,kBAAKC,mBAAL;AAIL,EAAAA,eAAA,cAAW;AAKX,EAAAA,eAAA,gBAAa;AAKb,EAAAA,eAAA,0BAAuB;AAdb,SAAAA;AAAA,GAAA;AAoBL,IAAK,qBAAL,kBAAKC,wBAAL;AAIL,EAAAA,oBAAA,UAAO;AAJG,SAAAA;AAAA,GAAA;",
6
- "names": ["Region", "StoreFileType", "StoreFileExtension"]
7
- }
package/dist/main.mjs DELETED
@@ -1,30 +0,0 @@
1
- /* @alwatr/nitrobase-types v8.0.0 */
2
-
3
- // src/main.ts
4
- import { packageTracer } from "@alwatr/nanolib";
5
- __dev_mode__: packageTracer.add("@alwatr/nitrobase-types", "8.0.0");
6
- var Region = /* @__PURE__ */ ((Region2) => {
7
- Region2["Public"] = "p";
8
- Region2["Authenticated"] = "a";
9
- Region2["Managers"] = "m";
10
- Region2["PerUser"] = "u";
11
- Region2["PerOwner"] = "o";
12
- Region2["Secret"] = ".s";
13
- return Region2;
14
- })(Region || {});
15
- var StoreFileType = /* @__PURE__ */ ((StoreFileType2) => {
16
- StoreFileType2["Document"] = "doc";
17
- StoreFileType2["Collection"] = "col";
18
- StoreFileType2["AppendOnlyCollection"] = "aoc";
19
- return StoreFileType2;
20
- })(StoreFileType || {});
21
- var StoreFileExtension = /* @__PURE__ */ ((StoreFileExtension2) => {
22
- StoreFileExtension2["Json"] = "asj";
23
- return StoreFileExtension2;
24
- })(StoreFileExtension || {});
25
- export {
26
- Region,
27
- StoreFileExtension,
28
- StoreFileType
29
- };
30
- //# sourceMappingURL=main.mjs.map
package/dist/main.mjs.map DELETED
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/main.ts"],
4
- "sourcesContent": ["import {packageTracer} from '@alwatr/nanolib';\n\n__dev_mode__: packageTracer.add(__package_name__, __package_version__);\n\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"],
5
- "mappings": ";;;AAAA,SAAQ,qBAAoB;AAE5B,aAAc,eAAc,IAAI,2BAAkB,OAAmB;AAO9D,IAAK,SAAL,kBAAKA,YAAL;AAIL,EAAAA,QAAA,YAAS;AAKT,EAAAA,QAAA,mBAAgB;AAKhB,EAAAA,QAAA,cAAW;AAKX,EAAAA,QAAA,aAAU;AAKV,EAAAA,QAAA,cAAW;AAMX,EAAAA,QAAA,YAAS;AA9BC,SAAAA;AAAA,GAAA;AAoCL,IAAK,gBAAL,kBAAKC,mBAAL;AAIL,EAAAA,eAAA,cAAW;AAKX,EAAAA,eAAA,gBAAa;AAKb,EAAAA,eAAA,0BAAuB;AAdb,SAAAA;AAAA,GAAA;AAoBL,IAAK,qBAAL,kBAAKC,wBAAL;AAIL,EAAAA,oBAAA,UAAO;AAJG,SAAAA;AAAA,GAAA;",
6
- "names": ["Region", "StoreFileType", "StoreFileExtension"]
7
- }