@moshaver/cmb-system 0.0.0-stage → 0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Mobin Karam
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,14 @@
1
- # Temporary Holding Version
1
+ # `@moshaver/cmb-system`
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Framework-neutral system metadata primitives. Nest transport, TypeORM, SQLite inspection, backup/restore, filesystem operations, and operational policy stay in the API adapter.
4
+
5
+ ## Install and use
6
+
7
+ ```bash
8
+ npm install @moshaver/cmb-system
9
+ ```
10
+
11
+ ```js
12
+ const { isValidAppVersion, projectAuditRecord } = require("@moshaver/cmb-system");
13
+ if (!isValidAppVersion("1.0.0")) throw new Error("invalid version");
14
+ ```
package/package.json CHANGED
@@ -1,6 +1,47 @@
1
1
  {
2
2
  "name": "@moshaver/cmb-system",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Composable Modular Backend system primitives.",
5
+ "type": "commonjs",
6
+ "main": "./src/index.js",
7
+ "types": "./src/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./src/index.d.ts",
11
+ "require": "./src/index.js",
12
+ "default": "./src/index.js"
13
+ }
14
+ },
15
+ "files": [
16
+ "src",
17
+ "README.md",
18
+ "LICENSE"
19
+ ],
20
+ "keywords": [
21
+ "cmb",
22
+ "modular-backend",
23
+ "backend",
24
+ "framework-agnostic",
25
+ "system"
26
+ ],
27
+ "engines": {
28
+ "node": ">=22.13.0 <23"
29
+ },
30
+ "repository": {
31
+ "type": "git",
32
+ "url": "git+https://github.com/Mobin-Karam/moshaver.git",
33
+ "directory": "packages/cmb/system"
34
+ },
35
+ "bugs": {
36
+ "url": "https://github.com/Mobin-Karam/moshaver/issues"
37
+ },
38
+ "homepage": "https://github.com/Mobin-Karam/moshaver/tree/main/packages/cmb",
39
+ "publishConfig": {
40
+ "access": "public"
41
+ },
42
+ "license": "MIT",
43
+ "sideEffects": false,
44
+ "dependencies": {
45
+ "@moshaver/cmb-kernel": "^0.1.0"
46
+ }
47
+ }
package/src/index.d.ts ADDED
@@ -0,0 +1,4 @@
1
+ export const SYSTEM_MODULE: Readonly<{ id: "system"; version: string; kind: "platform"; dependencies: readonly string[] }>;
2
+ export const APP_VERSION_PATTERN: RegExp;
3
+ export function isValidAppVersion(value: unknown): boolean;
4
+ export function projectAuditRecord<TDate, TMetadata>(record: { id: string; action: string; entity: string; actorUserId?: string | null; metadata?: TMetadata | null; createdAt: TDate }): { id: string; action: string; entity: string; actorUserId: string | null; metadata: TMetadata | null; createdAt: TDate };
package/src/index.js ADDED
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ const { defineModule } = require("@moshaver/cmb-kernel");
3
+ const SYSTEM_MODULE = defineModule({ id: "system", version: "0.1.0", kind: "platform", dependencies: ["kernel"] });
4
+ const APP_VERSION_PATTERN = /^\d+\.\d+\.\d+(?:[-+][0-9A-Za-z_.-]+)?$/;
5
+ function isValidAppVersion(value) { return APP_VERSION_PATTERN.test(String(value ?? "")); }
6
+ function projectAuditRecord(record) { return { id: record.id, action: record.action, entity: record.entity, actorUserId: record.actorUserId ?? null, metadata: record.metadata ?? null, createdAt: record.createdAt }; }
7
+ module.exports = { SYSTEM_MODULE, APP_VERSION_PATTERN, isValidAppVersion, projectAuditRecord };